spstats_tools

pyddem.spstats_tools provides tools to derive spatial statistics for elevation change data.

pyddem.spstats_tools.aggregate_tinterpcorr(infile, cutoffs=[10000, 100000, 1000000])[source]

Weighted aggregation of empirical spatial variograms between different regions, with varying time lags and sampling ranges, accounting for the number of pairwise samples drawn

Parameters:
  • infile – Filename of sampled variograms
  • cutoffs – Maximum successive ranges for sampling variogram
Returns:

pyddem.spstats_tools.cov(h, crange, model='Sph', psill=1.0, kappa=0.5, nugget=0)[source]

Compute covariance based on variogram function

Parameters:
  • h – Spatial lag
  • crange – Correlation range
  • model – Model
  • psill – Partial sill
  • kappa – Smoothing parameter for Exp Class
  • nugget – Nugget
Returns:

Variogram function

pyddem.spstats_tools.double_sum_covar(list_tuple_errs, corr_ranges, list_area_tot, list_lat, list_lon, nproc=1)[source]

Double sum of covariances for propagating multi-range correlated errors for disconnected spatial ensembles

Parameters:
  • list_tuple_errs – List of tuples of correlated errors by range, by ensemble
  • corr_ranges – List of correlation ranges
  • list_area_tot – List of areas of ensembles
  • list_lat – Center latitude of ensembles
  • list_lon – Center longitude of ensembles
  • nproc – Number of cores to use for multiprocessing [1]
Returns:

pyddem.spstats_tools.get_tinterpcorr(df, outfile, cutoffs=[10000, 100000, 1000000], nlags=100, nproc=1, nmax=10000)[source]

Sample empirical spatial variograms with time lags to observation

Parameters:
  • df – DataFrame of differences between ICESat and GP data aggregated for all regions
  • outfile – Filename of csv for outputs
  • cutoffs – Maximum successive ranges for sampling variogram
  • nlags – Number of lags to sample up to cutoff
  • nproc – Number of cores to use for multiprocessing [1]
  • nmax – Maximum number of observations to use for pairwise sampling (drawn randomly)
Returns:

pyddem.spstats_tools.neff_circ(area, list_vgm)[source]

Effective number of samples numerically integrated for a sum of variogram functions over an area: circular approximation of Rolstad et al. (2009)

Parameters:
  • area – Area
  • list_vgm – List of variogram function to sum
Returns:

Number of effective samples

pyddem.spstats_tools.neff_rect(area, width, crange1, psill1, model1='Sph', crange2=None, psill2=None, model2=None)[source]

Effective number of samples numerically integrated for a sum of 2 variogram functions over a rectangular area: rectangular approximation of Hugonnet et al. (TBD)

Parameters:
  • area – Area
  • width – Width of rectangular area
  • crange1 – Correlation range of first variogram
  • psill1 – Partial sill of first variogram
  • model1 – Model of first variogram
  • crange2 – Correlation range of second variogram
  • psill2 – Partial sill of second variogram
  • model2 – Model of second variogram
Returns:

Number of effective samples

pyddem.spstats_tools.vgm(h, crange, model='Sph', psill=1.0, kappa=0.5, nugget=0)[source]

Compute variogram model function (Spherical, Exponential, Gaussian or Exponential Class)

Parameters:
  • h – Spatial lag
  • crange – Correlation range
  • model – Model
  • psill – Partial sill
  • kappa – Smoothing parameter for Exp Class
  • nugget – Nugget
Returns:

Variogram function