Soil API
API client Module for the soil data in the OWIMetadatabase.
- class owimetadatabase_preprocessor.soil.io.SoilAPI(api_subdir: str = '/soildata/', **kwargs)
Bases:
API
API client to handle HTTP communication for soil data. Inherits common functionality from the API class.
- __init__(api_subdir: str = '/soildata/', **kwargs) None
Constructor for the SoilAPI.
- Parameters:
api_root – Base URL for the API.
api_subdir – Sub-directory for soil data endpoints.
token – API token (if required). A Bearer token will be used.
uname – Username for authentication.
password – Password for authentication.
- get_proximity_entities_2d(api_url: str, latitude: float, longitude: float, radius: float, **kwargs) Dict[str, DataFrame | bool | None]
Find the entities in a certain radius around a point in 2D (cylindrical search area).
- Parameters:
latitude – Latitude of the central point in decimal format
longitude – Longitude of the central point in decimal format
radius – Initial search radius around the central point in km
kwargs – Optional keyword arguments for the search
- Returns:
Dictionary with the following keys:
”data”: Pandas dataframe with the data according to the specified search criteria
”exists”: Boolean indicating whether matching records are found
- get_closest_entity_2d(api_url: str, latitude: float, longitude: float, radius_init: float = 1.0, target_srid: str = '25831', **kwargs) Dict[str, DataFrame | int | str | float | None]
Get the entity closest to a certain point in 2D with optional query arguments (cylindrical search area).
- Parameters:
api_url – End-point for the API
latitude – Latitude of the central point in decimal format
longitude – Longitude of the central point in decimal format
radius_init – Initial search radius around the central point in km, the search radius is increased until locations are found
target_srid – SRID for the offset calculation in meters
kwargs – Optional keyword arguments e.g.
campaign__projectsite__title__icontains='HKN'
- Returns:
Dictionary with the following keys:
- ’data’: Pandas dataframe with the test location data for each
location in the specified search area
’id’: ID of the closest test location
’title’: Title of the closest test location
’offset [m]’: Offset in meters from the specified point
- get_closest_entity_3d(api_url: str, latitude: float, longitude: float, depth: float, radius_init: float = 1.0, target_srid: str = '25831', sampletest: bool = True, **kwargs) Dict[str, DataFrame | int | str | float | None]
Get the entity closest to a certain point in 3D (spherical search area) with optional query arguments.
- Parameters:
api_url – End-point for the API
latitude – Latitude of the central point in decimal format
longitude – Longitude of the central point in decimal format
depth – of the central point in meters below seabed
radius_init – Initial search radius around the central point in km, the search radius is increased until locations are found
target_srid – SRID for the offset calculation in meters
sampletest – Boolean indicating whether a sample or sample test needs to be retrieved (default is True to search for sample tests)
kwargs – Optional keyword arguments e.g.
campaign__projectsite__title__icontains='HKN'
- Returns:
Dictionary with the following keys:
- ’data’: Pandas dataframe with the test location data for each
location in the specified search area
’id’: ID of the closest test location
’title’: Title of the closest test location
’offset [m]’: Offset in meters from the specified point
- get_surveycampaigns(projectsite: str | None = None, **kwargs) Dict[str, DataFrame | bool | None]
Get all available survey campaigns, specify a projectsite to filter by projectsite.
- Parameters:
projectsite – String with the projectsite title (e.g. “Nobelwind”)
- Returns:
Dictionary with the following keys:
- ’data’: Pandas dataframe with the location data for each location
in the projectsite
’exists’: Boolean indicating whether matching records are found
- get_surveycampaign_detail(projectsite: str, campaign: str, **kwargs) Dict[str, DataFrame | bool | int | None]
Get details for a specific survey campaign.
- Parameters:
projectsite – Name of the projectsite (e.g. “Nobelwind”)
campaign – Title of the survey campaign (e.g. “Borehole campaign”)
- Returns:
Dictionary with the following keys:
’id’: id of the selected projectsite site
- ’data’: Pandas dataframe with the location data for the individual
location
’exists’: Boolean indicating whether a matching location is found
- get_proximity_testlocations(latitude: float, longitude: float, radius: float, **kwargs) Dict[str, DataFrame | bool | None]
Get all soil test locations in a certain radius surrounding a point with given lat/lon.
- Parameters:
latitude – Latitude of the central point in decimal format
longitude – Longitude of the central point in decimal format
radius – Radius around the central point in km
- Returns:
Dictionary with the following keys:
- ’data’: Pandas dataframe with the test location data for each
location in the specified search area
’exists’: Boolean indicating whether matching records are found
- get_closest_testlocation(latitude: float, longitude: float, radius: float = 1.0, target_srid: str = '25831', **kwargs) Dict[str, DataFrame | int | str | float | None]
Get the soil test location closest to a certain point with the name containing a certain string.
- Parameters:
latitude – Latitude of the central point in decimal format
longitude – Longitude of the central point in decimal format
- Returns:
Dictionary with the following keys:
- ’data’: Pandas dataframe with the test location data for each
location in the specified search area
’id’: ID of the closest test location
’title’: Title of the closest test location
’offset [m]’: Offset in meters from the specified point
- get_testlocations(projectsite: str | None = None, campaign: str | None = None, **kwargs) Dict[str, DataFrame | bool | None]
Get the geotechnical test locations corresponding to the given search criteria.
- Parameters:
projectsite – Name of the projectsite under consideration (e.g. “Nobelwind”, optional, default is None)
campaign – Name of the survey campaign (optional, default is None to return all locations in a projectsite)
- Returns:
Dictionary with the following keys:
- ’data’: Pandas dataframe with the test location data for each
location meeting the specified search criteria
’exists’: Boolean indicating whether matching records are found
- get_testlocation_detail(location: str, projectsite: str | None = None, campaign: str | None = None, **kwargs) Dict[str, DataFrame | bool | int | None]
Get the detailed information for a geotechnical test location.
- Parameters:
location – Name of a specific location (e.g. “CPT-888”)
projectsite – Optional, name of the projectsite under consideration (e.g. “Nobelwind”)
campaign – Optional, name of the survey campaign (e.g. “Borehole campaign”)
- Returns:
Dictionary with the following keys:
’id’: id of the selected test location
- ’data’: Pandas dataframe with the test location data for each
location meeting the specified search criteria
’exists’: Boolean indicating whether matching records are found
- testlocation_exists(location: str, projectsite: str | None = None, campaign: str | None = None, **kwargs) int | bool
Checks if the test location answering to the search criteria exists.
- Parameters:
location – Name of a specific location (e.g. “CPT-888”)
projectsite – Optional, name of the projectsite under consideration (e.g. “Nobelwind”)
campaign – Optional, name of the survey campaign (e.g. “Borehole campaign”)
- Returns:
Returns the id if test location exists, False otherwise
- get_insitutest_types(**kwargs)
Retrieves the types of in-situ tests available in the database.
- Parameters:
kwargs – Keywords arguments for the GET request
- Returns:
Dataframe with the available InSituTestType records
- insitutest_type_exists(testtype: str, **kwargs) int | bool
Checks if the in-situ test type answering to the search criteria exists and returns the id.
- Parameters:
testtype – Title of the in-situ test type (e.g. “Downhole PCPT”)
- Returns:
Returns the id if the in-situ test type exists, False otherwise
- get_insitutests(projectsite: str | None = None, location: str | None = None, testtype: str | None = None, insitutest: str | None = None, **kwargs) Dict[str, DataFrame | bool | None]
Get the detailed information (measurement data) for an in-situ test of given type.
- Parameters:
projectsite – Name of the projectsite (e.g. “Nobelwind”)
location – Name of the test location (e.g. “CPT-7C”)
testtype – Name of the test type (e.g. “PCPT”)
insitutest – Name of the in-situ test
- Returns:
Dictionary with the following keys:
’data’: Metadata of the insitu tests
- ’exists’: Boolean indicating whether a matching in-situ test is
found
- get_proximity_insitutests(latitude: float, longitude: float, radius: float, **kwargs) Dict[str, DataFrame | bool | None]
Get all in-situ tests in a certain radius surrounding a point with given lat/lon.
- Parameters:
latitude – Latitude of the central point in decimal format
longitude – Longitude of the central point in decimal format
radius – Radius around the central point in km
- Returns:
Dictionary with the following keys:
- ’data’: Pandas dataframe with the in-situ test summary data for
each in-situ test in the specified search area
’exists’: Boolean indicating whether matching records are found
- get_closest_insitutest(latitude: float, longitude: float, radius: float = 1.0, target_srid: str = '25831', **kwargs)
Get the in-situ test closest to a certain point with the name containing a certain string.
- Parameters:
latitude – Latitude of the central point in decimal format
longitude – Longitude of the central point in decimal format
radius – Initial search radius around the central point in km, the search radius is increased until locations are found
target_srid – SRID for the offset calculation in meters
kwargs – Optional keyword arguments e.g.
campaign__projectsite__title__icontains='HKN'
- Returns:
Dictionary with the following keys:
- ’data’: Pandas dataframe with the in-situ test data for each
in-situ test in the specified search area
’id’: ID of the closest in-situ test
’title’: Title of the closest in-situ test
’offset [m]’: Offset in meters from the specified point
- get_closest_insitutest_byname(projectsite: str, location: str, radius: float = 1.0, target_srid: str = '25831', **kwargs) Dict[str, DataFrame | int | str | float | None]
Get the in-situ test closest to a location specified by name.
- Parameters:
projectsite – Name of the projectsite (e.g. “Nobelwind”)
location – Name of the test location (e.g. “CPT-7C”)
radius – Initial search radius around the central point in km, the search radius is increased until locations are found
target_srid – SRID for the offset calculation in meters
kwargs – Optional keyword arguments for filtering tests
- Returns:
Dictionary with the following keys: - ‘data’: Pandas dataframe with the in-situ test data - ‘id’: ID of the closest in-situ test - ‘title’: Title of the closest in-situ test - ‘offset [m]’: Offset in meters from the location
- Raises:
ValueError – If the location does not exist
- get_closest_soilprofile_byname(projectsite: str, location: str, radius: float = 1.0, target_srid: str = '25831', retrieve_details: bool = True, verbose: bool = True, **kwargs) Dict[str, DataFrame | int | str | float | None]
Get the soil profile closest to a location specified by name.
- Parameters:
projectsite – Name of the projectsite (e.g. “Nobelwind”)
location – Name of the test location (e.g. “CPT-7C”)
radius – Initial search radius around the central point in km, the search radius is increased until locations are found
target_srid – SRID for the offset calculation in meters
retrieve_details – Boolean determining whether the soil profile detail needs to be retrieved. Default is true in which case the result of get_soilprofile_detail is returned
verbose – Boolean determining whether to print info about found profile
kwargs – Optional keyword arguments for filtering profiles
- Returns:
Dictionary with the following keys: - ‘data’: Pandas dataframe with the soil profile data - ‘id’: ID of the closest soil profile - ‘title’: Title of the closest soil profile - ‘offset [m]’: Offset in meters from the location If retrieve_details is True, returns the full soil profile details instead
- Raises:
ValueError – If the location does not exist
- get_insitutest_detail(insitutest: str, projectsite: str | None = None, location: str | None = None, testtype: str | None = None, combine: bool = False, **kwargs) Dict[str, DataFrame | int | bool | Response | None]
Get the detailed information (measurement data) for an in-situ test of give type.
- Parameters:
insitutest – Name of the in-situ test
projectsite – Name of the projectsite (e.g. “Nobelwind”)
location – Name of the test location (e.g. “CPT-7C”)
testtype – Name of the test type (e.g. “PCPT”)
combine – Boolean indicating whether raw and processed data needs to be combined (default=False). If true, processed data columns are appended to the rawdata dataframe
kwargs – Optional keyword arguments for further queryset filtering based on model attributes.
- Returns:
Dictionary with the following keys:
’id’: id of the selected test
’insitutestsummary’: Metadata of the insitu tests
’rawdata’: Raw data
’processed’: Processed data
’conditions’: Test conditions
’response’: Response text
’exists’: Boolean indicating whether a matching in-situ test is found
- get_cpttest_detail(insitutest: str, projectsite: str | None = None, location: str | None = None, testtype: str | None = None, combine: bool = False, cpt: bool = True, **kwargs) Dict[str, DataFrame | int | bool | Response | None]
Get the detailed information (measurement data) for an in-situ test of CPT type (seabed or downhole CPT)
- Parameters:
insitutest – Name of the in-situ test
projectsite – Name of the projectsite (e.g. “Nobelwind”)
location – Name of the test location (e.g. “CPT-7C”)
testtype – Name of the test type (e.g. “PCPT”)
combine – Boolean indicating whether raw and processed data needs to be combined (default=False). If true, processed data columns are appended to the rawdata dataframe
cpt – Boolean determining whether the in-situ test is a CPT or not. If True (default), a PCPTProcessing object is returned.
kwargs – Optional keyword arguments for the cpt data loading. Note that further queryset filtering based on model attributes is not possible with this method. The in-situ test needs to be fully defined by the required arguments.
- Returns:
Dictionary with the following keys:
’id’: id of the selected test
’insitutestsummary’: Metadata of the insitu tests
’rawdata’: Raw data
’processed’: Processed data
’conditions’: Test conditions
’response’: Response text
- ’cpt’: PCPTProcessing object (only if the CPT data is successfully
loaded)
- ’exists’: Boolean indicating whether a matching in-situ test is
found
- insitutest_exists(insitutest: str, projectsite: str | None = None, location: str | None = None, testtype: str | None = None, **kwargs) int | bool
Checks if the in-situ test answering to the search criteria exists.
- Parameters:
insitutest – Name of the in-situ test
projectsite – Name of the projectsite (e.g. “Nobelwind”)
location – Name of the test location (e.g. “CPT-7C”)
testtype – Name of the test type (e.g. “PCPT”)
- Returns:
Returns the id if the in-situ test exists, False otherwise
- get_soilprofiles(projectsite: str | None = None, location: str | None = None, soilprofile: str | None = None, **kwargs) Dict[str, DataFrame | bool | None]
Retrieves soil profiles corresponding to the search criteria.
- Parameters:
projectsite – Name of the projectsite (e.g. “Nobelwind”)
location – Name of the test location (e.g. “CPT-7C”)
soilprofile – Title of the soil profile (e.g. “Borehole log”)
- Returns:
Dictionary with the following keys:
’data’: Metadata for the soil profiles
- ’exists’: Boolean indicating whether a matching in-situ test is
found
- get_proximity_soilprofiles(latitude: float, longitude: float, radius: float, **kwargs) Dict[str, DataFrame | bool | None]
Get all soil profiles in a certain radius surrounding a point with given lat/lon.
- Parameters:
latitude – Latitude of the central point in decimal format
longitude – Longitude of the central point in decimal format
radius – Radius around the central point in km
- Returns:
Dictionary with the following keys:
- ’data’: Pandas dataframe with the soil profile summary data for
each soil profile in the specified search area
’exists’: Boolean indicating whether matching records are found
- get_closest_soilprofile(latitude: float, longitude: float, radius: float = 1.0, target_srid: str = '25831', **kwargs) Dict[str, DataFrame | int | str | float | None]
Get the soil profile closest to a certain point with additional conditions as optional keyword arguments.
- Parameters:
latitude – Latitude of the central point in decimal format
longitude – Longitude of the central point in decimal format
radius – Initial search radius around the central point in km, the search radius is increased until locations are found
target_srid – SRID for the offset calculation in meters
kwargs – Optional keyword arguments e.g.
location__title__icontains='HKN'
- Returns:
Dictionary with the following keys:
- ’data’: Pandas dataframe with the soil profile data for each soil
profile in the specified search area
’id’: ID of the closest in-situ test
’title’: Title of the closest in-situ test
’offset [m]’: Offset in meters from the specified point
- get_soilprofile_detail(projectsite: str | None = None, location: str | None = None, soilprofile: str | None = None, convert_to_profile: bool = True, profile_title: str | None = None, drop_info_cols: bool = True, **kwargs) Dict[str, DataFrame | int | str | bool | Response | None]
Retrieves a soil profile from the owimetadatabase and converts it to a groundhog SoilProfile object.
- Parameters:
projectsite – Name of the projectsite (e.g. “Nobelwind”)
location – Name of the test location (e.g. “CPT-7C”)
soilprofile – Title of the soil profile (e.g. “Borehole log”)
convert_to_profile – Boolean determining whether the soil profile needs to be converted to a groundhog SoilProfile object
drop_info_cols – Boolean determining whether or not to drop the columns with additional info (e.g. soil description, …)
- Returns:
Dictionary with the following keys: - ‘id’: id for the selected soil profile - ‘soilprofilesummary’: Metadata for the soil profile - ‘response’: Response text - ‘soilprofile’: Groundhog SoilProfile object (only if successfully processed) - ‘exists’: Boolean indicating whether a matching in-situ test is found
- soilprofile_exists(soilprofile: str, projectsite: str | None = None, location: str | None = None, **kwargs) int | bool
Checks if the specific soil profile exists.
- Parameters:
soilprofile – Title of the soil profile (e.g. “Borehole log”)
projectsite – Name of the projectsite (e.g. “Nobelwind”)
location – Name of the test location (e.g. “CPT-7C”)
- Returns:
Returns the id if soil profile exists, False otherwise
- soiltype_exists(soiltype: str, **kwargs) int | bool
Checks if a soiltype with a given name exists.
- Parameters:
soiltype – Name of the soil type
- Returns:
id of the soil type if it exists, False otherwise
- soilunit_exists(soilunit: str, projectsite: str | None = None, soiltype: str | None = None, **kwargs) int | bool
Checks if a certain soil unit exists.
- Parameters:
projectsite – Name of the project site
soiltype – Name of the soil type
soilunit – Name of the soil unit
- Returns:
id of the soil unit if it exists, False otherwise
- get_soilunits(projectsite: str | None = None, soiltype: str | None = None, soilunit: str | None = None, **kwargs) Dict[str, DataFrame | bool | None]
Finds all soil units corresponding to the search parameters.
- Parameters:
projectsite – Name of the projectsite (e.g.
"HKN"
)soiltype – Name of the soil type (e.g.
"SAND"
)soilunit – Name of the soil unit (e.g.
"Asse sand-clay"
)
- Returns:
Dictionary with the following keys:
’data’: Dataframe with the soil units returned from the query
’exists’: Boolean containing whether data is in the returned query
- get_batchlabtest_types(**kwargs) Dict[str, DataFrame | bool | None]
Retrieves the types of batch lab tests available in the database.
- Parameters:
kwargs – Keywords arguments for the GET request
- Returns:
Dataframe with the available InSituTestType records
- get_batchlabtests(projectsite: str | None = None, campaign: str | None = None, location: str | None = None, testtype: str | None = None, batchlabtest: str | None = None, **kwargs) Dict[str, DataFrame | bool | None]
Retrieves a summary of batch lab tests corresponding to the specified search criteria.
- Parameters:
projectsite – Project site name (e.g. ‘Nobelwind’)
campaign – Title of the survey campaign
location – Title of the test location
testtype – Title of the test type
batchlabtest – Title of the batch lab test
- Returns:
Dictionary with the following keys
’data’: Dataframe with details on the batch lab test
- ’exists’: Boolean indicating whether records meeting the specified
search criteria exist
- batchlabtesttype_exists(batchlabtesttype: str, **kwargs) int | bool
Checks if the geotechnical sample type answering to the search criteria exists.
- Parameters:
batchlabtesttype – Title of the batch lab test type
- Returns:
Returns the id if the sample type exists, False otherwise
- get_proximity_batchlabtests(latitude: float, longitude: float, radius: float, **kwargs) Dict[str, DataFrame | bool | None]
Gets all batch lab tests in a certain radius surrounding a point with given lat/lon.
- Parameters:
latitude – Latitude of the central point in decimal format
longitude – Longitude of the central point in decimal format
radius – Radius around the central point in km
- Returns:
Dictionary with the following keys:
- ’data’: Pandas dataframe with the batch lab test summary data
for each batch lab test in the specified search area
’exists’: Boolean indicating whether matching records are found
- get_closest_batchlabtest(latitude: float, longitude: float, radius: float = 1.0, target_srid: str = '25831', **kwargs)
Gets the batch lab test closest to a certain point with the name containing a certain string.
- Parameters:
latitude – Latitude of the central point in decimal format
longitude – Longitude of the central point in decimal format
radius – Initial search radius around the central point in km, the search radius is increased until locations are found
target_srid – SRID for the offset calculation in meters
kwargs – Optional keyword arguments e.g.
location__title__icontains='BH'
- Returns:
Dictionary with the following keys:
- ’data’: Pandas dataframe with the batch lab test data for each
batch lab test in the specified search area
’id’: ID of the closest batch lab test
’title’: Title of the closest batch lab test
’offset [m]’: Offset in meters from the specified point
- get_batchlabtest_detail(batchlabtest: str, projectsite: str | None = None, location: str | None = None, testtype: str | None = None, campaign: str | None = None, **kwargs) Dict[str, DataFrame | int | bool | Response | None]
Retrieves detailed data for a specific batch lab test.
- Parameters:
projectsite – Title of the project site
campaign – Title of the survey campaign
location – Title of the test location
testtype – Title of the test type
batchlabtest – Title of the batch lab test
- Returns:
Dictionary with the following keys:
’id’: id for the selected soil profile
’summary’: Metadata for the batch lab test
’response’: Response text
’rawdata’: Dataframe with the raw data
’processeddata’: Dataframe with the raw data
’conditions’: Dataframe with test conditions
’exists’: Boolean indicating whether a matching record is found
- batchlabtest_exists(batchlabtest: str, projectsite: str | None = None, location: str | None = None, testtype: str | None = None, campaign: str | None = None, **kwargs) int | bool
Checks if the batch lab test answering to the search criteria exists.
- Parameters:
batchlabtest – Title of the batch lab test
projectsite – Project site name (e.g. ‘Nobelwind’)
campaign – Title of the survey campaign
location – Title of the test location
testtype – Title of the test type
- Returns:
Returns the id if batch lab test exists, False otherwise
- geotechnicalsampletype_exists(sampletype: str, **kwargs) int | bool
Checks if the geotechnical sample type answering to the search criteria exists.
- Parameters:
sampletype – Title of the sample type
- Returns:
Returns the id if the sample type exists, False otherwise
- get_geotechnicalsamples(projectsite: str | None = None, campaign: str | None = None, location: str | None = None, sampletype: str | None = None, sample: str | None = None, **kwargs) Dict[str, DataFrame | bool | None]
Retrieves geotechnical samples corresponding to the specified search criteria.
- Parameters:
projectsite – Project site name (e.g. ‘Nobelwind’)
campaign – Title of the survey campaign
location – Title of the test location
sampletype – Title of the sample type
sample – Title of the sample
- Returns:
Dictionary with the following keys
’data’: Dataframe with details on the sample
- ’exists’: Boolean indicating whether records meeting the specified
search criteria exist
- get_proximity_geotechnicalsamples(latitude: float, longitude: float, radius: float, **kwargs) Dict[str, DataFrame | bool | None]
Gets all geotechnical samples in a certain radius surrounding a point with given lat/lon.
- Parameters:
latitude – Latitude of the central point in decimal format
longitude – Longitude of the central point in decimal format
radius – Radius around the central point in km
- Returns:
Dictionary with the following keys:
- ’data’: Pandas dataframe with the geotechnical sample data for
each geotechnical sample in the specified search area
’exists’: Boolean indicating whether matching records are found
- get_closest_geotechnicalsample(latitude: float, longitude: float, depth: float, radius: float = 1.0, target_srid: str = '25831', **kwargs) Dict[str, DataFrame | int | str | float | None]
Gets the geotechnical sample closest to a certain point with the name containing a certain string.
- Parameters:
latitude – Latitude of the central point in decimal format
longitude – Longitude of the central point in decimal format
depth – Depth of the central point in meters below seabed
radius – Initial search radius around the central point in km, the search radius is increased until locations are found
target_srid – SRID for the offset calculation in meters
kwargs – Optional keyword arguments e.g.
location__title__icontains='BH'
- Returns:
Dictionary with the following keys:
- ’data’: Pandas dataframe with the geotechnical sample data for
each geotechnical sample in the specified search area
’id’: ID of the closest batch lab test
’title’: Title of the closest batch lab test
’offset [m]’: Offset in meters from the specified point
- get_geotechnicalsample_detail(sample: str, projectsite: str | None = None, location: str | None = None, sampletype: str | None = None, campaign: str | None = None, **kwargs) Dict[str, DataFrame | int | bool | Response | None]
Retrieves detailed data for a specific sample.
- Parameters:
sample – Title of the sample
projectsite – Title of the project site
campaign – Title of the survey campaign
location – Title of the test location
sampletype – Title of the sample type
- Returns:
Dictionary with the following keys:
’id’: id for the selected soil profile
’data’: Metadata for the batch lab test
’response’: Response text
’exists’: Boolean indicating whether a matching record is found
- geotechnicalsample_exists(sample: str, projectsite: str | None = None, location: str | None = None, sampletype: str | None = None, campaign: str | None = None, **kwargs) int | bool
Checks if the geotechnical sample answering to the search criteria exists.
- Parameters:
sample – Title of the sample
projectsite – Project site name (e.g. ‘Nobelwind’)
campaign – Title of the survey campaign
location – Title of the test location
sampletype – Title of the sample type
- Returns:
Returns the id if the geotechnical sample exists, False otherwise
- get_sampletests(projectsite: str | None = None, campaign: str | None = None, location: str | None = None, sample: str | None = None, testtype: str | None = None, sampletest: str | None = None, **kwargs) Dict[str, DataFrame | bool | None]
Retrieves a summary of geotechnical sample lab tests corresponding to the specified search criteria.
- Parameters:
projectsite – Title of the project site
campaign – Title of the survey campaign
location – Title of the test location
sample – Title of the sample
testtype – Title of the test type
sampletest – Title of the sample test
- Returns:
Dictionary with the following keys
’data’: Dataframe with details on the batch lab test
- ’exists’: Boolean indicating whether records meeting the
specified search criteria exist
- get_proximity_sampletests(latitude: float, longitude: float, radius: float, **kwargs) Dict[str, DataFrame | bool | None]
Gets all sample tests in a certain radius surrounding a point with given lat/lon.
- Parameters:
latitude – Latitude of the central point in decimal format
longitude – Longitude of the central point in decimal format
radius – Radius around the central point in km
- Returns:
Dictionary with the following keys:
- ’data’: Pandas dataframe with the sample test summary data for each
sample test in the specified search area
’exists’: Boolean indicating whether matching records are found
- get_closest_sampletest(latitude: float, longitude: float, depth: float, radius: float = 1.0, target_srid: str = '25831', **kwargs) Dict[str, DataFrame | int | str | float | None]
Gets the sample test closest to a certain point.
- Parameters:
latitude – Latitude of the central point in decimal format
longitude – Longitude of the central point in decimal format
Depth – Depth of the central point in meters below seabed
radius – Initial search radius around the central point in km, the search radius is increased until locations are found
target_srid – SRID for the offset calculation in meters
kwargs – Optional keyword arguments e.g.
sample__location__title__icontains='BH'
- Returns:
Dictionary with the following keys:
- ’data’: Pandas dataframe with the sample test data for each sample
test in the specified search area
’id’: ID of the closest sample test
’title’: Title of the closest sample test
’offset [m]’: Offset in meters from the specified point
- sampletesttype_exists(sampletesttype: str, **kwargs) int | bool
Checks if the sample test type answering to the search criteria exists.
- Parameters:
sampletesttype – Title of the sample test type
- Returns:
Returns the id if the sample test type exists, False otherwise
- get_sampletesttypes(**kwargs) Dict[str, DataFrame | bool | None]
Retrieves all sample tests types available in owimetadatabase.
- Returns:
Dictionary with the following keys
’data’: Dataframe with details on the batch lab test
- ’exists’: Boolean indicating whether records meeting the
specified search criteria exist
- get_sampletest_detail(sampletest: str, projectsite: str | None = None, location: str | None = None, testtype: str | None = None, sample: str | None = None, campaign: str | None = None, **kwargs) Dict[str, DataFrame | int | bool | Response | None]
Retrieves detailed information on a specific sample test based on the specified search criteria.
- Parameters:
sampletest – Title of the sample test
projectsite – Title of the project site
campaign – Title of the survey campaign
location – Title of the test location
sample – Title of the sample
testtype – Title of the test type
- Returns:
Dictionary with the following keys:
’id’: id for the selected soil profile
’summary’: Metadata for the batch lab test
’response’: Response text
’rawdata’: Dataframe with the raw data
’processeddata’: Dataframe with the raw data
’conditions’: Dataframe with test conditions
’exists’: Boolean indicating whether a matching record is found
- sampletest_exists(sampletest: str, projectsite: str | None = None, location: str | None = None, testtype: str | None = None, sample: str | None = None, campaign: str | None = None, **kwargs) int | bool
Checks if the batch lab test answering to the search criteria exists.
- Parameters:
sampletest – Title of the sample test
projectsite – Title of the project site
campaign – Title of the survey campaign
location – Title of the test location
sample – Title of the sample
testtype – Title of the test type
- Returns:
Returns the id if the sample test exists, False otherwise
- get_soilunit_depthranges(soilunit: str, projectsite: str | None = None, location: str | None = None, **kwargs) DataFrame
Retrieves the depth ranges for where the soil unit occurs.
- Parameters:
soilunit – Title of the soil unit for which depth ranges need to be retrieved
projectsite – Title of the project site (optional)
location – Title of the test location (optional)
- Returns:
Dataframe with the depth ranges for the soil unit
- get_unit_insitutestdata(soilunit: str, depthcol: str | None = 'z [m]', **kwargs) DataFrame
Retrieves proportions of in-situ test data located inside a soil unit. The data in the
rawdata
field is filtered based on the depth column.- Parameters:
soilunit – Name of the soil unit
depthcol – Name of the column with the depth in the
rawdata
fieldkwargs – Optional keyword arguments for retrieval of in-situ tests (e.g.
projectsite
andtesttype
)
- Returns:
Dataframe with in-situ test data in the selected soil unit.
- get_unit_batchlabtestdata(soilunit: str, depthcol: str | None = 'z [m]', **kwargs) DataFrame
Retrieves proportions of batch lab test data located inside a soil unit. The data in the
rawdata
field is filtered based on the depth column.- Parameters:
soilunit – Name of the soil unit
depthcol – Name of the column with the depth in the
rawdata
fieldkwargs – Optional keyword arguments for retrieval of in-situ tests (e.g.
projectsite
andtesttype
)
- Returns:
Dataframe with batch lab test data in the selected soil unit.
- get_unit_sampletests(soilunit: str, **kwargs) DataFrame
Retrieves the sample tests data located inside a soil unit. The metadata of the samples is filtered based on the depth column. Further retrieval of the test data can follow after this method.
- Parameters:
soilunit – Name of the soil unit
kwargs – Optional keyword arguments for retrieval of sample tests (e.g.
projectsite
andtesttype
)
- Returns:
Dataframe with sample test metadata in the selected soil unit.
- get_soilprofile_profile(lat1: float, lon1: float, lat2: float, lon2: float, band: float = 1000) DataFrame
Retrieves soil profiles along a profile line.
- Parameters:
lat1 – Latitude of the start point
lon1 – Longitude of the start point
lat2 – Latitude of the end point
lon2 – Longitude of the end point
band – Thickness of the band (in m, default=1000m)
- Returns:
Returns a dataframe with the summary data of the selected soil profiles
- get_insitutests_profile(lat1: float, lon1: float, lat2: float, lon2: float, band: float = 1000) DataFrame
Retrieves in-situ tests along a profile line.
- Parameters:
lat1 – Latitude of the start point
lon1 – Longitude of the start point
lat2 – Latitude of the end point
lon2 – Longitude of the end point
band – Thickness of the band (in m, default=1000m)
- Returns:
Returns a dataframe with the summary data of the selected in-situ tests