from geostatsmodels import utilities, variograms, model, kriging, geoplot import numpy as np import matplotlib.pyplot as plt from math import * z = utilities.readGeoEAS('ZoneA.dat') P = z[:,[0,1,3]] pt = [2000, 4700] plt.scatter(P[:,0], P[:,1], c=P[:,2], cmap=geoplot.YPcmap) plt.title('Zone A Subset % Porosity') plt.colorbar() xmin, xmax = 0, 4250 ymin, ymax = 3200, 6250 plt.xlim(xmin,xmax) plt.ylim(ymin,ymax) for i in range( len( P[:,2] ) ): x, y, por = P[i] if( x < xmax )&( y > ymin )&( y < ymax ): plt.text( x+100, y, '{:4.2f}'.format( por ) ) plt.scatter( pt[0], pt[1], marker='x', c='k' ) plt.text( pt[0]+100 , pt[1], '?') plt.xlabel('Easting (m)') plt.ylabel('Northing (m)') plt.show() tolerance = 250 lags = np.arange(tolerance, 10000, tolerance*2) sill = np.var(P[:,2])
# <markdowncell> # This notebook is the reproduction of an exercise found at http://people.ku.edu/~gbohling/cpe940/Kriging.pdf # <codecell> from geostatsmodels import utilities, variograms, model, kriging, geoplot import pandas # <markdowncell> # We'll read the data from `ZoneA.dat`. # <codecell> z = utilities.readGeoEAS('../data/ZoneA.dat') # <markdowncell> # We want the first, second and fourth columns of the data set, representing the x and y spatial coordinates, and the porosity. # <codecell> P = z[:, [0, 1, 3]] # <markdowncell> # We'll be interested in determining the porosity at a point (2000,4700). # <codecell>
#!/usr/bin/env python import geostatsmodels.utilities as u import geostatsmodels.kriging as k import geostatsmodels.simulation as s from pylab import * import numpy as np # read cluster.dat d = u.readGeoEAS("cluster.dat") # take the first three columns d = d[:,:3] # define the lags and tolerance # for the semivariogram modeling lags, tol = np.linspace( 10, 50, 10 ), 5 # if the data is not normally distributed, # perfrom a z-score transformation d, inv = u.to_norm( d ) # perform sequential Gaussian simulation using # a spherical model, on a 5x5 grid m = s.sgs( d, k.spherical, lags, tol, 5, 5 ) # use the [:,::-1].T to a) reverse the order of the columns # and then b) transpose the data, this takes it from Python # conventions, back to the way we normally think of spatial data print m[:,::-1].T
# <markdowncell> # This notebook is the reproduction of an exercise found at http://people.ku.edu/~gbohling/cpe940/Kriging.pdf # <codecell> from geostatsmodels import utilities, variograms, model, kriging, geoplot import pandas # <markdowncell> # We'll read the data from `ZoneA.dat`. # <codecell> z = utilities.readGeoEAS('../data/ZoneA.dat') # <markdowncell> # We want the first, second and fourth columns of the data set, representing the x and y spatial coordinates, and the porosity. # <codecell> P = z[:,[0,1,3]] # <markdowncell> # We'll be interested in determining the porosity at a point (2000,4700). # <codecell>