Commit a0274adb authored by Cynthia Crowley's avatar Cynthia Crowley

Compute fit and 1-mo anomaly for snowpack

parent 941f876e
Pipeline #74023097 failed with stages
in 22 minutes and 38 seconds
......@@ -371,6 +371,13 @@ def fit_var(config: ConfigBase,
assert basis is None
infile = config.workspace().forcing(yearmon=input_range, window=window)
elif param in config.state_rp_vars():
assert window == 1
assert basis is None
infile = config.workspace().state(yearmon=input_range)
else:
infile = config.workspace().results(yearmon=input_range, window=window, basis=basis)
......
......@@ -169,8 +169,8 @@ class ConfigBase(metaclass=abc.ABCMeta):
assert False
@classmethod
def state_vars(*, basis: Optional[Basis]=None) -> List[str]:
@staticmethod
def state_rp_vars(*, basis: Optional[Basis]=None) -> List[str]:
"""
Provides a list of state variables for which return periods should be calculated
"""
......@@ -178,11 +178,8 @@ class ConfigBase(metaclass=abc.ABCMeta):
if not basis:
return['Snowpack']
if basis==Basis.BASIN:
return['Bt_RO']
assert False
if basis == Basis.BASIN:
return []
@classmethod
def lsm_integrated_vars(cls, basis: Optional[Basis]=None) -> Dict[str, List[str]]:
......
......@@ -66,7 +66,7 @@ def spinup(config, meta_steps):
# Compute monthly fits (and then anomalies) over the fit period
for param in config.lsm_rp_vars() + config.forcing_rp_vars():
for param in config.lsm_rp_vars() + config.forcing_rp_vars() + config.state_rp_vars():
for month in all_months:
steps += all_fits.require(fit_var(config, param=param, month=month))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment