Skip to content

Commit

Permalink
Fix rh over 100
Browse files Browse the repository at this point in the history
  • Loading branch information
dgboss committed Dec 4, 2024
1 parent c1b74d7 commit e2b9ad1
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions api/app/sfms/fwi_processor.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit e2b9ad1

Please sign in to comment.