.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "examples/03_gstools_covmodel.py" .. LINE NUMBERS ARE GIVEN BELOW. .. only:: html .. note:: :class: sphx-glr-download-link-note :ref:`Go to the end ` to download the full example code. .. rst-class:: sphx-glr-example-title .. _sphx_glr_examples_03_gstools_covmodel.py: GSTools Interface ================= Example how to use the PyKrige routines with a GSTools CovModel. .. GENERATED FROM PYTHON SOURCE LINES 8-34 .. image-sg:: /examples/images/sphx_glr_03_gstools_covmodel_001.png :alt: 03 gstools covmodel :srcset: /examples/images/sphx_glr_03_gstools_covmodel_001.png :class: sphx-glr-single-img .. code-block:: Python import gstools as gs import numpy as np from matplotlib import pyplot as plt from pykrige.ok import OrdinaryKriging # conditioning data data = np.array( [ [0.3, 1.2, 0.47], [1.9, 0.6, 0.56], [1.1, 3.2, 0.74], [3.3, 4.4, 1.47], [4.7, 3.8, 1.74], ] ) # grid definition for output field gridx = np.arange(0.0, 5.5, 0.1) gridy = np.arange(0.0, 6.5, 0.1) # a GSTools based covariance model cov_model = gs.Gaussian(dim=2, len_scale=4, anis=0.2, angles=-0.5, var=0.5, nugget=0.1) # ordinary kriging with pykrige OK1 = OrdinaryKriging(data[:, 0], data[:, 1], data[:, 2], cov_model) z1, ss1 = OK1.execute("grid", gridx, gridy) plt.imshow(z1, origin="lower") plt.show() .. rst-class:: sphx-glr-timing **Total running time of the script:** (0 minutes 0.036 seconds) .. _sphx_glr_download_examples_03_gstools_covmodel.py: .. only:: html .. container:: sphx-glr-footer sphx-glr-footer-example .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: 03_gstools_covmodel.ipynb <03_gstools_covmodel.ipynb>` .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: 03_gstools_covmodel.py <03_gstools_covmodel.py>` .. container:: sphx-glr-download sphx-glr-download-zip :download:`Download zipped: 03_gstools_covmodel.zip <03_gstools_covmodel.zip>` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_