CalibratorCryotempo#

class dtcg.integration.calibration.CalibratorCryotempo(model_matrix=None)[source]#

Bases: Calibrator

Methods

__init__([model_matrix])

calibrate(gdir, model_matrix, ref_mb, **kwargs)

Calibrate and run OGGM models using a model matrix.

get_calibrated_models(gdir, model_class, ref_mb)

Get calibrated models.

get_calibration_mb(ref_mb, geo_period, source)

get_dmdtda(dataset, dates, year_start, year_end)

Get dmdtdA from a CryoTEMPO-EOLIS dataset.

get_eolis_dates(ds)

Get time index from CryoTEMPO-EOLIS dataset.

get_eolis_mean_dh(ds)

Get

get_geodetic_mb(gdir[, dataset])

Get geodetic mass balances for a glacier.

get_nearest(items, pivot)

get_temporal_bounds(dates, year_start, year_end)

Get start and end dates of geodetic and observational periods.

run_calibration(gdir, datacube[, model])

Run calibration.

set_geodetic_mb_from_dataset(gdir, dataset)

Set the geodetic mass balance from enhanced gridded data.

set_model_matrix([name, model, geo_period, ...])

Set model parameters for calibration.

Parameters:

model_matrix (dict)

__init__(model_matrix=None)[source]#
Parameters:

model_matrix (dict)

calibrate(
gdir,
model_matrix,
ref_mb,
**kwargs,
)[source]#

Calibrate and run OGGM models using a model matrix.

Parameters:
  • gdir (GlacierDirectory) – Glacier directory.

  • model_matrix (dict) – Model parameters for various calibration runs.

  • ref_mb (Geodetic mass balances.)

Returns:

Calibrated mass balance models, flowlines, and specific mass balances for each set of configuration parameters in model_matrix.

Return type:

tuple

get_calibrated_models(
gdir,
model_class,
ref_mb,
geodetic_period='',
years=None,
model_calib=None,
model_flowlines=None,
smb=None,
daily=False,
calibration_filesuffix='',
calibration_parameters=None,
**kwargs,
)#

Get calibrated models.

Note this uses all three calibration parameters, with prcp_fac as the first parameter.

Parameters:
  • gdir (GlacierDirectory) – Glacier directory.

  • model_class (oggm.MassBalanceModel) – Any mass balance model that subclasses MonthlyTIModel.

  • ref_mb (pd.DataFrame) – Reference mass balance.

  • geodetic_period (str, default empty string) – The reference calibration period in the format: “Y-M-D_Y-M-D”

  • years (list, default None) – Years for which to calculate the specific mass balance. Ensure these are float years when using MonthlyTI.

  • model_calib (dict) – Store calibrated models derived from mb_model_class

  • model_flowlines (dict) – Store calibrated MultipleFlowlineMassBalanceModel.

  • smb (dict) – Store specific mass balance.

  • daily (bool, default False) – Process daily specific mass balance.

  • calibration_filesuffix (str, default empty string) – Calibration filesuffix.

  • calibration_parameters (dict, default None) – Extra arguments passed to mb_calibration_from_scalar_mb.

  • kwargs – Extra arguments passed to the mass balance model used for calibration.

Returns:

Calibrated model instances for each calibration parameter, calibrated flowline models for each parameter, and specific mass balance for each calibrated flowline model.

Return type:

tuple

get_calibration_mb(
ref_mb,
geo_period,
source,
)[source]#
Parameters:
  • ref_mb (pd.DataFrame) – Reference geodetic mass balances.

  • geo_period (str) – Geodetic reference period in the format <YYYY-MM-DD_YYYY-MM-DD>.

  • source (str) – Reference mass balance source, e.g. “Hugonnet”.

Returns:

Geodetic mass balance for calibration period.

Return type:

float

get_dmdtda(
dataset,
dates,
year_start,
year_end,
)[source]#

Get dmdtdA from a CryoTEMPO-EOLIS dataset.

Parameters:
  • dataset (xr.DataArray) – CryoTEMPO-EOLIS data.

  • dates (list) – Datetimes for each timestep in the data period.

  • year_start (datetime) – Start of reference period.

  • year_end (datetime) – End of reference period.

Returns:

dmdtdA for a glacier.

Return type:

float

get_eolis_dates(ds)[source]#

Get time index from CryoTEMPO-EOLIS dataset.

Parameters:

ds (xr.Dataset) – CryoTEMPO-EOLIS dataset.

Returns:

Time index adjusted to UTC.

Return type:

np.ndarray

get_eolis_mean_dh(ds)[source]#

Get

Parameters:

ds (xr.Dataset) – CryoTEMPO-EOLIS dataset.

Returns:

Time series of spatial mean of elevation change.

Return type:

np.ndarray

get_geodetic_mb(gdir, dataset=None)[source]#

Get geodetic mass balances for a glacier.

Parameters:
  • gdir (GlacierDirectory) – Glacier directory.

  • dataset (xr.Dataset) – CryoTEMPO-EOLIS data.

Returns:

Geodetic mass balances for a specific glacier RGI ID.

Return type:

pd.DataFrame

get_temporal_bounds(
dates,
year_start,
year_end,
)[source]#

Get start and end dates of geodetic and observational periods.

This matches the nearest available dates for irregular time indices.

Parameters:
  • dates (list) – Time index. This may be irregularly spaced.

  • year_start (int) – Start year of a desired period.

  • year_end (int) – End year of a desired period.

Returns:

Start and end dates of geodetic reference period, and the nearest available start and end dates for observations.

Return type:

tuple[datetime]

run_calibration(
gdir,
datacube,
model=<class 'oggm.core.massbalance.SfcTypeTIModel'>,
)[source]#

Run calibration.

Parameters:
  • gdir (GlacierDirectory) – Glacier directory.

  • datacube (GeoZarrHandler) – L1 or L2 datacube.

  • model (massbalance.MassBalanceModel, default SfcTypeTIModel.) – OGGM mass balance model class, ideally DailyTIModel or similar.

Returns:

Calibrated mass balance models, flowlines, and specific mass balances for each set of configuration parameters in model_matrix.

Return type:

tuple[dict, dict, dict]

set_geodetic_mb_from_dataset(
gdir,
dataset,
year_start=2011,
year_end=2020,
)[source]#

Set the geodetic mass balance from enhanced gridded data.

Parameters:
  • gdir (GlacierDirectory) – Glacier directory.

  • dataset (xr.Dataset) – CryoTEMPO-EOLIS dataset.

  • year_start (int, default 2011) – Start of reference period.

  • year_end (int, default 2020) – End of reference period.

Returns:

Geodetic mass balances for various glaciers.

Return type:

pd.DataFrame

set_model_matrix(
name='SfcType_Cryosat',
model=<class 'oggm.core.massbalance.SfcTypeTIModel'>,
geo_period='2011-01-01_2020-01-01',
daily=True,
source='CryoTEMPO-EOLIS',
**kwargs,
)[source]#

Set model parameters for calibration.

Parameters:
  • name (str) – Name of configuration parameters. Ideally this should match the settings filesuffix.

  • model (oggm.core.massbalance.MassBalanceModel) – OGGM mass balance model class.

  • geo_period (str) – Reference mass balance period in the format YYYY-MM-DD_YYYY-MM-DD.

  • kwargs – Additional arguments passed to the mass balance model class.

  • daily (bool)

  • source (str)