Skip to content

Adjust runoff function to filter to complete records and handle a dataframe rather than a dictionary

Hinman, Elise D requested to merge runoff-updates into main

This MR changes how the runoff function works with runoff data. It now expects a dataframe, rather than a dictionary, and it determines which basins have complete records before selecting representative basins and calculating runoff. Because we are working with complete datetime records, we no longer need to mask the dataframe before calculating weighted runoff averages. This MR also ensures that when max weights are used to select a representative basin, that only ONE basin is selected (even if there are two or more with equal weights). Currently, that one basin is selected at random.

Finally, this MR updates the testing scheme for runoff.

To test this function, install this branch locally in your environment, and then use this branch of the hyswap example notebooks repo: Files · runoff-calcs-nb · Water / Computational Tools / Surface Water Work / hyswap-example-notebooks · GitLab (usgs.gov), which contains the jupyter notebook and the intersection dataset.

Edited by Hinman, Elise D

Merge request reports