geone 1.2.10__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 (33) hide show
  1. geone-1.2.10/LICENSE +58 -0
  2. geone-1.2.10/PKG-INFO +276 -0
  3. geone-1.2.10/README.md +199 -0
  4. geone-1.2.10/geone.egg-info/PKG-INFO +276 -0
  5. geone-1.2.10/geone.egg-info/SOURCES.txt +31 -0
  6. geone-1.2.10/geone.egg-info/dependency_links.txt +1 -0
  7. geone-1.2.10/geone.egg-info/requires.txt +5 -0
  8. geone-1.2.10/geone.egg-info/top_level.txt +1 -0
  9. geone-1.2.10/pyproject.toml +66 -0
  10. geone-1.2.10/setup.cfg +4 -0
  11. geone-1.2.10/setup.py +124 -0
  12. geone-1.2.10/src/geone/__init__.py +30 -0
  13. geone-1.2.10/src/geone/_version.py +6 -0
  14. geone-1.2.10/src/geone/blockdata.py +232 -0
  15. geone-1.2.10/src/geone/covModel.py +9725 -0
  16. geone-1.2.10/src/geone/customcolors.py +490 -0
  17. geone-1.2.10/src/geone/deesse_core/linux_py311/__init__.py +5 -0
  18. geone-1.2.10/src/geone/deesse_core/linux_py311/_deesse.so +0 -0
  19. geone-1.2.10/src/geone/deesse_core/linux_py311/deesse.py +2445 -0
  20. geone-1.2.10/src/geone/deesseinterface.py +10181 -0
  21. geone-1.2.10/src/geone/geosclassic_core/linux_py311/__init__.py +5 -0
  22. geone-1.2.10/src/geone/geosclassic_core/linux_py311/_geosclassic.so +0 -0
  23. geone-1.2.10/src/geone/geosclassic_core/linux_py311/geosclassic.py +1422 -0
  24. geone-1.2.10/src/geone/geosclassicinterface.py +12336 -0
  25. geone-1.2.10/src/geone/grf.py +5440 -0
  26. geone-1.2.10/src/geone/img.py +6456 -0
  27. geone-1.2.10/src/geone/imgplot.py +1367 -0
  28. geone-1.2.10/src/geone/imgplot3d.py +1822 -0
  29. geone-1.2.10/src/geone/multiGaussian.py +309 -0
  30. geone-1.2.10/src/geone/pgs.py +1171 -0
  31. geone-1.2.10/src/geone/randProcess.py +1122 -0
  32. geone-1.2.10/src/geone/tools.py +762 -0
  33. geone-1.2.10/tests/test_estimator.py +67 -0
