Compute fireIndex in API hourly/currently pipelines and remove runtime NBM_Fire dependency#643
Conversation
fireIndex in API hourly pipeline and remove runtime NBM_Fire dependency
|
@copilot This works but we also need to calculate it for the currently block. It only covers the hourly block at the moment and the currently block is -999. |
Implemented in |
fireIndex in API hourly pipeline and remove runtime NBM_Fire dependencyfireIndex in API hourly/currently pipelines and remove runtime NBM_Fire dependency
|
@alexander0042 I think this should be good to merge if you want to do a quick check through. |
|
@copilot Can we make sure the function has a proper Google style docstring + comments where needed. It should also probably be in a shared file rather than in the hourly block? |
… Google-style docstring
Done in the latest commit. |
|
It runs fine, which is a great start. I'm seeing somewhat different values, which isn't a showstopper, but I just want to quickly double check the math |
|
I'm seeing some different values compared to prod; however, it's because of a change in the inputs. When I set everything to only use NBM it works out to almost the same, which is exactly the check I wanted to see! LGTM |
|
Sounds good. Should probably update the development docs to reflect this change so we don't need to do it later |
I'm on it! This is my continued attempt to be both more prompt with some things and realistic about timelines with others |
|
Ideally we should be updating the changelog/documentation as we go so we don't need to update everything at once when a new version comes out. I know I'm pretty bad at remembering to update it for changes but will try to remember going forward. |
fireIndexwas returning-999outside NBM Fire coverage or when NBM Fire was excluded. This change computes Fosberg Fire Weather Index directly from interpolated forecast variables so fire index is available wherever core inputs exist in both hourly and currently blocks.Hourly fire index derivation
calculate_fosberg_fire_index(...)inAPI/hourly/block.py.temp(°C),humidity(fraction), andwind(m/s), with SI→US unit conversion and existingCLIP_FIREbounds._calculate_derived_metrics(...)soInterPhour[:, DATA_HOURLY["fire"]]is API-derived rather than source-passed.Currently fire index derivation
API/current/metrics.pyto derive currentfireIndexfrom currenttemp,humidity, andwindusingcalculate_fosberg_fire_index(...).NBM_Fire_Merged/NBM_FIRE_INDEXso currently no longer returns-999solely due to missing NBM Fire coverage.Remove NBM Fire from hourly data wiring
API/data_inputs.py, removedNBM_FIRE_INDEXusage for hourly fire input assembly.fire_inputsnow remains a neutral placeholder (NaNcolumn), allowing derived fire computation to fully own the field.Stop reading
NBM_Firein request pathAPI/request/grid_indexing.py, removed theNBM_Firezarr read task and associated runtime freshness handling.dataOut_nbmFireremainsFalse, preventing NBM Fire from re-entering source selection.Focused test coverage
tests/test_hourly_refactor.pyvalidating Fosberg index calculation from SI inputs.tests/test_current_refactor.pyvalidating derived currently fire index and missing-input behavior.