GeoStat-Framework / PyKrige

Kriging Toolkit for Python
https://pykrige.readthedocs.io
BSD 3-Clause "New" or "Revised" License
759 stars 188 forks source link

Custom variogram example #148

Closed NikhilMunna closed 4 years ago

NikhilMunna commented 4 years ago

Could you provide an example of using a custom variogram function?

MuellerSeb commented 4 years ago

Hey there,

you can use a CovModel from GSTools: https://geostat-framework.readthedocs.io/projects/pykrige/en/stable/examples/gstools_covmodel.html#sphx-glr-examples-gstools-covmodel-py

And you can easily define your own one, as described here: https://geostat-framework.readthedocs.io/projects/gstools/en/stable/examples/02_cov_model/00_intro.html#introductory-example

Does that help?

NikhilMunna commented 4 years ago

Is there any way i could use variogram from scikit-Gstat module.

From here with the above parameters.

MuellerSeb commented 4 years ago

As far as I know, scikit-gstat provides some basic kriging functionality itself. But it is not possible to use their variogram-models with PyKrige.

mmaelicke commented 4 years ago

@NikhilMunna, while @MuellerSeb is right that you cannot pass the scikit-gstat Variogram to pykrige, there is an experimental interface. In fact, the Github version of scikit-gstat has an interface to pykrige. It will be released with the 0.2.8 release on PyPI. It is still experimental and is thus neither documented nor tested in detail. I am planning to do that in the next weeks... Here: https://github.com/mmaelicke/scikit-gstat/blob/f16afae9337ddf10814cb06a1461a44e0f0ec95f/skgstat/interfaces/pykrige.py#L29 is the respective code. You would use the last function in that file. I am also working on an Interface to gstools.CovModel. If you want to go that route, it would be nice to report errors to scikit-gstat.