geost 0.2.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (49) hide show
  1. geost-0.2.0/LICENSE +21 -0
  2. geost-0.2.0/PKG-INFO +142 -0
  3. geost-0.2.0/README.md +80 -0
  4. geost-0.2.0/geost/__init__.py +14 -0
  5. geost-0.2.0/geost/_borehole.py +86 -0
  6. geost-0.2.0/geost/abstract_classes.py +251 -0
  7. geost-0.2.0/geost/analysis/__init__.py +6 -0
  8. geost-0.2.0/geost/analysis/interpret_cpt.py +50 -0
  9. geost-0.2.0/geost/analysis/layer_analysis.py +90 -0
  10. geost-0.2.0/geost/base.py +2040 -0
  11. geost-0.2.0/geost/bro/__init__.py +1 -0
  12. geost-0.2.0/geost/bro/api.py +182 -0
  13. geost-0.2.0/geost/bro/bro_utils.py +13 -0
  14. geost-0.2.0/geost/enums.py +7 -0
  15. geost-0.2.0/geost/export/__init__.py +2 -0
  16. geost-0.2.0/geost/export/geodataclass.py +119 -0
  17. geost-0.2.0/geost/export/vtk.py +70 -0
  18. geost-0.2.0/geost/header_factory.py +29 -0
  19. geost-0.2.0/geost/io/__init__.py +1 -0
  20. geost-0.2.0/geost/io/gef.py +40 -0
  21. geost-0.2.0/geost/io/parsers/__init__.py +2 -0
  22. geost-0.2.0/geost/io/parsers/gef_parsers.py +451 -0
  23. geost-0.2.0/geost/io/parsers/parser_utils.py +13 -0
  24. geost-0.2.0/geost/io/parsers/xml_parsers.py +264 -0
  25. geost-0.2.0/geost/mixins.py +105 -0
  26. geost-0.2.0/geost/projections.py +32 -0
  27. geost-0.2.0/geost/read.py +550 -0
  28. geost-0.2.0/geost/spatial.py +346 -0
  29. geost-0.2.0/geost/utils.py +156 -0
  30. geost-0.2.0/geost/validate/__init__.py +1 -0
  31. geost-0.2.0/geost/validate/decorators.py +44 -0
  32. geost-0.2.0/geost/validate/validate.py +159 -0
  33. geost-0.2.0/geost/validate/validation_schemes.py +43 -0
  34. geost-0.2.0/geost.egg-info/PKG-INFO +142 -0
  35. geost-0.2.0/geost.egg-info/SOURCES.txt +47 -0
  36. geost-0.2.0/geost.egg-info/dependency_links.txt +1 -0
  37. geost-0.2.0/geost.egg-info/requires.txt +20 -0
  38. geost-0.2.0/geost.egg-info/top_level.txt +1 -0
  39. geost-0.2.0/pyproject.toml +90 -0
  40. geost-0.2.0/setup.cfg +4 -0
  41. geost-0.2.0/tests/test_analysis.py +90 -0
  42. geost-0.2.0/tests/test_broapi.py +142 -0
  43. geost-0.2.0/tests/test_collections.py +498 -0
  44. geost-0.2.0/tests/test_data_objects.py +326 -0
  45. geost-0.2.0/tests/test_gefparser.py +166 -0
  46. geost-0.2.0/tests/test_headers.py +195 -0
  47. geost-0.2.0/tests/test_projections.py +23 -0
  48. geost-0.2.0/tests/test_read.py +129 -0
  49. geost-0.2.0/tests/test_spatial_utils.py +79 -0
