pydeltasnow.main.swe_deltasnow¶
- pydeltasnow.main.swe_deltasnow(data, rho_max=401.2588, rho_null=81.19417, c_ov=0.0005104722, k_ov=0.37856737, k=0.02993175, tau=0.02362476, eta_null=8523356.0, hs_input_unit='m', swe_output_unit='mm', ignore_zeropadded_gaps=False, ignore_zerofollowed_gaps=False, interpolate_small_gaps=False, max_gap_length=3, interpolation_method='linear', output_series_name='swe_deltasnow')[source]¶
Calculate snow water equivalent from a snow depth timeseries with the DeltaSNOW model.
- Parameters
data (
pandas.Serieswithpandas.DatetimeIndex) – The input snow depth data. Needs to be numeric and not negative.rho_max (float, optional) – Maximum density of an individual snow layer produced by the DeltaSNOW model in [kg/m3], rho_max needs to be positive. The default is 401.2588.
rho_null (float, optional) – Fresh snow density for a newly created layer [kg/m3], rho_null needs to be positive. The default is 81.19417.
c_ov (float, optional) – Overburden factor due to fresh snow [-], c_ov needs to be positive. The default is 0.0005104722.
k_ov (float, optional) – Defines the impact of the individual layer density on the compaction due to overburden [-], k_ov needs to be in the range [0,1]. The default is 0.37856737.
k (float, optional) – Exponent of the exponential-law compaction [m3/kg], k needs to be positive. The default is 0.02993175.
tau (float, optional) – Uncertainty bound [m], tau needs to be positive. The default is 0.02362476.
eta_null (float, optional) – Effective compactive viscosity of snow for “zero-density” [Pa s]. The default is 8523356.
hs_input_unit (str in {"mm", "cm", "m"}) – The unit of the input snow depth. The default is “m”.
swe_output_unit (str in {"mm", "cm", "m"}) – The unit of the output snow water equivalent. The default is “mm”.
ignore_zeropadded_gaps (bool) – Whether to ignore gaps that have leading and trailing zeros. The resulting SWE series will contain NaNs at the same positions. These gaps are also ignored when you use ignore_zerofollowed_gaps.
ignore_zerofollowed_gaps (bool) – Less strict rule than ignore_zeropadded_gaps. Whether to ignore gaps that have trailing zeros. This can lead to sudden drops in SWE in case missing HS data is present. The resulting SWE series will contain NaNs at the same positions.
interpolate_small_gaps (bool) – Whether to interpolate small gaps in the input HS data or not. Only gaps that are surrounded by data points and have continuous date spacing between the leading and trailing data point are interpolated.
max_gap_length (int) – The maximum gap length of HS data gaps that are interpolated if interpolate_small_gaps is True.
interpolation_method (str) – Interpolation method for the small gaps which is passed to
pandas.Series.interpolate(). See its documentation for valid options. The default is ‘linear’.output_series_name (str) – The name of the resulting pd.Series. This can be useful if you want to add the resulting SWE series to an existing DataFrame and need a specific column name. The default is “swe_deltasnow”.
- Raises
ValueError – If any of the constraints on the data is violated.
- Returns
swe – Calculated SWE with the same index as the input data.
- Return type
Notes
Differences to the original R implementation within the
nixmasspackage of Winkler et al. 2021:The model accepts breaks in the date series if a break is sourrounded by zeros. Additionally, breaks in the date series can be accepted if surrounded by NaNs. See below for more information. This behaviour can be useful for measurement series that are not continued in summer.
The user can specify how to deal with missing values in a measurement series. There are three parameters that control NaN handling:
ignore_zeropadded_gapsignore_zerofollowed_gapsinterpolate_small_gaps
Note that the runtime efficiency of the model will decrease when one or several of these options are turnded on.
Accepts as input data only a
pandas.Serieswithpandas.DatetimeIndexand no dataframe.The time resolution (timestep in R implementation) will be automatically sniffed from the
pandas.DatetimeIndexof the input series.The user can specify the input and output units of the HS and SWE measurement series, respectively.
A
pandas.Serieswith the dates as pd.DatetimeIndex is returned.