From 0d1cefa95a4e92bd790977cc009990b9d2657a36 Mon Sep 17 00:00:00 2001 From: Riley Hales <39097632+rileyhales@users.noreply.github.com> Date: Mon, 22 Feb 2021 18:15:41 -0700 Subject: [PATCH] remove negatives from sim before bias correction --- tethysapp/geoglows_hydroviewer/controllers.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tethysapp/geoglows_hydroviewer/controllers.py b/tethysapp/geoglows_hydroviewer/controllers.py index 0286e2b..c6307a0 100644 --- a/tethysapp/geoglows_hydroviewer/controllers.py +++ b/tethysapp/geoglows_hydroviewer/controllers.py @@ -208,6 +208,9 @@ def get_bias_adjusted(request): # get the data you need to correct bias sim_data = gsf.historic_simulation(reach_id) forecast_stats = gsf.forecast_stats(reach_id) + + # remove negative flows from the historical simulation + sim_data[sim_data["streamflow_m^3/s"] < 0] = 0 # corrected data fixed_hist = gbc.correct_historical(sim_data, obs_data)