Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: change var name of pev to evspsblpot in forcing file fixes #11 #12

Merged
merged 3 commits into from
Feb 18, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions book/2_modelling_advanced_ewatercycle/hbv_bmi.py
Original file line number Diff line number Diff line change
@@ -38,7 +38,7 @@ def initialize(self, config_file: str) -> None:
Requires atleast:
---------------------
'precipitation_file': xarray with "pr" variable & time component
'potential_evaporation_file': xarray with "pev" variable of same nature as pr
'potential_evaporation_file': xarray with "evspsblpot" variable of same nature as pr
'parameters': list of 8 parameters by a ','
'initial_storage' list of 4 storage parameters split by a ','

@@ -50,7 +50,7 @@ def initialize(self, config_file: str) -> None:
self.P = load_var(self.config["precipitation_file"], "pr")

# add Tas, Tmin and Tmax support for snow component ??!
self.EP = load_var(self.config["potential_evaporation_file"], "pev")
self.EP = load_var(self.config["potential_evaporation_file"], "evspsblpot")

# set up times
self.Ts = self.P['time'].astype("datetime64[s]")
@@ -498,5 +498,5 @@ def load_var(ncfile: str | Path, varname: str) -> xr.DataArray:
if "units" in data[varname].attrs:
if data[varname].attrs['units'] == 'kg m-2 s-1':
data[varname] = data[varname] * 24 * 3600 #mm/day
#data[varname].attrs['units'] = 'mm d-1' TODO, fix.
return data[varname]
data[varname].attrs["units"] = "mm d-1"
return data[varname]