Soil API

class owimetadatabase_preprocessor.soil.io.SoilAPI(api_root: str = 'https://owimetadatabase.owilab.be/api/v1', api_subdir: str = '/soildata/', token: str | None = None, uname: str | None = None, password: str | None = None, **kwargs)

Bases: API

Class to connect to the soil data API with methods to retrieve data.

A number of methods are provided to query the database via the owimetadatabase API. In the majority of cases, the methods return a dataframe based on the URL parameters provided. The methods are written such that a number of mandatory URL parameters are required (see documentation of the methods). The URL parameters can be expanded with Django-style additional filtering arguments (e.g. location__title__icontains="BB") as optional keyword arguments. Knowledge of the Django models is required for this (see owimetadatabase code).

Parameters:
  • api_root – Root URL for the API

  • token – Token for the API

  • uname – Username for the API

  • password – Password for the API

__init__(api_root: str = 'https://owimetadatabase.owilab.be/api/v1', api_subdir: str = '/soildata/', token: str | None = None, uname: str | None = None, password: str | None = None, **kwargs) None

Constructor for the SoilAPI class.

process_data(url_data_type: str, url_params: Dict[str, str], output_type: str) Tuple[DataFrame, Dict[str, bool | int | Response | None]]

Process output data according to specified request parameters.

Parameters:
  • url_data_type – Type of the data we want to request (according to database model).

  • url_params – Parameters to send with the request to the database.

  • output_type – Expected type (amount) of the data extracted.

Returns:

A tuple of dataframe with the requested data and additional data from postprocessing.

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

plot_testlocations(return_fig: bool = False, **kwargs) None

Retrieves soil test locations and generates a Plotly plot to show them.

Parameters:
  • return_fig – Boolean indicating whether the Plotly figure object needs to be returned (default is False which simply shows the plot)

  • kwargs – Keyword arguments for the search (see get_testlocations)

Returns:

Plotly figure object with selected asset locations plotted on OpenStreetMap tiles (if requested)

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_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

static soilprofile_pisa(soil_profile: DataFrame, pw: float = 1.025, sbl: float | None = None) DataFrame

Converts dataframes with soil profile data to a format suitable for PISA analysis.

Parameters:
  • soil_profile – Groundhog SoilProfile object obtained through the get_soilprofile_detail method

  • pw – Sea water density (default=1.025 t/m3)

  • sbl – Sea bed level in mLAT coordinates

Returns:

Dataframe containing soil model to carry out FE analysis through `owi_monopylat` of monopile following PISA guidance.

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 field

  • kwargs – Optional keyword arguments for retrieval of in-situ tests (e.g. projectsite and testtype)

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 field

  • kwargs – Optional keyword arguments for retrieval of in-situ tests (e.g. projectsite and testtype)

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 and testtype)

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

plot_soilprofile_fence(soilprofiles_df: DataFrame, start: str, end: str, plotmap: bool = False, fillcolordict: Dict[str, str] = {'CLAY': 'brown', 'SAND': 'yellow', 'SAND/CLAY': 'orange'}, logwidth: float = 100.0, show_annotations: bool = True, general_layout: Dict[Any, Any] = {}, **kwargs) Dict[str, List[DataFrame] | Figure]

Creates a fence diagram for soil profiles.

Parameters:
  • soilprofiles_df – Dataframe with summary data for the selected soil profiles

  • start – Name of the soil profile at the start

  • end – Name of the soil profile at the end

  • plotmap – Boolean determining whether a map with the locations is shown (default=False)

  • fillcolordict – Dictionary used for mapping soil types to colors

  • logwidth – Width of the logs in the fence diagram (default=100)

  • show_annotations – Boolean determining whether annotations are shown (default=True)

  • general_layout – Dictionary with general layout options (default = dict())

  • kwargs – Keyword arguments for the get_soilprofiles method

Returns:

Dictionary with the following keys:

  • ’profiles’: List of SoilProfile objects

  • ’diagram’: Plotly figure with the fence diagram

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

plot_cpt_fence(cpt_df: DataFrame, start: str, end: str, band: float = 1000.0, scale_factor: float = 10.0, extend_profile: bool = True, plotmap: bool = False, show_annotations: bool = True, general_layout: Dict[Any, Any] = {}, uniformcolor: str | None = None, **kwargs) Dict[str, List[DataFrame] | Figure]

Creates a fence diagram for CPTs.

Parameters:
  • cpt_df – Dataframe with the summary data of the selected CPTs

  • start – Name of the location for the start point

  • end – Name of the location for the end point

  • band – Thickness of the band (in m, default=1000m)

  • scale_factor – Width of the CPT axis in the fence diagram (default=10)

  • extend_profile – Boolean determining whether the profile needs to be extended (default=True)

  • plotmap – Boolean determining whether a map with the locations is shown (default=False)

  • show_annotations – Boolean determining whether annotations are shown (default=True)

  • general_layout – Dictionary with general layout options (default = dict())

  • uniformcolor – If a valid color is provided (e.g. ‘black’), it is used for all CPT traces

  • kwargs – Keyword arguments for the get_insitutests method

Returns:

Dictionary with the following keys:

  • ’cpts’: List of CPT objects

  • ’diagram’: Plotly figure with the fence diagram

plot_combined_fence(profiles: List[DataFrame], cpts: List[DataFrame], startpoint: str, endpoint: str, band: float = 1000.0, scale_factor: float = 10.0, extend_profile: bool = True, show_annotations: bool = True, general_layout: Dict[Any, Any] = {}, fillcolordict: Dict[str, str] = {'CLAY': 'brown', 'SAND': 'yellow', 'SAND/CLAY': 'orange'}, logwidth: float = 100.0, opacity: float = 0.5, uniformcolor: str | None = None, **kwargs) Dict[str, Figure]

Creates a combined fence diagram with soil profile and CPT data.

Parameters:
  • profiles – List with georeferenced soil profiles (run plot_soilprofile_fence first)

  • cpts – List with georeference CPTs (run plot_cpt_fence first)

  • startpoint – Name of the CPT location for the start point

  • endpoint – Name of the CPT location for the end point

  • band – Thickness of the band (in m, default=1000m)

  • scale_factor – Width of the CPT axis in the fence diagram (default=10)

  • extend_profile – Boolean determining whether the profile needs to be extended (default=True)

  • show_annotations – Boolean determining whether annotations are shown (default=True)

  • general_layout – Dictionary with general layout options (default = dict())

  • fillcolordict – Dictionary with colors for soil types

  • logwidth – Width of the log in the fence diagram

  • opacity – Opacity of the soil profile logs

  • uniformcolor – If a valid color is provided (e.g. ‘black’), it is used for all CPT traces

Returns:

Dictionary with the following keys:

  • ’diagram’: Plotly figure with the fence diagram for CPTs and soil profiles