oggm.core.massbalance.ConstantMassBalance#
- class oggm.core.massbalance.ConstantMassBalance(gdir, mb_model_class=<class 'oggm.core.massbalance.MonthlyTIModel'>, y0=None, halfsize=15, **kwargs)[source]#
Constant mass balance during a chosen period.
This is useful for equilibrium experiments.
IMPORTANT: the “naive” implementation requires to compute the massbalance N times for each simulation year, where N is the number of years over the climate period to average. This is very expensive, and therefore we use interpolation. This makes it unusable with MB models relying on the computational domain being always the same.
If your model requires constant domain size, conisder using RandomMassBalance instead.
Note that it uses the “correct” way to represent the average mass balance over a given period. See: https://oggm.org/2021/08/05/mean-forcing/
- Attributes
- y0int
the center year of the period
- halfsizeint
the halfsize of the period
- yearsndarray
the years of the period
- __init__(gdir, mb_model_class=<class 'oggm.core.massbalance.MonthlyTIModel'>, y0=None, halfsize=15, **kwargs)[source]#
Initialize
- Parameters
- gdirGlacierDirectory
the glacier directory
- mb_model_classMassBalanceModel class
the MassBalanceModel to use for the constant climate
- y0int, required
the year at the center of the period of interest.
- halfsizeint, optional
the half-size of the time window (window size = 2 * halfsize + 1)
- **kwargs:
keyword arguments to pass to the mb_model_class
Methods
__init__
(gdir[, mb_model_class, y0, halfsize])Initialize
get_annual_climate
(heights[, year])Average climate information at given heights.
get_annual_mb
(heights[, year, add_climate])Like self.get_monthly_mb(), but for annual MB.
get_ela
([year])Compute the equilibrium line altitude for a given year.
get_monthly_climate
(heights[, year])Average climate information at given heights.
get_monthly_mb
(heights[, year, add_climate])Monthly mass balance at given altitude(s) for a moment in time.
get_specific_mb
([heights, widths, fls, year])Specific mb for this year and a specific glacier geometry.
is_year_valid
(year)Checks if a given date year be simulated by this model.
Attributes
bias
Residual bias to apply to the original series.
interp_m
interp_yr
prcp_fac
Precipitation factor to apply to the original series.
temp_bias
Temperature bias to add to the original series.