smrf.spatial.dk package

smrf.spatial.dk.detrended_kriging module

Compiling dk’s kriging function

20160205 Scott Havens

smrf.spatial.dk.detrended_kriging.call_grid(ad, dgrid, ndarray elevations, ndarray weights, int nthreads=1)

Call the function krige_grid in krige.c which will iterate over the grid within the C code

Parameters:
  • - [nsta x nsta] matrix of distances between stations (ad) –
  • - [ngrid x nsta] matrix of distances between grid points and stations (dgrid) –
  • - [nsta] array of station elevations (elevations) –
  • weights (return) –
  • - number of threads to use in parallel processing (nthreads) –
Out:
weights changed in place

20160222 Scott Havens

smrf.spatial.dk.dk module

2016-02-22 Scott Havens

Distributed forcing data over a grid using detrended kriging

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

Bases: object

Detrended kriging class

calculate(data)[source]

Calcluate the deternded kriging for the data and config

Arg:
data: numpy array same length as m* config: configuration for dk
Returns:returns the distributed and calculated value
Return type:v
calculateWeights()[source]

Calculate the weights given those stations with nan values for data

detrendData(data)[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

retrendData(r)[source]

Retrend the residual values

Module contents