From e2b9ad10a524ea4408aef10f9c4f8cd602e7d336 Mon Sep 17 00:00:00 2001 From: Darren Boss Date: Wed, 4 Dec 2024 08:57:03 -0800 Subject: [PATCH] Fix rh over 100 --- api/app/sfms/fwi_processor.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/api/app/sfms/fwi_processor.py b/api/app/sfms/fwi_processor.py index 5255fca75..0d1ff459e 100644 --- a/api/app/sfms/fwi_processor.py +++ b/api/app/sfms/fwi_processor.py @@ -65,6 +65,10 @@ def calculate_ffmc(previous_ffmc_ds: WPSDataset, temp_ds: WPSDataset, rh_ds: WPS precip_array, _ = precip_ds.replace_nodata_with(0) wind_speed_array, _ = wind_speed_ds.replace_nodata_with(0) + # Due to warping of the rh dataset, rh values can exceed 100 which breaks the ffmc calculation. + # Set rh values greater than 100 to the max allowable which is 100. + rh_array[rh_array > 100] = 100 + start = perf_counter() ffmc_values = vectorized_ffmc(previous_ffmc_array, temp_array, rh_array, wind_speed_array, precip_array) logger.info("%f seconds to calculate vectorized ffmc", perf_counter() - start)