smrf.spatial package

Submodules

smrf.spatial.grid module

2016-03-07 Scott Havens

Distributed forcing data over a grid using interpolation

class smrf.spatial.grid.GRID(config, mx, my, GridX, GridY, mz=None, GridZ=None, mask=None, metadata=None)[source]

Bases: object

Inverse distance weighting class - Standard IDW - Detrended IDW

calculateInterpolation(data, grid_method='linear')[source]

Interpolate over the grid

Parameters
  • data – data to interpolate

  • mx – x locations for the points

  • my – y locations for the points

  • X – x locations in grid to interpolate over

  • Y – y locations in grid to interpolate over

detrendedInterpolation(data, flag=0, grid_method='linear')[source]

Interpolate using a detrended approach

Parameters
  • data – data to interpolate

  • grid_method – scipy.interpolate.griddata interpolation method

detrendedInterpolationLocal(data, flag=0, grid_method='linear')[source]

Interpolate using a detrended approach

Parameters
  • data – data to interpolate

  • grid_method – scipy.interpolate.griddata interpolation method

detrendedInterpolationMask(data, flag=0, grid_method='linear')[source]

Interpolate using a detrended approach

Parameters
  • data – data to interpolate

  • grid_method – scipy.interpolate.griddata interpolation method

smrf.spatial.idw module

class smrf.spatial.idw.IDW(mx, my, GridX, GridY, mz=None, GridZ=None, power=2, zeroVal=- 1)[source]

Bases: object

Inverse distance weighting class for distributing input data. Availables options are:

  • Standard IDW

  • Detrended IDW

calculateDistances()[source]

Calculate the distances from the measurement locations to the grid locations

calculateIDW(data, local=False)[source]

Calculate the IDW of the data at mx,my over GridX,GridY Inputs: data - is the same size at mx,my

calculateWeights()[source]

Calculate the weights for

detrendData(data, flag=0, zeros=None)[source]

Detrend the data in val using the heights zmeas data - is the same size at mx,my flag - 1 for positive, -1 for negative, 0 for any trend imposed

detrendedIDW(data, flag=0, zeros=None, local=False)[source]

Calculate the detrended IDW of the data at mx,my over GridX,GridY Inputs: data - is the same size at mx,my

retrendData(idw)[source]

Retrend the IDW values

smrf.spatial.kriging module

class smrf.spatial.kriging.KRIGE(mx, my, mz, GridX, GridY, GridZ, config)[source]

Bases: object

Kriging class based on the pykrige package

calculate(data)[source]

Estimate the variogram, calculate the model, then apply to the grid

Arg:

data: numpy array same length as m* config: configuration for dk

Returns

Z-values of specified grid or at thespecified set of points.

If style was specified as ‘masked’, zvalues will be a numpy masked array.

sigmasq: Variance at specified grid points or

at the specified set of points. If style was specified as ‘masked’, sigmasq will be a numpy masked array.

Return type

v

detrendData(data, flag=0, zeros=None)[source]

Detrend the data in val using the heights zmeas

Parameters
  • data – is the same size at mx,my

  • flag

    • 1 for positive, -1 for negative, 0 for any trend imposed

Returns

data minus the elevation trend

retrendData(idw)[source]

Retrend the IDW values

Module contents