volint_tools

pymmaster.volint_tools provides tools to integrate elevation change into volume time series, adapted from McNabb et al. (2019).

pyddem.volint_tools.double_sum_covar_hypso(tot_err, slope_bin, elev_bin, area_tot, crange, kernel=<function kernel_exclass>)[source]

1D hypsometric propagation of correlated error through double sum of covariance

Parameters:
  • tot_err – Error per hypsometric bin
  • slope_bin – Slope per bin (to assess horizontal distance)
  • elev_bin – Reference elevation per bin
  • area_tot – Area per bin
  • crange – Correlation range
  • kernel – Form of kernel [Exponential Class]
Returns:

y interpolated, error propagated, error of interpolation

pyddem.volint_tools.hypso_dc(dh_dc, err_dc, ref_elev, dt, tvals, mask, gsd, slope=None, bin_type='fixed', bin_val=100.0, filt_bin='5NMAD', method='linear')[source]

Hypsometric spatial integration of elevation time series with NMAD filtering and with propagation of correlated errors depending on time lag to closest observation currently written for the “hypsometric cheat” volume integration routine (see tdem tools), the x/y dimension are thus flattened in 1D and we use only hypsometry for integration for now, the function defining the long-range sum of variogram is defined directly in the script based empirical sampling and least-squares fits to ICESat done separately

Parameters:
  • dh_dc – Data cube of elevation change (flattened in x/y)
  • err_dc – Data cube of elevation change errors (flattened in x/y)
  • ref_elev – Raster of reference elevation (flattened in x/y)
  • dt – Data cube of time lag to closest observation (flattened in x/y)
  • tvals – Date vector
  • mask – Mask of valid values (flattened in x/y)
  • gsd – Ground sampling distance in meters
  • slope – Slope, only used to propagate correlated hypometric errors
  • bin_type – Type of elevation binning (percentage of elevation range, or flat value)
  • bin_val – Elevation bin flat value (if that is used)
  • filt_bin – Filtering of outliers per elevation bin [currently 5NMAD of full time range]
  • method – Interpolation/extrapolation method for void elevatio bins
Returns:

Three dataframes with volume change time series

pyddem.volint_tools.interp_linear(xp, yp, errp, acc_y, loo=False)[source]

Piece-wise linear interpolation with linear extrapolation on the edges and basic error propagation (where to interpolate is given by NaN values in the vectors)

Parameters:
  • xp – x
  • yp – y
  • errp – error
  • acc_y – prior knowledge of maximum acceleration for assessing possible interpolation error
  • loo – perform a first leave-one-out interpolation, remove data outliers (outside error bars)
Returns:

y interpolated, error propagated, error of interpolation

pyddem.volint_tools.interp_lowess(xp, yp, errp, acc_y, crange, kernel=<function kernel_exclass>)[source]

LOWESS interpolation with error propagation (where to interpolate is given by NaN values in the vectors)

Parameters:
  • xp – x
  • yp – y
  • errp – error
  • acc_y – prior knowledge of maximum acceleration for assessing possible interpolation error
  • rang – Range of kernel used for local linear regression
  • kernel – Form of kernel [Exponential Class]
Returns:

y interpolated, error propagated, error of interpolation

pyddem.volint_tools.lowess_homemade_kern(x, y, w, a1, kernel='Exp')[source]

#inspired by: https://xavierbourretsicotte.github.io/loess.html homebaked lowess with variogram kernel + heteroscedasticity of observations with error

:param x:x :param y:y :param w: heteroscedastic weights (inverse of variance) :param a1: range of the kernel (in variogram terms) :param kernel: kernel function :return: