fit

Utilities for creating models from surface elevation data

Source code

General Methods

grounding_zones.fit.iterative_surface(t_in, x_in, y_in, d_in, TERMS=[], **kwargs)[source]

Iteratively fit a polynomial surface to the elevation data to reduce to within a valid surface window [Schenk2012] [Smith2019] [Sutterley2014]

Parameters:
t_in: np.ndarray

input time array

x_in: np.ndarray

x-coordinate array

y_in: np.ndarray

y-coordinate array

d_in: np.ndarray

input data array

FIT_TYPE: str

type of time-variable polynomial fit to apply

  • 'polynomial'

  • 'chebyshev'

  • 'spline'

ITERATIONS: int, default 25

maximum number of iterations to use in fit

ORDER_TIME: int

maximum polynomial order in time-variable fit

ORDER_SPACE: int

maximum polynomial order in spatial fit

TERMS: list

list of extra terms

BOUNDED: bool

use bounded least-squares fit

STDEV: float

standard deviation of output error

CONF: float

confidence interval of output error

AICc: bool

use second order AIC

kwargs: dict

keyword arguments for the fit type

Returns:
beta: np.ndarray

regressed coefficients array

error: np.ndarray

regression fit error for each coefficient

data: np.ndarray

modeled elevation at centroid

model: np.ndarray

modeled surface time-series at input points

std_error: np.ndarray

standard error for each coefficient

R2: float

coefficient of determination (r^2)

R2Adj: float

adjusted r^2 value

MSE: float

mean square error

WSSE: float

weighted sum of squares error

NRMSE: float

normalized root mean square error

AIC: float

Akaike information criterion (Second-Order, AICc)

BIC: float

Bayesian information criterion (Schwarz criterion)

LOGLIK: float

log likelihood

residual: np.ndarray

model residual

DOF: int

degrees of freedom

count: int

final number of points used in the fit

indices: np.ndarray

indices of valid points

iterations: int

number of iterations performed

window: float

final window size for the fit

RDE: float

robust dispersion estimate

centroid: dict

centroid point used in the fit

References

[Schenk2012]

T. Schenk and B. M. Csatho, “A New Methodology for Detecting Ice Sheet Surface Elevation Changes From Laser Altimetry Data”, IEEE Transactions on Geoscience and Remote Sensing, 50(9), 3302–3316, (2012). doi:10.1109/TGRS.2011.2182357

[Smith2019]

B. E. Smith el al., “Land ice height-retrieval algorithm for NASA’s ICESat-2 photon-counting laser altimeter”, Remote Sensing of Environment, 233, 111352, (2019). doi:10.1016/j.rse.2019.111352

[Sutterley2014]

T. C. Sutterley, I. Velicogna, E. J. Rignot, J. Mouginot, T. Flament, M. R. van den Broeke, J. M. van Wessem, C. H. Reijmer, “Mass loss of the Amundsen Sea Embayment of West Antarctica from four independent techniques”, Geophysical Research Letters, 41(23), 8421–8428, (2014). doi:10.1002/2014GL061940

grounding_zones.fit.polynomial_surface(t_in, x_in, y_in, d_in, STDEV=0, CONF=0, AICc=True, **kwargs)[source]

Fits a polynomial surface to a set of points [Schenk2012] [Sutterley2014]

Parameters:
t_in: np.ndarray

input time array

x_in: np.ndarray

x-coordinate array

y_in: np.ndarray

y-coordinate array

d_in: np.ndarray

input data array

FIT_TYPE: str

type of time-variable polynomial fit to apply

  • 'polynomial'

  • 'chebyshev'

  • 'spline'

ORDER_TIME: int

maximum polynomial order in time-variable fit

ORDER_SPACE: int

maximum polynomial order in spatial fit

KNOTS: list or np.ndarray

Sorted 1D array of knots for time-variable spline fit

TERMS: list

list of extra terms

BOUNDED: bool

use bounded least-squares fit

STDEV: float

standard deviation of output error

CONF: float

confidence interval of output error

AICc: bool

use second order AIC

kwargs: dict

keyword arguments for the fit type

Returns:
beta: np.ndarray

regressed coefficients array

error: np.ndarray

regression fit error for each coefficient

data: np.ndarray

modeled elevation at centroid

model: np.ndarray

modeled surface time-series at input points

std_error: np.ndarray

standard error for each coefficient

R2: float

coefficient of determination (r^2)

R2Adj: float

adjusted r^2 value

MSE: float

mean square error

WSSE: float

weighted sum of squares error

NRMSE: float

normalized root mean square error

AIC: float

Akaike information criterion (Second-Order, AICc)

BIC: float

Bayesian information criterion (Schwarz criterion)

LOGLIK: float

log likelihood

residual: np.ndarray

model residual

N: int

number of terms in the model

DOF: int

degrees of freedom

cov_mat: np.ndarray

covariance matrix

centroid: dict

centroid point used in the fit

References

[Schenk2012]

T. Schenk and B. M. Csatho, “A New Methodology for Detecting Ice Sheet Surface Elevation Changes From Laser Altimetry Data”, IEEE Transactions on Geoscience and Remote Sensing, 50(9), 3302–3316, (2012). doi:10.1109/TGRS.2011.2182357

[Sutterley2014]

T. C. Sutterley, I. Velicogna, E. J. Rignot, J. Mouginot, T. Flament, M. R. van den Broeke, J. M. van Wessem, C. H. Reijmer, “Mass loss of the Amundsen Sea Embayment of West Antarctica from four independent techniques”, Geophysical Research Letters, 41(23), 8421–8428, (2014). doi:10.1002/2014GL061940

grounding_zones.fit.piecewise_bending(x, y, STEP=1, CONF=None)[source]

Fits a piecewise linear regression to elevation data to find two sharp breakpoints

Parameters:
x: np.ndarray

input x-coordinate array

y: np.ndarray

input y-coordinate array

STEP: int, default 1

step size for regridding the input data

CONF: float or None, default None

confidence interval of output error

Returns:
point1: list

first breakpoint and confidence interval

point2: list

second breakpoint and confidence interval

model: np.ndarray

modeled surface from the piecewise fit

grounding_zones.fit.elastic_bending(XI, YI, METHOD='trf', GRZ=[0, 0, 0], TIDE=[0, 0, 0], ORIENTATION=False, THICKNESS=None, CONF=0.95, XOUT=None)[source]

Fits an elastic bending model to the grounding zone of an ice shelf [Smith1991] [Vaughan1995]

Parameters:
XI: np.ndarray

input x-coordinate array

YI: np.ndarray

input y-coordinate array

METHOD: str

optimization algorithm to use in curve_fit

GRZ: np.ndarray

initial guess for the grounding line location

TIDE: np.ndarray

initial guess for the tidal amplitude

ORIENTATION: bool

reorient input parameters to go from land ice to floating

THICKNESS: np.ndarray or None

initial guess for ice thickness

CONF: float, default 0.95

confidence interval of output error

XOUT: np.ndarray or None

output x-coordinates for model fit

Returns:
GZ: np.ndarray

grounding line location and confidence interval

A: np.ndarray

tidal amplitude and confidence interval

E: np.ndarray

effective elastic modulus of ice and confidence interval

T: np.ndarray

ice thickness of ice shelf and confidence interval

dH: np.ndarray

mean height change and confidence interval

MODEL: np.ndarray

modeled surface from the elastic bending model

References

[Smith1991]

A. M. Smith, “The use of tiltmeters to study the dynamics of Antarctic ice-shelf grounding lines”, Journal of Glaciology, 37(125), 51–58, (1991). doi:10.3198/1991JoG37-125-51-59

[Vaughan1995]

D. G. Vaughan, “Tidal flexure at ice shelf margins”, Journal of Geophysical Research Solid Earth, 100(B4), 6213–6224, (1995). doi:10.1029/94JB02467

grounding_zones.fit.median_filter(r0)[source]

Calculates the interquartile range [Pritchard2009] and robust dispersion estimator [Smith2017] of the model residuals

Parameters:
r0: float

height residuals

Returns:
IQR: float

75% of the interquartile range

RDE: float

50% of the difference between the 84th and 16th percentiles

median: float

median value of height residuals

References

[Pritchard2009]

H. D. Pritchard et al., “Extensive dynamic thinning on the margins of the Greenland and Antarctic ice sheets”, Nature, 461(7266), 971–975, (2009). doi:10.1038/nature08471

[Smith2017]

B. E. Smith el al., “Connected subglacial lake drainage beneath Thwaites Glacier, West Antarctica”, The Cryosphere, 11(1), 451–467, (2017). doi:10.5194/tc-11-451-2017

grounding_zones.fit._build_design_matrix(t_in, x_in, y_in, FIT_TYPE='polynomial', ORDER_SPACE=3, TERMS=[], **kwargs)[source]

Builds the complete design matrix for the surface fit

Parameters:
t_in: np.ndarray

input time array

x_in: np.ndarray

x-coordinate array

y_in: np.ndarray

y-coordinate array

FIT_TYPE: str

type of time-variable polynomial fit to apply

  • 'polynomial'

  • 'chebyshev'

  • 'spline'

ORDER_TIME: int

maximum polynomial order in time-variable fit

ORDER_SPACE: int

maximum polynomial order in spatial fit

KNOTS: list or np.ndarray

Sorted 1D array of knots for time-variable spline fit

TERMS: list

list of extra terms

kwargs: dict

keyword arguments for the fit type

Returns:
DMAT: np.ndarray

Design matrix for the fit type

centroid: dict

centroid point of input coordinates

grounding_zones.fit._validate_design_matrix(DMAT)[source]

Validates the design matrix for the surface fit

Parameters:
DMAT: np.ndarray

Design matrix for the fit type

Returns:
DMAT: np.ndarray

Design matrix for the fit type

indices: np.ndarray

indices of valid columns in the design matrix

grounding_zones.fit._build_constraints(t_in, x_in, y_in, d_in, **kwargs)[source]

Builds the constraints for the surface fit

Parameters:
t_in: np.ndarray

input time array

x_in: np.ndarray

x-coordinate array

y_in: np.ndarray

y-coordinate array

d_in: np.ndarray

input data array

FIT_TYPE: str

type of time-variable polynomial fit to apply

  • 'polynomial'

  • 'chebyshev'

  • 'spline'

ORDER_TIME: int

maximum polynomial order in time-variable fit

ORDER_SPACE: int

maximum polynomial order in spatial fit

KNOTS: list or np.ndarray

Sorted 1D array of knots for time-variable spline fit

TERMS: list

list of extra terms

INDICES: np.ndarray

indices of valid columns in the design matrix

kwargs: dict

keyword arguments for the fit type

Returns:
lb: np.ndarray

Lower bounds for the fit

ub: dict

Upper bounds for the fit

grounding_zones.fit._temporal_terms(**kwargs)[source]

Calculates the number of temporal terms for a given fit

Parameters:
FIT_TYPE: str

type of time-variable polynomial fit to apply

  • 'polynomial'

  • 'chebyshev'

  • 'spline'

ORDER_TIME: int

maximum polynomial order in time-variable fit

KNOTS: list or np.ndarray

Sorted 1D array of knots for time-variable spline fit

Returns:
n_time: int

Number of time-variable terms in fit

grounding_zones.fit._spatial_terms(**kwargs)[source]

Calculates the number of spatial terms for a given fit

Parameters:
ORDER_SPACE: int

maximum polynomial order in spatial fit

Returns:
n_space: int

Number of spatial terms in fit

grounding_zones.fit._polynomial(t_in, RELATIVE=Ellipsis, ORDER_TIME=3, **kwargs)[source]

Create a polynomial design matrix for a time-series

Parameters:
t_in: np.ndarray

input time array

RELATIVE: int or np.ndarray

relative period

ORDER_TIME: int

maximum polynomial order in time-variable fit

Returns:
TMAT: list

time-variable design matrix based on polynomial order

t_rel: float

relative time

grounding_zones.fit._chebyshev(t_in, RELATIVE=None, ORDER_TIME=3, **kwargs)[source]

Create a Chebyshev design matrix for a time-series

Parameters:
t_in: np.ndarray

input time array

RELATIVE: list or np.ndarray

relative period

ORDER_TIME: int

maximum polynomial order in time-variable fit

Returns:
TMAT: list

time-variable design matrix based on polynomial order

grounding_zones.fit._surface(x_in, y_in, ORDER_SPACE=3, **kwargs)[source]

Create a surface design matrix for fit

Parameters:
x_in: np.ndarray

x-coordinate array

y_in: np.ndarray

y-coordinate array

ORDER_SPACE: int

maximum polynomial order in spatial fit

kwargs: dict

keyword arguments for the fit type

Returns:
SMAT: list

surface design matrix

centroid: dict

centroid point of input coordinates

grounding_zones.fit._elastic(x, GZ, A, E, T, dH)[source]

Physical elastic bending model with a mean height change

Parameters:
x: np.ndarray

x-coordinate array

GZ: float

grounding line location

A: float

tidal amplitude

E: float

effective elastic modulus of ice

T: float

ice thickness of ice shelf

dH: float

mean height change

Returns:
model: np.ndarray

modeled surface from the elastic bending model

grounding_zones.fit._confidence_interval(x, f, p)[source]

Calculate the confidence interval

Parameters:
x: np.ndarray

input x-coordinate array

f: np.ndarray

input probability distribution

p: float

confidence interval