{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# Data structures\n", "GeoST uses standardized internal data structures and data validation to ensure that the\n", "functionality that GeoST offers can always reliably be applied to parsed data. This user\n", "guide sections dives deeper into GeoST data structures. For a more basic overview of the\n", "concepts, see the [Introduction to GeoST](../getting_started/introduction.ipynb#concept).\n", "\n", "## Point and line data\n", "To describe point data (e.g. boreholes, well logs, cpts) and line data (e.g. seismics, \n", "GPR, EM) you need a minimal amount of information on the identification and position of each\n", "point/line (`Header`). For each point/line there are measurements or descriptions available \n", "of the subsurface (`Data`). The following header and data objects are used to\n", "describe point and line data:\n", "\n", "**Header objects:**\n", "* *[`PointHeader`](../api_reference/point_header.rst)* describes metadata and spatial information of point surveys.\n", "* *[`LineHeader`](../api_reference/line_header.rst)* describes metadata and spatial information of line surveys.\n", "\n", "**Data objects:**\n", "* *[`LayeredData`](../api_reference/layered_data.rst)* describes subsurface data in layers defined by tops and bottoms.\n", "* *[`DiscreteData`](../api_reference/discrete_data.rst)* describes subsurface data discretized by depth.\n", "* *LineData* NOTE: Not yet implemented\n", "\n", "These basic objects are used to build `Collections`. E.g. a [`BoreholeCollection`](../api_reference/borehole_collection.rst)\n", "is built from the combination of a [`PointHeader`](../api_reference/point_header.rst)\n", "object and a [`LayeredData`](../api_reference/layered_data.rst) objects. The below \n", "figure gives a complete overview of the object hierarchy in GeoST for point and line data.\n", "\n", "
\n", " \n", "
\n", "\n", "### Collection objects\n", "Collection objects are composed of an instance of Header and Data. The collection provides\n", "additional logic to maintain alignment between header and data. A collection object\n", "inherits all methods that are provided both through the child header object and the child data\n", "object. For example: you can access spatial selection methods (= header operations) as well as\n", "data slicing methods (= data operations) directly from the collection. It is recommended to\n", "work with collections by default, unless you specifically need only header or data functionality.\n", "\n", "GeoST currently offers the following collection classes:\n", "\n", "* *[`BoreholeCollection`](../api_reference/borehole_collection.rst)*: A collection of borehole data, composed of [`PointHeader`](../api_reference/point_header.rst) and [`LayeredData`](../api_reference/layered_data.rst).\n", "* *[`CptCollection`](../api_reference/cpt_collection.rst)*: A collection of cone penetration test data, composed of [`PointHeader`](../api_reference/point_header.rst) and [`DiscreteData`](../api_reference/discrete_data.rst).\n", "\n", "By default, read functions for point/line data return a collection (see: [Reading data](./reading_data.ipynb)). \n" ] }, { "cell_type": "code", "execution_count": 21, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "BoreholeCollection:\n", "# header = 67\n" ] } ], "source": [ "import geost\n", "\n", "# Load the Utrecht Science Park example borehole data\n", "boreholes_collection = geost.data.boreholes_usp()\n", "\n", "# boreholes_collection is an instance of BoreholeCollection and contains 67 boreholes\n", "print(boreholes_collection)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### Header objects\n", "GeoST header objects are built on top of a [`Geopandas.Geodataframe`](https://geopandas.org/en/stable/docs/reference/api/geopandas.GeoDataFrame.html)\n", "to hold data, including point geometries ([`PointHeader`](../api_reference/point_header.rst))\n", "or linestring geometries ([`LineHeader`](../api_reference/line_header.rst)). The Geodataframe \n", "is the attribute named `gdf` within a header object. Each entry (row in the Geodataframe) \n", "corresponds to one point or line survey, e.g. one borehole or one seismic line. GeoST \n", "header objects offer built-in methods for changing horizontal and vertical reference \n", "systems, selecting data based on spatial conditions, export of table data and export of \n", "geometries for viewing header data in GIS.\n", "\n", "A [`PointHeader`](../api_reference/point_header.rst) requires a bare minimum of data\n", "columns to describe the data and to ensure that all built-in methods can be applied:\n", "\n", "| Column name | Validation criteria | Description |\n", "| ----------- | ------------------- | ----------- |\n", "| nr | Must be interpretable as string | Identification name/number/code of the point survey |\n", "| x | Must be of numeric type (int or float) | X-coordinate |\n", "| y | Must be of numeric type (int or float) | Y-coordinate |\n", "| surface | Must be of numeric type (int or float) and higher than end depth | Surface elevation of the point survey in m |\n", "| end | Must be of numeric type (int or float) and lower than surface elevation | End depth of the point survey in m |\n", "| geometry | Must be of type `shapely.geometry.Point` | Point geometry of the survey location |\n", "\n", "The header is not limited to just these columns. Any number of columns can be added to give\n", "additional information on surveys. Some built-in analysis methods may even add information\n", "to the header. For instance, the method [`PointHeader.get_area_labels`](../api_reference/generated/geost.base.PointHeader.get_area_labels.rst)\n", "has an argument `include_in_header` which, if set to true, adds a column with results\n", "to the header Geodataframe.\n", "\n", "If you're only interested in survey locations and/or metadata, it is adviced to directly\n", "work with the header object to avoid additional overhead caused by a parent collection \n", "object (overhead is caused by checks of the header against data after every operation to \n", "ensure header/data alignment). Read functions for point and line data (see: [Reading data](./reading_data.ipynb))\n", "return a corresponding collection object by default, but you can assign only the header to \n", "a variable in order to continue with just the header data. See the example below." ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "EPSG:28992\n", "EPSG:5709\n" ] }, { "data": { "text/html": [ "\n", " | nr | \n", "x | \n", "y | \n", "surface | \n", "end | \n", "geometry | \n", "
---|---|---|---|---|---|---|
0 | \n", "B31H0541 | \n", "139585 | \n", "456000 | \n", "1.20 | \n", "-9.90 | \n", "POINT (139585 456000) | \n", "
1 | \n", "B31H0611 | \n", "139600 | \n", "455060 | \n", "1.20 | \n", "-23.00 | \n", "POINT (139600 455060) | \n", "
2 | \n", "B31H0718 | \n", "139950 | \n", "455200 | \n", "1.30 | \n", "-271.20 | \n", "POINT (139950 455200) | \n", "
3 | \n", "B31H0803 | \n", "139675 | \n", "455087 | \n", "2.16 | \n", "-4.84 | \n", "POINT (139675 455087) | \n", "
4 | \n", "B31H0806 | \n", "139684 | \n", "455384 | \n", "1.00 | \n", "-49.50 | \n", "POINT (139684 455384) | \n", "
\n", " | nr | \n", "x | \n", "y | \n", "surface | \n", "end | \n", "top | \n", "bottom | \n", "lith | \n", "zm | \n", "zmk | \n", "... | \n", "cons | \n", "color | \n", "lutum_pct | \n", "plants | \n", "shells | \n", "kleibrokjes | \n", "strat_1975 | \n", "strat_2003 | \n", "strat_inter | \n", "desc | \n", "
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
0 | \n", "B31H0541 | \n", "139585 | \n", "456000 | \n", "1.2 | \n", "-9.9 | \n", "0.00 | \n", "0.20 | \n", "K | \n", "NaN | \n", "None | \n", "... | \n", "None | \n", "ON | \n", "NaN | \n", "0 | \n", "0 | \n", "0 | \n", "None | \n", "EC | \n", "NaN | \n", "[TEELAARDE#***#****#*] .......................... | \n", "
1 | \n", "B31H0541 | \n", "139585 | \n", "456000 | \n", "1.2 | \n", "-9.9 | \n", "0.20 | \n", "0.60 | \n", "K | \n", "NaN | \n", "None | \n", "... | \n", "None | \n", "BR | \n", "NaN | \n", "0 | \n", "0 | \n", "0 | \n", "None | \n", "EC | \n", "NaN | \n", "[KLEI#***#****#*] grysbruin. | \n", "
2 | \n", "B31H0541 | \n", "139585 | \n", "456000 | \n", "1.2 | \n", "-9.9 | \n", "0.60 | \n", "0.95 | \n", "V | \n", "NaN | \n", "None | \n", "... | \n", "None | \n", "BR | \n", "NaN | \n", "0 | \n", "0 | \n", "0 | \n", "None | \n", "NI | \n", "NaN | \n", "[VEEN#***#****#*] donkerbruin. | \n", "
3 | \n", "B31H0541 | \n", "139585 | \n", "456000 | \n", "1.2 | \n", "-9.9 | \n", "0.95 | \n", "2.80 | \n", "Z | \n", "NaN | \n", "ZMFO | \n", "... | \n", "None | \n", "GR | \n", "NaN | \n", "0 | \n", "0 | \n", "0 | \n", "None | \n", "EC | \n", "NaN | \n", "[ZAND#***#****#*] FYN TOT matig fyn# iets slib... | \n", "
4 | \n", "B31H0541 | \n", "139585 | \n", "456000 | \n", "1.2 | \n", "-9.9 | \n", "2.80 | \n", "4.20 | \n", "Z | \n", "NaN | \n", "ZFC | \n", "... | \n", "None | \n", "BR | \n", "NaN | \n", "0 | \n", "0 | \n", "0 | \n", "None | \n", "BXWI | \n", "NaN | \n", "[ZAND#***#****#*] fyn# grysbruin. | \n", "
5 rows × 32 columns
\n", "\n", " | nr | \n", "x | \n", "y | \n", "vertical_datum | \n", "surface | \n", "cone_penetration_test_fk | \n", "cone_penetration_test_result_pk | \n", "penetration_length | \n", "depth | \n", "elapsed_time | \n", "... | \n", "magnetic_inclination | \n", "magnetic_declination | \n", "local_friction | \n", "pore_ratio | \n", "temperature | \n", "pore_pressure_u1 | \n", "pore_pressure_u2 | \n", "pore_pressure_u3 | \n", "friction_ratio | \n", "end | \n", "
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
0 | \n", "CPT000000009626 | \n", "140950.998794 | \n", "455358.997741 | \n", "NAP | \n", "2.0 | \n", "9579 | \n", "11690882 | \n", "0.2 | \n", "NaN | \n", "NaN | \n", "... | \n", "None | \n", "None | \n", "NaN | \n", "None | \n", "None | \n", "None | \n", "NaN | \n", "None | \n", "NaN | \n", "0 | \n", "
1 | \n", "CPT000000009626 | \n", "140950.998794 | \n", "455358.997741 | \n", "NAP | \n", "2.0 | \n", "9579 | \n", "11690883 | \n", "0.3 | \n", "NaN | \n", "NaN | \n", "... | \n", "None | \n", "None | \n", "NaN | \n", "None | \n", "None | \n", "None | \n", "NaN | \n", "None | \n", "NaN | \n", "0 | \n", "
2 | \n", "CPT000000009626 | \n", "140950.998794 | \n", "455358.997741 | \n", "NAP | \n", "2.0 | \n", "9579 | \n", "11690884 | \n", "0.4 | \n", "NaN | \n", "NaN | \n", "... | \n", "None | \n", "None | \n", "NaN | \n", "None | \n", "None | \n", "None | \n", "NaN | \n", "None | \n", "NaN | \n", "0 | \n", "
3 | \n", "CPT000000009626 | \n", "140950.998794 | \n", "455358.997741 | \n", "NAP | \n", "2.0 | \n", "9579 | \n", "11690885 | \n", "0.5 | \n", "NaN | \n", "NaN | \n", "... | \n", "None | \n", "None | \n", "NaN | \n", "None | \n", "None | \n", "None | \n", "NaN | \n", "None | \n", "NaN | \n", "0 | \n", "
4 | \n", "CPT000000009626 | \n", "140950.998794 | \n", "455358.997741 | \n", "NAP | \n", "2.0 | \n", "9579 | \n", "11690886 | \n", "0.6 | \n", "NaN | \n", "NaN | \n", "... | \n", "None | \n", "None | \n", "NaN | \n", "None | \n", "None | \n", "None | \n", "NaN | \n", "None | \n", "NaN | \n", "0 | \n", "
5 rows × 33 columns
\n", "\n", " \n", "
\n", "\n", "### Voxel models\n", "The [`VoxelModel`](../api_reference/voxelmodel.rst) class stores data in the `ds` \n", "attribute, which is an [`Xarray.Dataset`](https://docs.xarray.dev/en/stable/generated/xarray.Dataset.html).\n", "A custom voxel model can be instantiated from a NetCDF file. For this, see the documentation of the \n", "[`VoxelModel.from_netcdf`](../api_reference/generated/geost.models.VoxelModel.from_netcdf.rst) class constructor.\n", "An instance of [`VoxelModel`](../api_reference/voxelmodel.rst) offers basic methods for \n", "selecting, slicing and exporting models.\n", "\n", "For more guidance on using a Voxel model within GeoST, see the [BRO GeoTOP](../user_guide/bro_geotop.ipynb)\n", "section in the user guide.\n", "\n", "\n" ] } ], "metadata": { "kernelspec": { "display_name": "default", "language": "python", "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.12.7" } }, "nbformat": 4, "nbformat_minor": 2 }