geone-1.2.10/LICENSE ADDED
@@ -0,0 +1,58 @@
1
+
2
+ LICENSE
3
+
4
+ Copyright (c) 2023 - University of Neuchâtel
5
+
6
+
7
+ PREAMBLE
8
+
9
+ GEONE is a python package providing a set of tools for geostatistical
10
+ and multiple-point statistics modeling. It contains the DEESSE library
11
+ in the sub-package deesse_core.
12
+
13
+ DEESSE is a commercial product which is not provided as an open source
14
+ software and belongs to the University of Neuchâtel. GEONE includes a
15
+ wrapper allowing to launch DEESSE directly in python.
16
+
17
+ GEONE is provided as an open source code with an open access license
18
+ applicable for all the code except the deesse_core subpackage (see
19
+ details below).
20
+
21
+ DEESSE and therefore the deesse_core subpackage requires a specific
22
+ license agreement for commercial use only. The use of DEESSE is free
23
+ (royalty free) and unlimited for academic research and teaching
24
+ activities. Its use for industrial and commercial activities is
25
+ authorized only under a specific license agreement to be concluded
26
+ with the University of Neuchâtel. Such commercial license must be
27
+ obtained before any commercial or industrial use to take place and
28
+ fees will be charged. To obtain such a commercial license from the
29
+ University of Neuchâtel, the users shall contact directly Prof.
30
+ Philippe Renard (philippe.renard@unine.ch).
31
+
32
+
33
+ LICENSE TERMS FOR THE SOFTWARE GEONE
34
+
35
+ Permission is hereby granted, free of charge, to any person obtaining
36
+ a copy of this software and associated documentation files, to deal in
37
+ the software GEONE (“The Software”) excluding the software DEESSE,
38
+ without restriction, including without limitation the rights to use,
39
+ copy, modify, merge, publish, distribute, sublicense, and/or sell
40
+ copies of the Software, and to permit persons to whom the Software is
41
+ furnished to do so, subject to the following condition:
42
+
43
+ The above copyright notice and this permission notice shall be
44
+ included in all copies or substantial portions of the Software.
45
+
46
+ The permission granted herehover is related to the Software only and
47
+ does not imply any commercial or industrial license grant concerning
48
+ DEESSE software also made available by the copyright owners and the
49
+ University of Neuchâtel on the GitHub platform.
50
+
51
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
52
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
53
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
54
+ IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
55
+ CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
56
+ TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
57
+ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
58
+
geone-1.2.10/PKG-INFO ADDED
@@ -0,0 +1,276 @@
1
+ Metadata-Version: 2.1
2
+ Name: geone
3
+ Version: 1.2.10
4
+ Summary: Geostatistics tools and Multiple Point Statistics
5
+ Author-email: Julien Straubhaar <julien.straubhaar@unine.ch>, Philippe Renard <philippe.renard@unine.ch>
6
+ License:
7
+ LICENSE
8
+
9
+ Copyright (c) 2023 - University of Neuchâtel
10
+
11
+
12
+ PREAMBLE
13
+
14
+ GEONE is a python package providing a set of tools for geostatistical
15
+ and multiple-point statistics modeling. It contains the DEESSE library
16
+ in the sub-package deesse_core.
17
+
18
+ DEESSE is a commercial product which is not provided as an open source
19
+ software and belongs to the University of Neuchâtel. GEONE includes a
20
+ wrapper allowing to launch DEESSE directly in python.
21
+
22
+ GEONE is provided as an open source code with an open access license
23
+ applicable for all the code except the deesse_core subpackage (see
24
+ details below).
25
+
26
+ DEESSE and therefore the deesse_core subpackage requires a specific
27
+ license agreement for commercial use only. The use of DEESSE is free
28
+ (royalty free) and unlimited for academic research and teaching
29
+ activities. Its use for industrial and commercial activities is
30
+ authorized only under a specific license agreement to be concluded
31
+ with the University of Neuchâtel. Such commercial license must be
32
+ obtained before any commercial or industrial use to take place and
33
+ fees will be charged. To obtain such a commercial license from the
34
+ University of Neuchâtel, the users shall contact directly Prof.
35
+ Philippe Renard (philippe.renard@unine.ch).
36
+
37
+
38
+ LICENSE TERMS FOR THE SOFTWARE GEONE
39
+
40
+ Permission is hereby granted, free of charge, to any person obtaining
41
+ a copy of this software and associated documentation files, to deal in
42
+ the software GEONE (“The Software”) excluding the software DEESSE,
43
+ without restriction, including without limitation the rights to use,
44
+ copy, modify, merge, publish, distribute, sublicense, and/or sell
45
+ copies of the Software, and to permit persons to whom the Software is
46
+ furnished to do so, subject to the following condition:
47
+
48
+ The above copyright notice and this permission notice shall be
49
+ included in all copies or substantial portions of the Software.
50
+
51
+ The permission granted herehover is related to the Software only and
52
+ does not imply any commercial or industrial license grant concerning
53
+ DEESSE software also made available by the copyright owners and the
54
+ University of Neuchâtel on the GitHub platform.
55
+
56
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
57
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
58
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
59
+ IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
60
+ CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
61
+ TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
62
+ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
63
+
64
+
65
+ Project-URL: Repository, https://github.com/randlab/geone
66
+ Project-URL: Issues, https://github.com/randlab/geone/issues
67
+ Keywords: Geostatistics,Multiple Point Statistics,deesse,two point statistics,simulation,kriging
68
+ Classifier: Programming Language :: Python :: 3
69
+ Requires-Python: >=3.7
70
+ Description-Content-Type: text/markdown
71
+ License-File: LICENSE
72
+ Requires-Dist: matplotlib
73
+ Requires-Dist: numpy<2,>=1
74
+ Requires-Dist: pandas
75
+ Requires-Dist: pyvista
76
+ Requires-Dist: scipy
77
+
78
+ # GEONE
79
+
80
+ [![Documentation Status](https://readthedocs.org/projects/geone/badge/?version=latest)](https://geone.readthedocs.io/en/latest/?badge=latest)
81
+
82
+ GEONE is a Python3 package providing a set of tools for geostatistical modeling, comprising:
83
+ - a DEESSE wrapper for multiple-point statistics (MPS) simulation
84
+ - geostatistical tools based on two-point statistics
85
+ - miscellaneous algorithms based on random processes
86
+
87
+ See brief description and examples below.
88
+
89
+ ## Important notes
90
+
91
+ DEESSE and some other geostatistical tools (GEOSCLASSIC) provided by GEONE are compiled in C for windows, linux and mac, and for python 3.7 to 3.12 (from python 3.8 for mac). Hence, DEESSE and GEOSCLASSIC wrappers use pre-compiled C libraries. The installation process detects the operating system and the python version, ensuring the installation of the right libraries. Note that for linux, libraries depending on the library GLIBC 2.35 or GLIBC 2.27 are provided, hence the library GLIBC of your OS has to be compatible with one of those versions to ensure proper operation of GEONE.
92
+
93
+ ## Installation
94
+
95
+ ### Installation from [PyPI](https://pypi.org/) (The Python Package Index)
96
+
97
+ In a terminal type
98
+ ```
99
+ pip install geone
100
+ ```
101
+ (or `python -m pip install geone`).
102
+
103
+ ### Installation from github
104
+ In a terminal, change directory where to download GEONE, and type
105
+ ```
106
+ git clone https://github.com/randlab/geone.git
107
+ cd geone
108
+ pip install .
109
+ ```
110
+
111
+ *Note:* use `pip install . --verbose` or `pip install . -v` for printing (more) messages during the installation.
112
+
113
+ Alternatively:
114
+
115
+ - Instead of `git clone ...`, you can download GEONE from the [Github repository](https://github.com/randlab/geone): click on the green button "code" and choose "Download ZIP".
116
+ - Then, unzip the archive on your computer
117
+ - Finally, in a terminal, go into the unzipped directory, and type `pip install .`
118
+
119
+ **Using GEONE - Important note**
120
+
121
+ If the installation has been done from github, do not launch python from the directory containing the downloaded sources and where the installation has been done (with `pip`), otherwise `import geone` will fail.
122
+
123
+ ### Requirements
124
+ The following python packages are used by GEONE (tested on python 3.11.5):
125
+ - matplotlib (3.8.1)
126
+ - multiprocessing (for parallel processes)
127
+ - numpy (tested with version 1.26.0)
128
+ - pandas (tested with version 2.1.2)
129
+ - pyvista (tested with version 0.42.3)
130
+ - scipy (tested with version 1.11.3)
131
+
132
+ ### Removing GEONE
133
+ In a terminal type
134
+
135
+ `pip uninstall -y geone`
136
+
137
+ *Note: first remove the directory 'geone.egg-info' from the current directory (if present).*
138
+
139
+ ## Brief GEONE's description
140
+
141
+ ### Multiple-point statistics (MPS)
142
+
143
+ #### DEESSE
144
+ DEESSE is a parallel software for multiple point statistics (MPS) simulations. MPS allows to generate random fields reproducing the spatial statistics - within and between variable(s) - of a training data set (TDS), also often called training image (TI). DEESSE follows an approach based on the *direct sampling* of the TDS. The simulation grid is sequentially populated by values borrowed from the TDS, selected after a random search for similar patterns. Many features are handled by DEESSE and illustrated in the proposed examples below.
145
+
146
+ #### DEESSEX (crossing DEESSE simulation)
147
+ DEESSE can also be used for 3D simulation based on 2D TDS which give the spatial statistics in sections (slices) of the 3D simulation domain. (More generally, 1D or 2D TDS can be used for higher dimensional simulation.) The principle consists in filling the simulation domain by successively simulating sections (according the the given orientation) conditionally to the sections previously simulated. A wrapper for this approach (named DEESSEX referring to crossing-simulation / X-simulation with DEESSE) is proposed in the package GEONE.
148
+
149
+ ### Two-point statistics tools
150
+ - Gaussian random fields (GRF)
151
+ - simulation and estimation (kriging) based on Fast Fourier Transform (FFT) (via a (block) circulant embedding of the covariance matrix)
152
+ - simulation (sequential Gaussian simulation, SGS) and estimation (kriging) based on search neighborhood
153
+ - Pluri-Gaussian simulation (PGS)
154
+ - Other classical geostatistical tools
155
+ - two-point statistics analysis: covariance, variogram, connectivity, etc.
156
+
157
+ ### Miscellaneous algorithms
158
+ - Other algorithms based on random processes
159
+ - accept-reject sampler in one or multi-dimension
160
+ - Poisson point process in one or multi-dimension
161
+ - Chentsov simulation in 1D, 2D, 3D
162
+
163
+ ## Examples - Tutorials
164
+
165
+ *Note: some modules in the package GEONE can be run as a script ('\_\_main\_\_' scope) and provide examples by this way.*
166
+
167
+ Various examples are provided in notebooks (in [examples](examples) directory) to get started with GEONE, as described below.
168
+
169
+ ### Images and point sets
170
+ The following notebooks show how to deal with the classes `geone.img.Img` for "images" and `geone.img.PointSet` for "point sets".
171
+
172
+ - `ex_a_01_image_and_pointset.ipynb`: classes for images and point sets, reading from files, writing to files, plotting
173
+ - `ex_a_02_image2d_rgb.ipynb`: reading / writing RGB 2D images, files in png format
174
+ - `ex_a_03_image_interpolation.ipynb`: some tools to interpolate images (e.g. make them finer or coarser)
175
+
176
+ ### Multiple-point statistics - DEESSE
177
+ The following notebooks show how to run DEESSE with its functionalities (options).
178
+
179
+ - `ex_deesse_01_basics.ipynb`: basic DEESSE (categorical) simulations
180
+ - `ex_deesse_02_additional_outputs_and_simulation_paths.ipynb`: retrieving additional output maps and setting the simulation path
181
+ - `ex_deesse_03_search_neigbhorhood.ipynb`: advanced setting for the search neighborhood ellipsoid
182
+ - `ex_deesse_04_continuous_sim.ipynb`: continous simulations
183
+ - `ex_deesse_05_geom_transformation.ipynb`: simulations with geometrical transformations (rotation / scaling)
184
+ - `ex_deesse_06_proba_constraint.ipynb`: simulations with probability (proportion) constraints
185
+ - `ex_deesse_07_connectivity_data.ipynb`: simulations with connectivity data
186
+ - `ex_deesse_08_multivariate_sim.ipynb`: bivariate simulations - stationary case
187
+ - `ex_deesse_09_multivariate_sim2.ipynb`: bivariate simulations - setting an auxiliary variable to deal with non-stationarity
188
+ - `ex_deesse_10_incomplete_image.ipynb`: reconstruction of an image using a training data set
189
+ - `ex_deesse_11_using_mask.ipynb`: simulation using a mask
190
+ - `ex_deesse_12_multiple_TIs.ipynb`: simulation using multiple training images
191
+ - `ex_deesse_13_inequality_data.ipynb`: simulations with inequality data
192
+ - `ex_deesse_14_rotation3D.ipynb`: simulations with rotation in 3D
193
+ - `ex_deesse_15_block_data.ipynb`: simulation with block data, *i.e* target mean values over block of cells
194
+ - `ex_deesse_16_advanced_use_of_pyramids.ipynb`: simulation using pyramids (retrieving pyramids, conditioning within pyramids)
195
+
196
+ ### Multiple-point statistics - DEESSEX ("X-simulation")
197
+ The following notebooks show how some examples of crossing-simulation (X-simulation) with DEESSEX.
198
+
199
+ - `ex_deesseX_01_getting_started.ipynb`: getting starting with deesseX, simulation based on XZ and YZ sections
200
+ - `ex_deesseX_02.ipynb`: simulation based on XY, XZ and YZ sections
201
+ - `ex_deesseX_03.ipynb`: simulation based on XY, XZ and YZ sections and simulation based on XY 2D-section and Z 1D-section
202
+ - `ex_deesseX_04.ipynb`: simulation based on XZ and YZ sections, and accounting for non-stationarity (vertical trend)
203
+
204
+ ### MultiGaussian estimation and simulation (general function)
205
+ The following notebook shows elementary covariance models and the use of a general function (wrapper) allowing to launch the other functions of GEONE for multiGaussian estimation and simulation (based on FFT / search neighborhood (GEOSCLASSIC), see below).
206
+
207
+ - `ex_general_multiGaussian.ipynb`: functions for multiGaussian estimation and simulation in a grid, and elementary covariance/variogram models (in 1D)
208
+
209
+ ### GRF based on FFT
210
+ Gaussian random fields (GRF) - simulation and estimation (kriging) in a grid - based on Fast Fourier Transform (FFT).
211
+
212
+ - `ex_grf_1d.ipynb`: example for the generation of 1D fields
213
+ - `ex_grf_2d.ipynb`: example for the generation of 2D fields
214
+ - `ex_grf_3d.ipynb`: example for the generation of 3D fields
215
+
216
+ ### SGS / SIS and kriging based on search neighborhood
217
+ Sequential Gaussian Simulation (SGS), Sequential Indicator Simulation (SIS) and estimation (kriging) in a grid - based on (limited) search neigborhood; tools for image analysis : covariance variogram, connectivity of images (GEOSCLASSIC wrapper).
218
+
219
+ - `ex_geosclassic_1d_1.ipynb`:example in 1D for two-point statistics simulation and estimation
220
+ - `ex_geosclassic_1d_2_non_stat_cov.ipynb`:example in 1D with non-stationary covariance model
221
+ - `ex_geosclassic_2d_1.ipynb`:example in 2D for two-point statistics simulation and estimation
222
+ - `ex_geosclassic_2d_2_non_stat_cov.ipynb`:example in 2D with non-stationary covariance model
223
+ - `ex_geosclassic_3d_1.ipynb`:example in 3D for two-point statistics simulation and estimation
224
+ - `ex_geosclassic_3d_2_non_stat_cov.ipynb`:example in 3D with non-stationary covariance model
225
+ - `ex_geosclassic_indicator_1d.ipynb`:example in 1D for two-point statistics simulation and estimation of indicator variables
226
+ - `ex_geosclassic_indicator_2d.ipynb`:example in 2D for two-point statistics simulation and estimation of indicator variables
227
+ - `ex_geosclassic_indicator_3d.ipynb`:example in 3D for two-point statistics simulation and estimation of indicator variables
228
+ - `ex_geosclassic_image_analysis.ipynb`:example for two-point statistics analysis (covariance, variogram, connectivity, ...) of images (maps)
229
+
230
+ ### Variogram analysis tools
231
+ Tools for variogram analysis - variogram fitting - illustrated in various cases.
232
+
233
+ - `ex_vario_analysis_data1D_1.ipynb`: example for variogram analysis and ordinary kriging for data in 1D
234
+ - `ex_vario_analysis_data1D_2_non_stationary.ipynb`: example how dealing with non stationary data set in 1D
235
+ - `ex_vario_analysis_data2D_1_omnidirectional.ipynb`: example for variogram analysis and ordinary kriging for data in 2D (omni-directional)
236
+ - `ex_vario_analysis_data2D_2_general.ipynb`: example for variogram analysis and ordinary kriging for data in 2D (general)
237
+ - `ex_vario_analysis_data2D_3_non_stationary.ipynb`: example how dealing with non stationary data set in 2D
238
+ - `ex_vario_analysis_data3D_1_omnidirectional.ipynb`: example for variogram analysis and ordinary kriging for data in 3D (omni-directional)
239
+ - `ex_vario_analysis_data3D_2_general.ipynb`: example for variogram analysis and ordinary kriging for data in 3D (general)
240
+ - `ex_vario_analysis_data3D_3_non_stationary.ipynb`: example how dealing with non stationary data set in 3D
241
+
242
+ ### Pluri-Gaussian simulation (PGS)
243
+ - `ex_pgs.ipynb`: example of pluri-Gaussian simulations in 1D, 2D and 3D (categorical, conditional or not), based on two latent Gaussian fields
244
+
245
+ ### Miscellaneous algorithms based on random processes
246
+ Accept-reject sampler and other algorithms such as homogeneous and non-homogeneous Poisson point process, Chentsov simulations.
247
+
248
+ - `ex_acceptRejectSampler.ipynb`: example of accept-reject sampler for generating samples according to given density function (uni- or multi-variate)
249
+ - `ex_randProcess.ipynb`: example of Poisson point process, and Chentsov simulation in 1D, 2D and 3D
250
+
251
+ ## References
252
+
253
+ ### Some references about DEESSE
254
+ - J. Straubhaar, P. Renard (2021) Conditioning Multiple-Point Statistics Simulation to Inequality Data. Earth and Space Science, [doi:10.1029/2020EA001515](https://dx.doi.org/10.1029/2020EA001515)
255
+ - J. Straubhaar, P. Renard, T. Chugunova (2020) Multiple-point statistics using multi-resolution images. Stochastic Environmental Research and Risk Assessment 20, 251-273, [doi:10.1007/s00477-020-01770-8](https://dx.doi.org/10.1007/s00477-020-01770-8)
256
+ - J. Straubhaar, P. Renard, G. Mariethoz (2016) Conditioning multiple-point statistics simulations to block data. Spatial Statistics 16, 53-71, [doi:10.1016/j.spasta.2016.02.005](https://dx.doi.org/10.1016/j.spasta.2016.02.005)
257
+ - G. Mariethoz, J. Straubhaar, P. Renard, T. Chugunova, P. Biver (2015) Constraining distance-based multipoint simulations to proportions and trends. Environmental Modelling & Software 72, 184-197, [doi:10.1016/j.envsoft.2015.07.007](https://dx.doi.org/10.1016/j.envsoft.2015.07.007)
258
+ - G. Mariethoz, P. Renard, J. Straubhaar (2010) The Direct Sampling method to perform multiple-point geostatistical simulation. Water Resources Research 46, W11536, [doi:10.1029/2008WR007621](https://dx.doi.org/10.1029/2008WR007621)
259
+
260
+ ### Reference about DEESSEX
261
+ - A. Comunian, P. Renard, J. Straubhaar (2012) 3D multiple-point statistics simulation using 2D training images. Computers & Geosciences 40, 49-65, [doi:10.1016/j.cageo.2011.07.009](https://dx.doi.org/10.1016/j.cageo.2011.07.009)
262
+
263
+ ### Some references about GRF
264
+ - J. W. Cooley and J. W. Tukey (1965) An algorithm for machine calculation of complex fourier series. Mathematics of Computation 19(90):297-301, [doi:10.2307/2003354](https://dx.doi.org/10.2307/2003354)
265
+ - C. R. Dietrich and G. N. Newsam (1993) A fast and exact method for multidimensional gaussian stochastic simulations. Water Resources Research 29(8):2861-2869, [doi:10.1029/93WR01070](https://dx.doi.org/10.1029/93WR01070)
266
+ - A. T. A. Wood and G. Chan (1994) Simulation of stationary gaussian processes in [0,1]^d. Journal of Computational and Graphical Statistics 3(4):409-432, [doi:10.2307/1390903](https://dx.doi.org/10.2307/1390903)
267
+
268
+ ### Other references
269
+ - C. Lantuéjoul (2002) Geostatistical Simulation, Models and Algorithms. Springer Verlag, Berlin, 256 p.
270
+
271
+ ## License
272
+
273
+ See [LICENSE](LICENSE) file.
274
+
275
+ ## Authors
276
+ GEONE is developed by [Julien Straubhaar](https://www.unine.ch/philippe.renard/home/the-team/julien-straubhaar.html) and [Philippe Renard](https://www.unine.ch/philippe.renard/home/the-team/philippe-renard.html).
geone-1.2.10/README.md ADDED
@@ -0,0 +1,199 @@
1
+ # GEONE
2
+
3
+ [![Documentation Status](https://readthedocs.org/projects/geone/badge/?version=latest)](https://geone.readthedocs.io/en/latest/?badge=latest)
4
+
5
+ GEONE is a Python3 package providing a set of tools for geostatistical modeling, comprising:
6
+ - a DEESSE wrapper for multiple-point statistics (MPS) simulation
7
+ - geostatistical tools based on two-point statistics
8
+ - miscellaneous algorithms based on random processes
9
+
10
+ See brief description and examples below.
11
+
12
+ ## Important notes
13
+
14
+ DEESSE and some other geostatistical tools (GEOSCLASSIC) provided by GEONE are compiled in C for windows, linux and mac, and for python 3.7 to 3.12 (from python 3.8 for mac). Hence, DEESSE and GEOSCLASSIC wrappers use pre-compiled C libraries. The installation process detects the operating system and the python version, ensuring the installation of the right libraries. Note that for linux, libraries depending on the library GLIBC 2.35 or GLIBC 2.27 are provided, hence the library GLIBC of your OS has to be compatible with one of those versions to ensure proper operation of GEONE.
15
+
16
+ ## Installation
17
+
18
+ ### Installation from [PyPI](https://pypi.org/) (The Python Package Index)
19
+
20
+ In a terminal type
21
+ ```
22
+ pip install geone
23
+ ```
24
+ (or `python -m pip install geone`).
25
+
26
+ ### Installation from github
27
+ In a terminal, change directory where to download GEONE, and type
28
+ ```
29
+ git clone https://github.com/randlab/geone.git
30
+ cd geone
31
+ pip install .
32
+ ```
33
+
34
+ *Note:* use `pip install . --verbose` or `pip install . -v` for printing (more) messages during the installation.
35
+
36
+ Alternatively:
37
+
38
+ - Instead of `git clone ...`, you can download GEONE from the [Github repository](https://github.com/randlab/geone): click on the green button "code" and choose "Download ZIP".
39
+ - Then, unzip the archive on your computer
40
+ - Finally, in a terminal, go into the unzipped directory, and type `pip install .`
41
+
42
+ **Using GEONE - Important note**
43
+
44
+ If the installation has been done from github, do not launch python from the directory containing the downloaded sources and where the installation has been done (with `pip`), otherwise `import geone` will fail.
45
+
46
+ ### Requirements
47
+ The following python packages are used by GEONE (tested on python 3.11.5):
48
+ - matplotlib (3.8.1)
49
+ - multiprocessing (for parallel processes)
50
+ - numpy (tested with version 1.26.0)
51
+ - pandas (tested with version 2.1.2)
52
+ - pyvista (tested with version 0.42.3)
53
+ - scipy (tested with version 1.11.3)
54
+
55
+ ### Removing GEONE
56
+ In a terminal type
57
+
58
+ `pip uninstall -y geone`
59
+
60
+ *Note: first remove the directory 'geone.egg-info' from the current directory (if present).*
61
+
62
+ ## Brief GEONE's description
63
+
64
+ ### Multiple-point statistics (MPS)
65
+
66
+ #### DEESSE
67
+ DEESSE is a parallel software for multiple point statistics (MPS) simulations. MPS allows to generate random fields reproducing the spatial statistics - within and between variable(s) - of a training data set (TDS), also often called training image (TI). DEESSE follows an approach based on the *direct sampling* of the TDS. The simulation grid is sequentially populated by values borrowed from the TDS, selected after a random search for similar patterns. Many features are handled by DEESSE and illustrated in the proposed examples below.
68
+
69
+ #### DEESSEX (crossing DEESSE simulation)
70
+ DEESSE can also be used for 3D simulation based on 2D TDS which give the spatial statistics in sections (slices) of the 3D simulation domain. (More generally, 1D or 2D TDS can be used for higher dimensional simulation.) The principle consists in filling the simulation domain by successively simulating sections (according the the given orientation) conditionally to the sections previously simulated. A wrapper for this approach (named DEESSEX referring to crossing-simulation / X-simulation with DEESSE) is proposed in the package GEONE.
71
+
72
+ ### Two-point statistics tools
73
+ - Gaussian random fields (GRF)
74
+ - simulation and estimation (kriging) based on Fast Fourier Transform (FFT) (via a (block) circulant embedding of the covariance matrix)
75
+ - simulation (sequential Gaussian simulation, SGS) and estimation (kriging) based on search neighborhood
76
+ - Pluri-Gaussian simulation (PGS)
77
+ - Other classical geostatistical tools
78
+ - two-point statistics analysis: covariance, variogram, connectivity, etc.
79
+
80
+ ### Miscellaneous algorithms
81
+ - Other algorithms based on random processes
82
+ - accept-reject sampler in one or multi-dimension
83
+ - Poisson point process in one or multi-dimension
84
+ - Chentsov simulation in 1D, 2D, 3D
85
+
86
+ ## Examples - Tutorials
87
+
88
+ *Note: some modules in the package GEONE can be run as a script ('\_\_main\_\_' scope) and provide examples by this way.*
89
+
90
+ Various examples are provided in notebooks (in [examples](examples) directory) to get started with GEONE, as described below.
91
+
92
+ ### Images and point sets
93
+ The following notebooks show how to deal with the classes `geone.img.Img` for "images" and `geone.img.PointSet` for "point sets".
94
+
95
+ - `ex_a_01_image_and_pointset.ipynb`: classes for images and point sets, reading from files, writing to files, plotting
96
+ - `ex_a_02_image2d_rgb.ipynb`: reading / writing RGB 2D images, files in png format
97
+ - `ex_a_03_image_interpolation.ipynb`: some tools to interpolate images (e.g. make them finer or coarser)
98
+
99
+ ### Multiple-point statistics - DEESSE
100
+ The following notebooks show how to run DEESSE with its functionalities (options).
101
+
102
+ - `ex_deesse_01_basics.ipynb`: basic DEESSE (categorical) simulations
103
+ - `ex_deesse_02_additional_outputs_and_simulation_paths.ipynb`: retrieving additional output maps and setting the simulation path
104
+ - `ex_deesse_03_search_neigbhorhood.ipynb`: advanced setting for the search neighborhood ellipsoid
105
+ - `ex_deesse_04_continuous_sim.ipynb`: continous simulations
106
+ - `ex_deesse_05_geom_transformation.ipynb`: simulations with geometrical transformations (rotation / scaling)
107
+ - `ex_deesse_06_proba_constraint.ipynb`: simulations with probability (proportion) constraints
108
+ - `ex_deesse_07_connectivity_data.ipynb`: simulations with connectivity data
109
+ - `ex_deesse_08_multivariate_sim.ipynb`: bivariate simulations - stationary case
110
+ - `ex_deesse_09_multivariate_sim2.ipynb`: bivariate simulations - setting an auxiliary variable to deal with non-stationarity
111
+ - `ex_deesse_10_incomplete_image.ipynb`: reconstruction of an image using a training data set
112
+ - `ex_deesse_11_using_mask.ipynb`: simulation using a mask
113
+ - `ex_deesse_12_multiple_TIs.ipynb`: simulation using multiple training images
114
+ - `ex_deesse_13_inequality_data.ipynb`: simulations with inequality data
115
+ - `ex_deesse_14_rotation3D.ipynb`: simulations with rotation in 3D
116
+ - `ex_deesse_15_block_data.ipynb`: simulation with block data, *i.e* target mean values over block of cells
117
+ - `ex_deesse_16_advanced_use_of_pyramids.ipynb`: simulation using pyramids (retrieving pyramids, conditioning within pyramids)
118
+
119
+ ### Multiple-point statistics - DEESSEX ("X-simulation")
120
+ The following notebooks show how some examples of crossing-simulation (X-simulation) with DEESSEX.
121
+
122
+ - `ex_deesseX_01_getting_started.ipynb`: getting starting with deesseX, simulation based on XZ and YZ sections
123
+ - `ex_deesseX_02.ipynb`: simulation based on XY, XZ and YZ sections
124
+ - `ex_deesseX_03.ipynb`: simulation based on XY, XZ and YZ sections and simulation based on XY 2D-section and Z 1D-section
125
+ - `ex_deesseX_04.ipynb`: simulation based on XZ and YZ sections, and accounting for non-stationarity (vertical trend)
126
+
127
+ ### MultiGaussian estimation and simulation (general function)
128
+ The following notebook shows elementary covariance models and the use of a general function (wrapper) allowing to launch the other functions of GEONE for multiGaussian estimation and simulation (based on FFT / search neighborhood (GEOSCLASSIC), see below).
129
+
130
+ - `ex_general_multiGaussian.ipynb`: functions for multiGaussian estimation and simulation in a grid, and elementary covariance/variogram models (in 1D)
131
+
132
+ ### GRF based on FFT
133
+ Gaussian random fields (GRF) - simulation and estimation (kriging) in a grid - based on Fast Fourier Transform (FFT).
134
+
135
+ - `ex_grf_1d.ipynb`: example for the generation of 1D fields
136
+ - `ex_grf_2d.ipynb`: example for the generation of 2D fields
137
+ - `ex_grf_3d.ipynb`: example for the generation of 3D fields
138
+
139
+ ### SGS / SIS and kriging based on search neighborhood
140
+ Sequential Gaussian Simulation (SGS), Sequential Indicator Simulation (SIS) and estimation (kriging) in a grid - based on (limited) search neigborhood; tools for image analysis : covariance variogram, connectivity of images (GEOSCLASSIC wrapper).
141
+
142
+ - `ex_geosclassic_1d_1.ipynb`:example in 1D for two-point statistics simulation and estimation
143
+ - `ex_geosclassic_1d_2_non_stat_cov.ipynb`:example in 1D with non-stationary covariance model
144
+ - `ex_geosclassic_2d_1.ipynb`:example in 2D for two-point statistics simulation and estimation
145
+ - `ex_geosclassic_2d_2_non_stat_cov.ipynb`:example in 2D with non-stationary covariance model
146
+ - `ex_geosclassic_3d_1.ipynb`:example in 3D for two-point statistics simulation and estimation
147
+ - `ex_geosclassic_3d_2_non_stat_cov.ipynb`:example in 3D with non-stationary covariance model
148
+ - `ex_geosclassic_indicator_1d.ipynb`:example in 1D for two-point statistics simulation and estimation of indicator variables
149
+ - `ex_geosclassic_indicator_2d.ipynb`:example in 2D for two-point statistics simulation and estimation of indicator variables
150
+ - `ex_geosclassic_indicator_3d.ipynb`:example in 3D for two-point statistics simulation and estimation of indicator variables
151
+ - `ex_geosclassic_image_analysis.ipynb`:example for two-point statistics analysis (covariance, variogram, connectivity, ...) of images (maps)
152
+
153
+ ### Variogram analysis tools
154
+ Tools for variogram analysis - variogram fitting - illustrated in various cases.
155
+
156
+ - `ex_vario_analysis_data1D_1.ipynb`: example for variogram analysis and ordinary kriging for data in 1D
157
+ - `ex_vario_analysis_data1D_2_non_stationary.ipynb`: example how dealing with non stationary data set in 1D
158
+ - `ex_vario_analysis_data2D_1_omnidirectional.ipynb`: example for variogram analysis and ordinary kriging for data in 2D (omni-directional)
159
+ - `ex_vario_analysis_data2D_2_general.ipynb`: example for variogram analysis and ordinary kriging for data in 2D (general)
160
+ - `ex_vario_analysis_data2D_3_non_stationary.ipynb`: example how dealing with non stationary data set in 2D
161
+ - `ex_vario_analysis_data3D_1_omnidirectional.ipynb`: example for variogram analysis and ordinary kriging for data in 3D (omni-directional)
162
+ - `ex_vario_analysis_data3D_2_general.ipynb`: example for variogram analysis and ordinary kriging for data in 3D (general)
163
+ - `ex_vario_analysis_data3D_3_non_stationary.ipynb`: example how dealing with non stationary data set in 3D
164
+
165
+ ### Pluri-Gaussian simulation (PGS)
166
+ - `ex_pgs.ipynb`: example of pluri-Gaussian simulations in 1D, 2D and 3D (categorical, conditional or not), based on two latent Gaussian fields
167
+
168
+ ### Miscellaneous algorithms based on random processes
169
+ Accept-reject sampler and other algorithms such as homogeneous and non-homogeneous Poisson point process, Chentsov simulations.
170
+
171
+ - `ex_acceptRejectSampler.ipynb`: example of accept-reject sampler for generating samples according to given density function (uni- or multi-variate)
172
+ - `ex_randProcess.ipynb`: example of Poisson point process, and Chentsov simulation in 1D, 2D and 3D
173
+
174
+ ## References
175
+
176
+ ### Some references about DEESSE
177
+ - J. Straubhaar, P. Renard (2021) Conditioning Multiple-Point Statistics Simulation to Inequality Data. Earth and Space Science, [doi:10.1029/2020EA001515](https://dx.doi.org/10.1029/2020EA001515)
178
+ - J. Straubhaar, P. Renard, T. Chugunova (2020) Multiple-point statistics using multi-resolution images. Stochastic Environmental Research and Risk Assessment 20, 251-273, [doi:10.1007/s00477-020-01770-8](https://dx.doi.org/10.1007/s00477-020-01770-8)
179
+ - J. Straubhaar, P. Renard, G. Mariethoz (2016) Conditioning multiple-point statistics simulations to block data. Spatial Statistics 16, 53-71, [doi:10.1016/j.spasta.2016.02.005](https://dx.doi.org/10.1016/j.spasta.2016.02.005)
180
+ - G. Mariethoz, J. Straubhaar, P. Renard, T. Chugunova, P. Biver (2015) Constraining distance-based multipoint simulations to proportions and trends. Environmental Modelling & Software 72, 184-197, [doi:10.1016/j.envsoft.2015.07.007](https://dx.doi.org/10.1016/j.envsoft.2015.07.007)
181
+ - G. Mariethoz, P. Renard, J. Straubhaar (2010) The Direct Sampling method to perform multiple-point geostatistical simulation. Water Resources Research 46, W11536, [doi:10.1029/2008WR007621](https://dx.doi.org/10.1029/2008WR007621)
182
+
183
+ ### Reference about DEESSEX
184
+ - A. Comunian, P. Renard, J. Straubhaar (2012) 3D multiple-point statistics simulation using 2D training images. Computers & Geosciences 40, 49-65, [doi:10.1016/j.cageo.2011.07.009](https://dx.doi.org/10.1016/j.cageo.2011.07.009)
185
+
186
+ ### Some references about GRF
187
+ - J. W. Cooley and J. W. Tukey (1965) An algorithm for machine calculation of complex fourier series. Mathematics of Computation 19(90):297-301, [doi:10.2307/2003354](https://dx.doi.org/10.2307/2003354)
188
+ - C. R. Dietrich and G. N. Newsam (1993) A fast and exact method for multidimensional gaussian stochastic simulations. Water Resources Research 29(8):2861-2869, [doi:10.1029/93WR01070](https://dx.doi.org/10.1029/93WR01070)
189
+ - A. T. A. Wood and G. Chan (1994) Simulation of stationary gaussian processes in [0,1]^d. Journal of Computational and Graphical Statistics 3(4):409-432, [doi:10.2307/1390903](https://dx.doi.org/10.2307/1390903)
190
+
191
+ ### Other references
192
+ - C. Lantuéjoul (2002) Geostatistical Simulation, Models and Algorithms. Springer Verlag, Berlin, 256 p.
193
+
194
+ ## License
195
+
196
+ See [LICENSE](LICENSE) file.
197
+
198
+ ## Authors
199
+ GEONE is developed by [Julien Straubhaar](https://www.unine.ch/philippe.renard/home/the-team/julien-straubhaar.html) and [Philippe Renard](https://www.unine.ch/philippe.renard/home/the-team/philippe-renard.html).