.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "examples/02_cov_model/03_spectral_methods.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_02_cov_model_03_spectral_methods.py: Spectral methods ================ The spectrum of a covariance model is given by: .. math:: S(\mathbf{k}) = \left(\frac{1}{2\pi}\right)^n \int C(\Vert\mathbf{r}\Vert) e^{i b\mathbf{k}\cdot\mathbf{r}} d^n\mathbf{r} Since the covariance function :math:`C(r)` is radially symmetric, we can calculate this by the `hankel-transformation `_: .. math:: S(k) = \left(\frac{1}{2\pi}\right)^n \cdot \frac{(2\pi)^{n/2}}{(bk)^{n/2-1}} \int_0^\infty r^{n/2-1} C(r) J_{n/2-1}(bkr) r dr Where :math:`k=\left\Vert\mathbf{k}\right\Vert`. Depending on the spectrum, the spectral-density is defined by: .. math:: \tilde{S}(k) = \frac{S(k)}{\sigma^2} You can access these methods by: .. GENERATED FROM PYTHON SOURCE LINES 26-33 .. code-block:: Python import gstools as gs model = gs.Gaussian(dim=3, var=2.0, len_scale=10) ax = model.plot("spectrum") model.plot("spectral_density", ax=ax) .. image-sg:: /examples/02_cov_model/images/sphx_glr_03_spectral_methods_001.png :alt: 03 spectral methods :srcset: /examples/02_cov_model/images/sphx_glr_03_spectral_methods_001.png :class: sphx-glr-single-img .. GENERATED FROM PYTHON SOURCE LINES 34-48 .. note:: The spectral-density is given by the radius of the input phase. But it is **not** a probability density function for the radius of the phase. To obtain the pdf for the phase-radius, you can use the methods :any:`CovModel.spectral_rad_pdf` or :any:`CovModel.ln_spectral_rad_pdf` for the logarithm. The user can also provide a cdf (cumulative distribution function) by defining a method called ``spectral_rad_cdf`` and/or a ppf (percent-point function) by ``spectral_rad_ppf``. The attributes :any:`CovModel.has_cdf` and :any:`CovModel.has_ppf` will check for that. .. rst-class:: sphx-glr-timing **Total running time of the script:** (0 minutes 0.056 seconds) .. _sphx_glr_download_examples_02_cov_model_03_spectral_methods.py: .. only:: html .. container:: sphx-glr-footer sphx-glr-footer-example .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: 03_spectral_methods.ipynb <03_spectral_methods.ipynb>` .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: 03_spectral_methods.py <03_spectral_methods.py>` .. container:: sphx-glr-download sphx-glr-download-zip :download:`Download zipped: 03_spectral_methods.zip <03_spectral_methods.zip>` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_