UW-Hydro / bmorph

Bias correction for streamflow time series
MIT License
13 stars 13 forks source link

Automate creation of topology files with scaled areas for re-routing corrected flows #54

Open arbennett opened 3 years ago

arbennett commented 3 years ago

In the current workflows I've created these manually to do the rerouting of flows like so:

yakima_topo_scaled = yakima_topo.copy(deep=True)
yakima_topo_scaled['Contrib_Area'] = yakima_topo_scaled['Length'].copy()
yakima_topo_scaled['Contrib_Area'].values[:] = SEC_PER_YEAR * M_PER_KM
yakima_topo_scaled.to_netcdf('../topologies/yakima_topo_scaled_area.nc')

Ideally this should be done behind the scenes since it's always this format (up to a constant for different time steps).

arbennett commented 3 years ago

Then, once there's a scale_topology_file or whatever function it should get called in the SCBC workflow right after this line: https://github.com/UW-Hydro/bmorph/blob/develop/bmorph/core/workflows.py#L677