Kriging and Inverse Distance Interpolation using GSTAT

版本 1.1.0.0 (5.7 KB) 作者: James Ramm
InterpolationGstat performs inverse distance or kriging interpolation using gstat.
3.8K 次下载
更新时间 2011/4/21

查看许可证

Kriging and inverse distance are popular interpolation methods, especially in earth sciences. There are some routines already available on matlab but are severely limited by matlabs memory constraints. By using gstat to handle interpolation and variogram modelling, very large datasets are easily handled.

USAGE: Requires gstat.exe (freeware) to run (www.gstat.org).

% INVERSE DISTANCE:
% INPUTS:
% x :: sample locations in x
% y :: sample locations in y
% z :: sample data
% res :: resolution of interpolation grid
% radius :: maximum search radius for interpolation
% method = 'invdist'
% uselog :: 1 if z values should be log transformed, 0 if not
% name :: name of output file without extension. e.g. 'predictions'.
% (file is given extension '.grd')
% useloc (OPTIONAL) :: if 1, will use file 'locations.dat' if it exist for
% interpolation locations. If 0, will prompt user to choose whether to use
% locations.dat (if it exists) or rewrite. Useful when calling the
% interpolation routine in a loop.
% S is not required for inverse distance
%
% KRIGING:
% INPUTS:
% x,y,z,res,radius :: as for inverse distance
% method = 'kriging'
% uselog :: as for inverse distance
% name :: as for inverse distance
% S :: Structure containing variogram information as output
% by the variogramfit function.
% useloc (OPTIONAL):: as for inverse distance
%
% OUTPUTS:
% xi :: the prediction locations in x
% yi :: the prediction locations in y
% zi :: the predicted result
% pcolor can be used to visualise. e.g. pcolor(xi,yi,zi); shading interp;

For variogram modelling, use SampleVarioGstat.m to create the experimental variogram. The excellent variogramfit by Wolfgram Schwanghart should be used to fit the experimental variogram. File ID: #25948.

Look at the readme for tips on kriging and inverse distance interpolation, and help InterpolationGstat and help SampleVarioGstat for correct usage.

NOTE:
This routine is intended to make it easy to perform kriging or inverse distance interpolation. It is not intended as a full interface to all the capabilities of gstat. As such only 2D ordinary kriging, inverse distance and experimental variogram modelling are supported, with only key parameters being offered as options.

引用格式

James Ramm (2024). Kriging and Inverse Distance Interpolation using GSTAT (https://www.mathworks.com/matlabcentral/fileexchange/31055-kriging-and-inverse-distance-interpolation-using-gstat), MATLAB Central File Exchange. 检索来源 .

MATLAB 版本兼容性
创建方式 R2009b
兼容任何版本
平台兼容性
Windows macOS Linux
类别
Help CenterMATLAB Answers 中查找有关 Geology 的更多信息
致谢

参考作品: variogramfit

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!
版本 已发布 发行说明
1.1.0.0

Fixed bugs in 'InterpolationGstat.m'
- errors involving use of 'uselog' and pre-existing locations files resolved
- if gstat fails, it no longer attempts to open and read the resulting predictions file (as it doesnt exist)

1.0.0.0