Rasters¶
This module provides useful methods for operating on 1D and 2D rasters such as making variogram or covariograms.
raster_to_struct_grid¶
-
wtools.geostats.raster.
raster_to_struct_grid
(datain, imeas='covar', rtol=1e-10)[source]¶ Create an auto-variogram or auto-covariance map from 1D or 2D rasters. This computes auto-variogram or auto-covariance maps from 1D or 2D rasters. This function computes variograms/covariances in the frequency domain via the Fast Fourier Transform (
np.fftn
).Note
For viewing the results, please use the
plot_struct_grid
method from theplots
module.Note
Missing values, flagged as
np.nan
, are allowed.Parameters: - datain (np.ndarray) – input arrray with raster in GeoEas format
- imeas (str) – key indicating which structural measure to compute:
'var'
for semi-variogram or'covar'
for covariogram. - gridspecs (list(GridSpec)) – array with grid specifications using
GridSpec
objects - rtol (float) – the tolerance. Default is 1e-10
Returns: output array with variogram or covariogram map, depending on variogram choice, with size: in 1D: ( 2*nxOutHalf+1 ) or in 2D: ( 2*nxOutHalf+1 x 2*nxOutHalf+1 ).
output array with number of pairs available in each lag, of same size as outStruct
Return type: tuple(np.ndarray, np.ndarray)
References
- Originally implemented in MATLAB by:
- Phaedon Kyriakidis, Department of Geography, University of California Santa Barbara, May 2005
- Reimplemented into Python by:
- Jonah Bartrand, Department of Geophysics, Colorado School of Mines, October 2018
- Algorith based on:
- Marcotte, D. (1996): Fast Variogram Computation with FFT, Computers & Geosciences, 22(10), 1175-1186.
suprts2modelcovFFT¶
-
wtools.geostats.raster.
suprts2modelcovFFT
(CovMapExtFFT, ind1Ext, sf1Ext, ind2Ext, sf2Ext)[source]¶ Integrated model covariances between 1 or 2 sets of arbitrary supports. Function to calculate array of TOTAL or AVERAGE model covariances between 1 or 2 sets of irregular supports, using convolution in the frequency domain (FFT-based). Integration or averaging is IMPLICIT in the pre-computed sampling functions (from discrsuprtsFFT).
Parameters: - CovMapExtFFT (np.ndarray) – Fourier transform of model covariance map evaluated at nodes of an extended MATLAB grid
- ind1Ext – (nSup1 x 1) cell array with MATLAB indices of non-zero sampling function values for support set #1 in extended MATLAB grid
- sf1Ext – (nSup1 x 1) cell array with sampling function values for support set #1
- ind2Ext – Optional (nSup2 x 1) cell array with MATLAB indices of non-zero sampling function values for support set #2 in extended MATLAB grid
- sf2Ext – Optional (nSup2 x 1) cell array with sampling function values for support set #2
Returns: (nSup1 x nSup[1,2]) array with integrated covariances
Return type: np.ndarray
References
- Originally implemented in MATLAB by:
- Phaedon Kyriakidis, Department of Geography, University of California Santa Barbara, May 2005
- Reimplemented into Python by:
- Bane Sullivan and Jonah Bartrand, Department of Geophysics, Colorado School of Mines, October 2018