Skip to content

Commit

Permalink
update README [skip ci]
Browse files Browse the repository at this point in the history
  • Loading branch information
MuellerSeb committed Aug 28, 2019
1 parent 38e48cc commit fe34e05
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 31 deletions.
22 changes: 9 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -104,14 +104,14 @@ srf.plot()
A similar example but for a three dimensional field is exported to a [VTK](https://vtk.org/) file, which can be visualized with [ParaView](https://www.paraview.org/).

```python
from gstools import SRF, Gaussian, vtk_export
from gstools import SRF, Gaussian
import matplotlib.pyplot as pt
# structured field with a size 100x100x100 and a grid-size of 1x1x1
x = y = z = range(100)
model = Gaussian(dim=3, var=0.6, len_scale=20)
srf = SRF(model)
field = srf((x, y, z), mesh_type='structured')
vtk_export('3d_field', (x, y, z), field, mesh_type='structured')
srf((x, y, z), mesh_type='structured')
srf.vtk_export('3d_field')
```

<p align="center">
Expand All @@ -133,8 +133,6 @@ model again.
```python
import numpy as np
from gstools import SRF, Exponential, Stable, vario_estimate_unstructured
from gstools.covmodel.plot import plot_variogram
import matplotlib.pyplot as plt
# generate a synthetic field with an exponential model
x = np.random.RandomState(19970221).rand(1000) * 100.
y = np.random.RandomState(20011012).rand(1000) * 100.
Expand All @@ -144,14 +142,13 @@ field = srf((x, y))
# estimate the variogram of the field with 40 bins
bins = np.arange(40)
bin_center, gamma = vario_estimate_unstructured((x, y), field, bins)
plt.plot(bin_center, gamma)
# fit the variogram with a stable model. (no nugget fitted)
fit_model = Stable(dim=2)
fit_model.fit_variogram(bin_center, gamma, nugget=False)
plot_variogram(fit_model, x_max=40)
# output
ax = fit_model.plot(x_max=40)
ax.plot(bin_center, gamma)
print(fit_model)
plt.show()
```

Which gives:
Expand Down Expand Up @@ -201,7 +198,6 @@ spatial vector fields can be generated.
### Example

```python

import numpy as np
import matplotlib.pyplot as plt
from gstools import SRF, Gaussian
Expand Down Expand Up @@ -242,8 +238,8 @@ Which gives a RectilinearGrid VTK file ``field.vtr``.

## Requirements:

- [NumPy >= 1.13.0](https://www.numpy.org)
- [SciPy >= 0.19.1](https://www.scipy.org/scipylib)
- [NumPy >= 1.14.5](https://www.numpy.org)
- [SciPy >= 1.1.0](https://www.scipy.org/scipylib)
- [hankel >= 0.3.6](https://github.com/steven-murray/hankel)
- [emcee](https://github.com/dfm/emcee)
- [pyevtk](https://bitbucket.org/pauloh/pyevtk)
Expand All @@ -257,13 +253,13 @@ You can contact us via <info@geostat-framework.org>.

## License

[GPL][gpl_link] © 2018-2019
[GPL][license_link] © 2018-2019

[pip_link]: https://pypi.org/project/gstools
[conda_pip]: https://docs.conda.io/projects/conda/en/latest/user-guide/tasks/manage-pkgs.html#installing-non-conda-packages
[pipiflag]: https://pip-python3.readthedocs.io/en/latest/reference/pip_install.html?highlight=i#cmdoption-i
[winpy_link]: https://winpython.github.io/
[gpl_link]: https://github.com/GeoStat-Framework/GSTools/blob/master/LICENSE
[license_link]: https://github.com/GeoStat-Framework/GSTools/blob/master/LICENSE
[cov_link]: https://geostat-framework.readthedocs.io/projects/gstools/en/latest/covmodel.base.html#gstools.covmodel.base.CovModel
[stable_link]: https://en.wikipedia.org/wiki/Stable_distribution
[doc_link]: https://geostat-framework.readthedocs.io/projects/gstools/en/latest/
Expand Down
33 changes: 15 additions & 18 deletions docs/source/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -95,14 +95,14 @@ A similar example but for a three dimensional field is exported to a

.. code-block:: python
from gstools import SRF, Gaussian, vtk_export
import matplotlib.pyplot as pt
# structured field with a size 100x100x100 and a grid-size of 1x1x1
x = y = z = range(100)
model = Gaussian(dim=3, var=0.6, len_scale=20)
srf = SRF(model)
field = srf((x, y, z), mesh_type='structured')
vtk_export('3d_field', (x, y, z), field, mesh_type='structured')
from gstools import SRF, Gaussian
import matplotlib.pyplot as pt
# structured field with a size 100x100x100 and a grid-size of 1x1x1
x = y = z = range(100)
model = Gaussian(dim=3, var=0.6, len_scale=20)
srf = SRF(model)
srf((x, y, z), mesh_type='structured')
srf.vtk_export('3d_field')
.. image:: https://raw.githubusercontent.com/GeoStat-Framework/GSTools/master/docs/source/pics/3d_gau_field.png
:width: 400px
Expand Down Expand Up @@ -191,8 +191,6 @@ model again.
import numpy as np
from gstools import SRF, Exponential, Stable, vario_estimate_unstructured
from gstools.covmodel.plot import plot_variogram
import matplotlib.pyplot as plt
# generate a synthetic field with an exponential model
x = np.random.RandomState(19970221).rand(1000) * 100.
y = np.random.RandomState(20011012).rand(1000) * 100.
Expand All @@ -202,14 +200,13 @@ model again.
# estimate the variogram of the field with 40 bins
bins = np.arange(40)
bin_center, gamma = vario_estimate_unstructured((x, y), field, bins)
plt.plot(bin_center, gamma)
# fit the variogram with a stable model. (no nugget fitted)
fit_model = Stable(dim=2)
fit_model.fit_variogram(bin_center, gamma, nugget=False)
plot_variogram(fit_model, x_max=40)
# output
ax = fit_model.plot(x_max=40)
ax.plot(bin_center, gamma)
print(fit_model)
plt.show()
Which gives:

Expand Down Expand Up @@ -287,21 +284,21 @@ a handy `VTK <https://www.vtk.org/>`__ export routine:

.. code-block:: python
from gstools import SRF, Gaussian, vtk_export
from gstools import SRF, Gaussian
x = y = range(100)
model = Gaussian(dim=2, var=1, len_scale=10)
srf = SRF(model)
field = srf((x, y), mesh_type='structured')
vtk_export("field", (x, y), field, mesh_type='structured')
srf((x, y), mesh_type='structured')
srf.vtk_export("field")
Which gives a RectilinearGrid VTK file ``field.vtr``.


Requirements
============

- `Numpy >= 1.13.0 <http://www.numpy.org>`_
- `SciPy >= 0.19.1 <http://www.scipy.org>`_
- `Numpy >= 1.14.5 <http://www.numpy.org>`_
- `SciPy >= 1.1.0 <http://www.scipy.org>`_
- `hankel >= 0.3.6 <https://github.com/steven-murray/hankel>`_
- `emcee <https://github.com/dfm/emcee>`_
- `pyevtk <https://bitbucket.org/pauloh/pyevtk>`_
Expand Down

0 comments on commit fe34e05

Please sign in to comment.