geost-0.2.0/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2022 Deltares / TGG projects / Subsurface Toolbox
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
geost-0.2.0/PKG-INFO ADDED
@@ -0,0 +1,142 @@
1
+ Metadata-Version: 2.1
2
+ Name: geost
3
+ Version: 0.2.0
4
+ Summary: The Python interface for geological point data in The Netherlands
5
+ Author-email: Erik van Onselen <erik.vanonselen@deltares.nl>, Bas Knaake <bas.knaake@deltares.nl>, Tommer Vermaas <tommer.vermaas@deltares.nl>
6
+ License: MIT License
7
+
8
+ Copyright (c) 2022 Deltares / TGG projects / Subsurface Toolbox
9
+
10
+ Permission is hereby granted, free of charge, to any person obtaining a copy
11
+ of this software and associated documentation files (the "Software"), to deal
12
+ in the Software without restriction, including without limitation the rights
13
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
14
+ copies of the Software, and to permit persons to whom the Software is
15
+ furnished to do so, subject to the following conditions:
16
+
17
+ The above copyright notice and this permission notice shall be included in all
18
+ copies or substantial portions of the Software.
19
+
20
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
21
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
22
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
23
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
24
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
25
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
26
+ SOFTWARE.
27
+
28
+ Project-URL: Homepage, https://github.com/Deltares-research/geost
29
+ Project-URL: Repository, https://github.com/Deltares-research/geost
30
+ Project-URL: Issues, https://github.com/Deltares-research/geost/issues
31
+ Keywords: geost,bro,borehole,well log,cpt,geology,subsurface toolbox,deltares
32
+ Classifier: Development Status :: 2 - Pre-Alpha
33
+ Classifier: Intended Audience :: Science/Research
34
+ Classifier: Topic :: Scientific/Engineering
35
+ Classifier: License :: OSI Approved :: MIT License
36
+ Classifier: Operating System :: OS Independent
37
+ Classifier: Programming Language :: Python
38
+ Classifier: Programming Language :: Python :: 3.12
39
+ Classifier: Topic :: Scientific/Engineering
40
+ Requires-Python: >=3.12
41
+ Description-Content-Type: text/markdown
42
+ License-File: LICENSE
43
+ Requires-Dist: numpy
44
+ Requires-Dist: pandas>=2.0.1
45
+ Requires-Dist: pyarrow
46
+ Requires-Dist: lxml
47
+ Requires-Dist: pyproj
48
+ Requires-Dist: geopandas
49
+ Requires-Dist: xlrd
50
+ Requires-Dist: openpyxl
51
+ Requires-Dist: rioxarray>=0.15.3
52
+ Requires-Dist: shapely>=2.0.1
53
+ Requires-Dist: pyvista>=0.36.1
54
+ Provides-Extra: dev
55
+ Requires-Dist: pyvista; extra == "dev"
56
+ Requires-Dist: black; extra == "dev"
57
+ Requires-Dist: pytest; extra == "dev"
58
+ Requires-Dist: pytest-cov; extra == "dev"
59
+ Requires-Dist: ruff; extra == "dev"
60
+ Requires-Dist: sphinx; extra == "dev"
61
+ Requires-Dist: sphinx-rtd-theme; extra == "dev"
62
+
63
+ # GeoST - Geological Subsurface Toolbox
64
+ [![License: MIT](https://img.shields.io/pypi/l/imod)](https://choosealicense.com/licenses/mit)
65
+ [![Lifecycle: experimental](https://lifecycle.r-lib.org/articles/figures/lifecycle-experimental.svg)](https://lifecycle.r-lib.org/articles/stages.html)
66
+ [![Build: status](https://img.shields.io/github/actions/workflow/status/deltares-research/geost/ci.yml)](https://github.com/Deltares-research/geost/actions)
67
+ [![codecov](https://codecov.io/gh/Deltares-research/geost/graph/badge.svg?token=HCNGLWTQ2H)](https://codecov.io/gh/Deltares-research/geost)
68
+ [![Formatting: ruff](https://camo.githubusercontent.com/18c26428c337f9d641fa09b629a3a03b514e8ac84b57974a0ed7d1b38e14e060/68747470733a2f2f696d672e736869656c64732e696f2f656e64706f696e743f75726c3d68747470733a2f2f7261772e67697468756275736572636f6e74656e742e636f6d2f61737472616c2d73682f727566662f6d61696e2f6173736574732f62616467652f76322e6a736f6e)](https://github.com/charliermarsh/ruff)
69
+
70
+ The Geological Subsurface Toolbox (geost) package is designed to be an easy-to-use Python interface for working with subsurface point data in The Netherlands (boreholes, well logs and CPT's). It provides selection, analysis and export methods that can be applied generically to the loaded data. It is designed to connect with other Deltares developments such as [iMod](https://gitlab.com/deltares/imod) and [DataFusionTools](https://bitbucket.org/DeltaresGEO/datafusiontools/src/master/).
71
+
72
+ The internal BoreholeCollection, LogCollection and CptCollection classes use [Pandas](https://pandas.pydata.org/) for storing data and header information. It utilizes a custom, lightweight validation module inspired by the [Pandera](https://pandera.readthedocs.io/en/stable/) API. For spatial functions [Geopandas](https://geopandas.org/en/stable/) is used. The package also supports reading/writing parquet and geoparquet files through Pandas and Geopandas respectively.
73
+
74
+ GeoST is a work-in-progress and currently support a limited number of data sources.
75
+
76
+ ## Installation (user)
77
+ In a Python > 3.12 environment, install the latest stable release using pip:
78
+
79
+ pip install geost
80
+
81
+ Or the latest (experimental) version of the main branch directly from GitHub using:
82
+
83
+ pip install git+https://github.com/Deltares-research/geost.git
84
+
85
+ ## Installation (developer)
86
+ We use [Pixi](https://github.com/prefix-dev/pixi) for package management and workflows.
87
+
88
+ With pixi installed, navigate to the folder of the cloned repository and run:
89
+
90
+ pixi install
91
+
92
+ To install all GeoST dependencies. Next install GeoST in editable mode by running the
93
+ pixi task 'install':
94
+
95
+ pixi run install
96
+
97
+ See the [Pixi documentation](https://pixi.sh/latest/) for more information.
98
+
99
+ ## Supported borehole and CPT formats
100
+ - From local files
101
+ - geost .parquet file (complete)
102
+ - Dino csv geological boreholes (complete)
103
+ - Dino XML geological boreholes (planned)
104
+ - BRO XML geotechnical boreholes (planned)
105
+ - BRO XML soil boreholes (planned)
106
+ - GEF boreholes (planned)
107
+ - GEF CPT's (complete)
108
+ - BRO XML CPT's (planned)
109
+ - BRO geopackage CPT's (planned)
110
+ - Well log LAS files (planned)
111
+ - Well log ASCII files (planned)
112
+ - Directly from the BRO (REST API) (all planned)
113
+ - CPT
114
+ - BHR-P
115
+ - BHR-GT
116
+ - BHR-G
117
+
118
+ ## Features
119
+ After loading data from one of the supported formats it will automatically be validated. If the validation is succesful, a Collection object will be returned depending on your input data type (mixed CPT/well log/borehole collections are not allowed). A collection object consists of two main attributes: the **header** and **data**. The header contains a table with one entry per object and provides information about the name, location, surface level, and borehole/log/cpt start and end depths. The data attribute is a table that includes the data for every described layer (boreholes) or measurement (well logs, cpt's).
120
+
121
+ The collection object comes with a comprehensive set of methods that can be applied generically while ensuring that the header and data remain synchronized:
122
+
123
+ - Selection/slicing methods (e.g., objects within bounding box, within or close to geometries, based on depth and other conditions)
124
+ - Export methods (e.g. to csv, parquet, geopackage, VTK, DataFusionTools, Kingdom* , etc)
125
+ - Datafusion methods (e.g. combining collections*, combining with data from maps, conversion of description protocols*)
126
+ - Miscellaneous methods (e.g. changing vertical/horizontal position reference system)
127
+
128
+ For a better overview of basic functionality, see the [Basics Tutorial](https://gitlab.com/deltares/tgg-projects/subsurface-toolbox/pysst/-/blob/main/tutorials/basics.ipynb?ref_type=heads).
129
+
130
+ ## Contributing
131
+
132
+ You can contribute by testing, raising issues and making pull requests. Some general guidelines:
133
+
134
+ - Use new branches for developing new features or bugfixes. Use prefixes such as feature/ bugfix/ experimental/ to indicate the type of branch
135
+ - Add unit tests (and test data) for new methods and functions. We use pytest.
136
+ - Add Numpy-style docstrings
137
+ - Use Black formatting with default line lenght (88 characters)
138
+ - Update requirement.txt en environment.yml files if required
139
+
140
+ ## License
141
+ MIT license (Note: may change to a copyleft license in the future, depending on Deltares management decisions)
142
+
geost-0.2.0/README.md ADDED
@@ -0,0 +1,80 @@
1
+ # GeoST - Geological Subsurface Toolbox
2
+ [![License: MIT](https://img.shields.io/pypi/l/imod)](https://choosealicense.com/licenses/mit)
3
+ [![Lifecycle: experimental](https://lifecycle.r-lib.org/articles/figures/lifecycle-experimental.svg)](https://lifecycle.r-lib.org/articles/stages.html)
4
+ [![Build: status](https://img.shields.io/github/actions/workflow/status/deltares-research/geost/ci.yml)](https://github.com/Deltares-research/geost/actions)
5
+ [![codecov](https://codecov.io/gh/Deltares-research/geost/graph/badge.svg?token=HCNGLWTQ2H)](https://codecov.io/gh/Deltares-research/geost)
6
+ [![Formatting: ruff](https://camo.githubusercontent.com/18c26428c337f9d641fa09b629a3a03b514e8ac84b57974a0ed7d1b38e14e060/68747470733a2f2f696d672e736869656c64732e696f2f656e64706f696e743f75726c3d68747470733a2f2f7261772e67697468756275736572636f6e74656e742e636f6d2f61737472616c2d73682f727566662f6d61696e2f6173736574732f62616467652f76322e6a736f6e)](https://github.com/charliermarsh/ruff)
7
+
8
+ The Geological Subsurface Toolbox (geost) package is designed to be an easy-to-use Python interface for working with subsurface point data in The Netherlands (boreholes, well logs and CPT's). It provides selection, analysis and export methods that can be applied generically to the loaded data. It is designed to connect with other Deltares developments such as [iMod](https://gitlab.com/deltares/imod) and [DataFusionTools](https://bitbucket.org/DeltaresGEO/datafusiontools/src/master/).
9
+
10
+ The internal BoreholeCollection, LogCollection and CptCollection classes use [Pandas](https://pandas.pydata.org/) for storing data and header information. It utilizes a custom, lightweight validation module inspired by the [Pandera](https://pandera.readthedocs.io/en/stable/) API. For spatial functions [Geopandas](https://geopandas.org/en/stable/) is used. The package also supports reading/writing parquet and geoparquet files through Pandas and Geopandas respectively.
11
+
12
+ GeoST is a work-in-progress and currently support a limited number of data sources.
13
+
14
+ ## Installation (user)
15
+ In a Python > 3.12 environment, install the latest stable release using pip:
16
+
17
+ pip install geost
18
+
19
+ Or the latest (experimental) version of the main branch directly from GitHub using:
20
+
21
+ pip install git+https://github.com/Deltares-research/geost.git
22
+
23
+ ## Installation (developer)
24
+ We use [Pixi](https://github.com/prefix-dev/pixi) for package management and workflows.
25
+
26
+ With pixi installed, navigate to the folder of the cloned repository and run:
27
+
28
+ pixi install
29
+
30
+ To install all GeoST dependencies. Next install GeoST in editable mode by running the
31
+ pixi task 'install':
32
+
33
+ pixi run install
34
+
35
+ See the [Pixi documentation](https://pixi.sh/latest/) for more information.
36
+
37
+ ## Supported borehole and CPT formats
38
+ - From local files
39
+ - geost .parquet file (complete)
40
+ - Dino csv geological boreholes (complete)
41
+ - Dino XML geological boreholes (planned)
42
+ - BRO XML geotechnical boreholes (planned)
43
+ - BRO XML soil boreholes (planned)
44
+ - GEF boreholes (planned)
45
+ - GEF CPT's (complete)
46
+ - BRO XML CPT's (planned)
47
+ - BRO geopackage CPT's (planned)
48
+ - Well log LAS files (planned)
49
+ - Well log ASCII files (planned)
50
+ - Directly from the BRO (REST API) (all planned)
51
+ - CPT
52
+ - BHR-P
53
+ - BHR-GT
54
+ - BHR-G
55
+
56
+ ## Features
57
+ After loading data from one of the supported formats it will automatically be validated. If the validation is succesful, a Collection object will be returned depending on your input data type (mixed CPT/well log/borehole collections are not allowed). A collection object consists of two main attributes: the **header** and **data**. The header contains a table with one entry per object and provides information about the name, location, surface level, and borehole/log/cpt start and end depths. The data attribute is a table that includes the data for every described layer (boreholes) or measurement (well logs, cpt's).
58
+
59
+ The collection object comes with a comprehensive set of methods that can be applied generically while ensuring that the header and data remain synchronized:
60
+
61
+ - Selection/slicing methods (e.g., objects within bounding box, within or close to geometries, based on depth and other conditions)
62
+ - Export methods (e.g. to csv, parquet, geopackage, VTK, DataFusionTools, Kingdom* , etc)
63
+ - Datafusion methods (e.g. combining collections*, combining with data from maps, conversion of description protocols*)
64
+ - Miscellaneous methods (e.g. changing vertical/horizontal position reference system)
65
+
66
+ For a better overview of basic functionality, see the [Basics Tutorial](https://gitlab.com/deltares/tgg-projects/subsurface-toolbox/pysst/-/blob/main/tutorials/basics.ipynb?ref_type=heads).
67
+
68
+ ## Contributing
69
+
70
+ You can contribute by testing, raising issues and making pull requests. Some general guidelines:
71
+
72
+ - Use new branches for developing new features or bugfixes. Use prefixes such as feature/ bugfix/ experimental/ to indicate the type of branch
73
+ - Add unit tests (and test data) for new methods and functions. We use pytest.
74
+ - Add Numpy-style docstrings
75
+ - Use Black formatting with default line lenght (88 characters)
76
+ - Update requirement.txt en environment.yml files if required
77
+
78
+ ## License
79
+ MIT license (Note: may change to a copyleft license in the future, depending on Deltares management decisions)
80
+
@@ -0,0 +1,14 @@
1
+ from geost.read import (
2
+ get_bro_objects_from_bbox,
3
+ get_bro_objects_from_geometry,
4
+ read_borehole_table,
5
+ read_gef_cores,
6
+ read_gef_cpts,
7
+ read_nlog_cores,
8
+ read_sst_cpts,
9
+ read_xml_cpts,
10
+ read_xml_geological_cores,
11
+ read_xml_geotechnical_cores,
12
+ read_xml_soil_cores,
13
+ )
14
+ from geost.utils import csv_to_parquet, excel_to_parquet
@@ -0,0 +1,86 @@
1
+ # class CptCollection(PointDataCollection):
2
+ # """
3
+ # Class for collections of CPT data.
4
+
5
+ # Users must use the reader functions in
6
+ # :py:mod:`~geost.read` to create collections. The following readers generate CPT
7
+ # objects:
8
+
9
+ # :func:`~geost.read.read_sst_cpts`, :func:`~geost.read.read_gef_cpts`
10
+
11
+ # Args:
12
+ # data (pd.DataFrame): Dataframe containing borehole/CPT data.
13
+
14
+ # vertical_reference (str): Vertical reference, see
15
+ # :py:attr:`~geost.base.PointDataCollection.vertical_reference`
16
+
17
+ # horizontal_reference (int): Horizontal reference, see
18
+ # :py:attr:`~geost.base.PointDataCollection.horizontal_reference`
19
+
20
+ # header (pd.DataFrame): Header used for construction. see
21
+ # :py:attr:`~geost.base.PointDataCollection.header`
22
+ # """
23
+
24
+ # def __init__(
25
+ # self,
26
+ # data: pd.DataFrame,
27
+ # vertical_reference: str = "NAP",
28
+ # horizontal_reference: int = 28992,
29
+ # header: Optional[pd.DataFrame] = None,
30
+ # is_inclined: bool = False,
31
+ # ):
32
+ # super().__init__(
33
+ # data,
34
+ # vertical_reference,
35
+ # horizontal_reference,
36
+ # header=header,
37
+ # is_inclined=is_inclined,
38
+ # )
39
+
40
+ # def add_ic(
41
+ # self,
42
+ # ): # Move to cpt analysis functions, use something like 'apply' function in classes
43
+ # """
44
+ # Calculate soil behaviour type index (Ic) for all CPT's in the collection.
45
+
46
+ # The data is added to :py:attr:`~geost.base.PointDataCollection.header`.
47
+ # """
48
+ # self.data["ic"] = calc_ic(self.data["qc"], self.data["friction_number"])
49
+
50
+ # def add_lithology(
51
+ # self,
52
+ # ): # Move to cpt analysis functions, use something like 'apply' function in classes
53
+ # """
54
+ # Interpret lithoclass for all CPT's in the collection.
55
+
56
+ # The data is added to :py:attr:`~geost.base.PointDataCollection.header`.
57
+ # """
58
+ # if "ic" not in self.data.columns:
59
+ # self.add_ic()
60
+ # self.data["lith"] = calc_lithology(
61
+ # self.data["ic"], self.data["qc"], self.data["friction_number"]
62
+ # )
63
+
64
+ # def as_boreholecollection(self): # No change
65
+ # """
66
+ # Export CptCollection to BoreholeCollection. Requires the "lith" column to be
67
+ # present. Use the method :py:meth:`~geost.borehole.CptCollection.add_lithology`
68
+
69
+ # Returns
70
+ # -------
71
+ # Instance of :class:`~geost.borehole.BoreholeCollection`
72
+ # """
73
+ # if "lith" not in self.data.columns:
74
+ # raise IndexError(
75
+ # r"The column \"lith\" is required to convert to BoreholeCollection"
76
+ # )
77
+
78
+ # borehole_converted_dataframe = self.data[
79
+ # ["nr", "x", "y", "surface", "end", "top", "bottom", "lith"]
80
+ # ]
81
+ # cptcollection_as_bhcollection = BoreholeCollection(
82
+ # borehole_converted_dataframe,
83
+ # vertical_reference=self.vertical_reference,
84
+ # header=self.header,
85
+ # )
86
+ # return cptcollection_as_bhcollection
@@ -0,0 +1,251 @@
1
+ from abc import ABC, abstractmethod
2
+
3
+
4
+ class AbstractHeader(ABC):
5
+ @property
6
+ @abstractmethod
7
+ def gdf(self):
8
+ pass
9
+
10
+ @property
11
+ @abstractmethod
12
+ def horizontal_reference(self):
13
+ pass
14
+
15
+ @property
16
+ @abstractmethod
17
+ def vertical_reference(self):
18
+ pass
19
+
20
+ @gdf.setter
21
+ @abstractmethod
22
+ def gdf(self, gdf):
23
+ pass
24
+
25
+ @abstractmethod
26
+ def change_horizontal_reference(self):
27
+ pass
28
+
29
+ @abstractmethod
30
+ def change_vertical_reference(self):
31
+ pass
32
+
33
+ @abstractmethod
34
+ def get(self):
35
+ pass
36
+
37
+ @abstractmethod
38
+ def select_within_bbox(self):
39
+ pass
40
+
41
+ @abstractmethod
42
+ def select_with_points(self):
43
+ pass
44
+
45
+ @abstractmethod
46
+ def select_with_lines(self):
47
+ pass
48
+
49
+ @abstractmethod
50
+ def select_within_polygons(self):
51
+ pass
52
+
53
+ @abstractmethod
54
+ def select_by_depth(self):
55
+ pass
56
+
57
+ @abstractmethod
58
+ def select_by_length(self):
59
+ pass
60
+
61
+ @abstractmethod
62
+ def get_area_labels(self):
63
+ pass
64
+
65
+
66
+ class AbstractData(ABC):
67
+ @property
68
+ @abstractmethod
69
+ def df(self):
70
+ pass
71
+
72
+ @property
73
+ @abstractmethod
74
+ def datatype(self):
75
+ pass
76
+
77
+ @df.setter
78
+ @abstractmethod
79
+ def df(self, df):
80
+ pass
81
+
82
+ @datatype.setter
83
+ @abstractmethod
84
+ def datatype(self):
85
+ pass
86
+
87
+ @abstractmethod
88
+ def to_header(self):
89
+ pass
90
+
91
+ @abstractmethod
92
+ def to_collection(self):
93
+ pass
94
+
95
+ @abstractmethod
96
+ def select_by_values(self):
97
+ pass
98
+
99
+ @abstractmethod
100
+ def slice_depth_interval(self):
101
+ pass
102
+
103
+ @abstractmethod
104
+ def slice_by_values(self):
105
+ pass
106
+
107
+ @abstractmethod
108
+ def get_cumulative_layer_thickness(self):
109
+ # Not sure if this should be here, potentially unsuitable with DiscreteData
110
+ pass
111
+
112
+ @abstractmethod
113
+ def get_layer_top(self):
114
+ pass
115
+
116
+ @abstractmethod
117
+ def to_multiblock(self):
118
+ pass
119
+
120
+ @abstractmethod
121
+ def to_vtm(self):
122
+ pass
123
+
124
+ @abstractmethod
125
+ def to_datafusiontools(self):
126
+ # supporting this is low priority, perhaps even deprecate
127
+ pass
128
+
129
+
130
+ class AbstractCollection(ABC):
131
+ @property
132
+ @abstractmethod
133
+ def header(self):
134
+ pass
135
+
136
+ @property
137
+ @abstractmethod
138
+ def data(self):
139
+ pass
140
+
141
+ @property
142
+ def n_points(self):
143
+ pass
144
+
145
+ @property
146
+ @abstractmethod
147
+ def horizontal_reference(self): # Move to header class in future refactor
148
+ pass
149
+
150
+ @property
151
+ @abstractmethod
152
+ def vertical_reference(self): # move to data class in future refactor
153
+ pass
154
+
155
+ @header.setter
156
+ @abstractmethod
157
+ def header(self, header):
158
+ pass
159
+
160
+ @data.setter
161
+ @abstractmethod
162
+ def data(self, data):
163
+ pass
164
+
165
+ @horizontal_reference.setter
166
+ @abstractmethod
167
+ def horizontal_reference(self, to_epsg: int):
168
+ pass
169
+
170
+ @vertical_reference.setter
171
+ @abstractmethod
172
+ def vertical_reference(self, to_epsg: str): # will use epsg after refactor
173
+ pass
174
+
175
+ @abstractmethod
176
+ def get(self):
177
+ pass
178
+
179
+ @abstractmethod
180
+ def reset_header(self):
181
+ pass
182
+
183
+ @abstractmethod
184
+ def check_header_to_data_alignment(self):
185
+ pass
186
+
187
+ @abstractmethod
188
+ def select_within_bbox(self):
189
+ pass
190
+
191
+ @abstractmethod
192
+ def select_with_points(self):
193
+ pass
194
+
195
+ @abstractmethod
196
+ def select_with_lines(self):
197
+ pass
198
+
199
+ @abstractmethod
200
+ def select_within_polygons(self):
201
+ pass
202
+
203
+ @abstractmethod
204
+ def select_by_depth(self):
205
+ pass
206
+
207
+ @abstractmethod
208
+ def select_by_length(self):
209
+ pass
210
+
211
+ @abstractmethod
212
+ def get_area_labels(self):
213
+ pass
214
+
215
+ @abstractmethod
216
+ def select_by_values(self):
217
+ pass
218
+
219
+ @abstractmethod
220
+ def slice_depth_interval(self):
221
+ pass
222
+
223
+ @abstractmethod
224
+ def slice_by_values(self):
225
+ pass
226
+
227
+ @abstractmethod
228
+ def get_cumulative_layer_thickness(self):
229
+ # Not sure if this should be here, potentially unsuitable with DiscreteData
230
+ # These kind of methods should go to a seperate layer_analysis module with
231
+ # functions to cover such analyses
232
+ pass
233
+
234
+ @abstractmethod
235
+ def get_layer_top(self):
236
+ # These kind of methods should go to a seperate layer_analysis module with
237
+ # functions to cover such analyses
238
+ pass
239
+
240
+ @abstractmethod
241
+ def to_multiblock(self):
242
+ pass
243
+
244
+ @abstractmethod
245
+ def to_vtm(self):
246
+ pass
247
+
248
+ @abstractmethod
249
+ def to_datafusiontools(self):
250
+ # supporting this is low priority, perhaps even deprecate
251
+ pass
@@ -0,0 +1,6 @@
1
+ from geost.analysis.layer_analysis import (
2
+ cumulative_thickness,
3
+ find_top_sand,
4
+ layer_top,
5
+ top_of_sand,
6
+ )
@@ -0,0 +1,50 @@
1
+ import numpy as np
2
+
3
+ # NOTE: temporary functions ripped from old code. To be made compatible with Geolib
4
+ # functions
5
+
6
+
7
+ def calc_ic(qc, rf) -> np.ndarray:
8
+ """
9
+ Calculate non-normalized IC values (I_SBT in Robertson 2010). The non-normalized
10
+ variant does not require calculations of stresses to normalize with and hence no PWP
11
+ data is required.
12
+
13
+ Please note the following when using non-normalized IC values:
14
+
15
+ "The non-normalized SBT index (ISBT) is essentially the same as the normalized SBTn
16
+ index (Ic) but only uses the basic CPT measurements. In general, the normalized Ic
17
+ provides more reliable identification of SBT than the non-normalized ISBT, but when
18
+ the insitu vertical effective stress is between 50 kPa to 150 kPa there is often
19
+ little difference between normalized and non-normalized SBT."
20
+
21
+ Parameters
22
+ ----------
23
+ qc : np.ndarray
24
+ Cone resistance values
25
+ rf : np.ndarray
26
+ Friction number
27
+
28
+ Returns
29
+ -------
30
+ np.ndarray
31
+ Non-normalized IC
32
+ """
33
+ ic = np.sqrt((3.47 - np.log10(qc / 0.1)) ** 2 + (np.log10(rf) + 1.22) ** 2)
34
+ return ic
35
+
36
+
37
+ # TODO numpy searchsort
38
+ def calc_lithology(ic, qc, rf) -> np.ndarray:
39
+ boundaries = [1.6, 2.0, 2.2, 2.6, 2.95, 3.6]
40
+ lith = np.full_like(ic, "NBE", dtype="<U3")
41
+ lith[ic < boundaries[0]] = "Z"
42
+ lith[(ic >= boundaries[0]) & (ic < boundaries[1])] = "Z"
43
+ lith[(ic >= boundaries[1]) & (ic < boundaries[2])] = "Z"
44
+ lith[(ic >= boundaries[2]) & (ic < boundaries[3])] = "Z"
45
+ lith[(ic >= boundaries[3]) & (ic < boundaries[4])] = "Kz"
46
+ lith[(ic >= boundaries[4]) & (ic < boundaries[5])] = "K"
47
+ lith[(ic >= boundaries[5]) & (rf > 8)] = "V"
48
+ lith[((rf > 5) & (qc < 1.5)) | (rf > 6)] = "V"
49
+ lith[(ic >= boundaries[5]) & (rf <= 8)] = "Kh"
50
+ return lith