Conversation
dhbv2 compatibility
There was a problem hiding this comment.
@quinnylee Thanks for this new feature!
Before we get this merged, could you
- add pytests to test the dhbv2 feature, including a unit test for the hargreaves function? Just some "these inputs should equal these outputs".
When you've got the command(s) for the pytests, please add them here into the workflows.
- Perhaps adding a new unit test (forcingprocessor_*) workflow document here https://github.com/CIROH-UA/forcingprocessor/tree/main/.github/workflows for testing the options for
model_typein the config. - x86 build test here
- arm build test here
-
comment on the performance at short range (18hrs), VPU scale relative to the current processing (
model_type = cfe). This is something I'd like to have in an automated workflow, but it would be nice to have some understanding of how fast new algorithms are. I'd guess dhbv2 processing is much faster due to the few output variables. -
Update the README with the new
model_typeoption.
src/forcingprocessor/processor.py
Outdated
| model_type = conf['forcing'].get("model_type","cfe") | ||
| assert model_type in ["cfe","dhbv2"], f"model_type {model_type} not supported" | ||
|
|
||
| if model_type == "cfe": |
There was a problem hiding this comment.
Can this be modified to allow for a combination of variables? For instance, if we want both cfe and dhbv2 variables in the output ngen forcings file. The motivation for this is storage/processing optimization for the nrds.
There was a problem hiding this comment.
Yes! A couple changes this will cause (writing this mostly for myself), because dhbv takes precipitation in mm/s and I don't need to be duplicating values:
- dhbv's BMI will need to read
precip_ratenotP - NGIAB data preprocessor will need to output the variable named
precip_ratenotPfor dhbv runs
| dataset = np.insert(dataset, 2, pet_array, axis=1) | ||
| return dataset | ||
|
|
||
| def get_lats(gdf_path: str) -> dict: |
There was a problem hiding this comment.
This function requires a geopackage. Until now, forcingprocessor could be run using only a weights file as input. This is a bit of a hack/short cut, but the weight generation at vpu scale is worth avoiding. I'm making this comment to reference in an issue that can be dealt with outside of this PR.
There was a problem hiding this comment.
Alternatively, if the vpu-scale weights file is a big parquet file or something, indexed by catchment, we could just store our latitudes in there
There was a problem hiding this comment.
Ya, it's just a big parquet. That's a good idea, I can work that logic out in a PR after this one.
|
Performance comparison (not on vpu scale, but on watershed scale). I can rerun on vpu scale tomorrow, just need to find or make a geopackage CFE/NOM:
dHBV2:
Also, README.md has been updated with the additional needed params |
|
Here's the performance comparison on VPU06. I'm guessing that even though dHBV has 3 variables, the procesing time is similar to CFE because of the amount of time it takes to calculate PET and latitudes. CFE:
dHBV2:
|
|
Thanks for those performance numbers @quinnylee! Looks good enough to me, I just wanted to see if the run time was of the same magnitude for processing either cfe or hbv variables. |
|
Closing so we don't duplicate variable processing for multiple models |
dHBV2 requires some custom forcings (detailed in #29 )
@leoglonz
Additions
Changes
Testing
Todos
Notes
This is a copy of PR #37 but merging from a
CIROH-UAbranch instead of my branch so the tests passChecklist
Testing checklist
Target Environment support
Other