This PR addresses the third task in issue https://github.com/USGS-R/drb-gw-hw-model-prep/issues/40, and adds one target and one function that correspond to the catchment-scale NHDv2 attributes. In this PR, we use the catchment aggregation operations (e.g. area-weighted mean; length-weighted mean, etc.) defined in 1_fetch/in/nhdv2_attributes_from_sciencebase.csv to reprocess the CAT-level NHDv2 attributes to the NHM catchment-scale.
The output of p2_nhdv2_attr_catchment is a nested list that contains two data frames for each SB dataset: 1) the reprocessed data (which has 459 rows, one for each PRMS_segid); and 2) a diagnostics table that indicates how many of the contributing NHD values were NA. We used the diagnostics tables in inland salinity and so I'm including them here as well. In the next PR, we will combine the upstream and catchment processed data into one data frame, and pull out and join the individual diagnostics tables.
Here's an example of the BASIN_CHARACTERISTICS data:
The function process_catchment_nhdv2_attr() is again taken from the inland salinity repo. I'm requesting a review to put another set of eyes on this function and make sure it suits our needs for groundwater, but suggest capping a review at ~1 hr. I'm hoping for a review by 10/3 so that we can close this issue by the time you head out for AL, but please let me know if you'll need more time.
This PR addresses the third task in issue https://github.com/USGS-R/drb-gw-hw-model-prep/issues/40, and adds one target and one function that correspond to the catchment-scale NHDv2 attributes. In this PR, we use the catchment aggregation operations (e.g. area-weighted mean; length-weighted mean, etc.) defined in
1_fetch/in/nhdv2_attributes_from_sciencebase.csv
to reprocess the CAT-level NHDv2 attributes to the NHM catchment-scale.The output of
p2_nhdv2_attr_catchment
is a nested list that contains two data frames for each SB dataset: 1) the reprocessed data (which has 459 rows, one for each PRMS_segid); and 2) a diagnostics table that indicates how many of the contributing NHD values were NA. We used the diagnostics tables in inland salinity and so I'm including them here as well. In the next PR, we will combine the upstream and catchment processed data into one data frame, and pull out and join the individual diagnostics tables.Here's an example of the
BASIN_CHARACTERISTICS
data:The function
process_catchment_nhdv2_attr()
is again taken from the inland salinity repo. I'm requesting a review to put another set of eyes on this function and make sure it suits our needs for groundwater, but suggest capping a review at ~1 hr. I'm hoping for a review by 10/3 so that we can close this issue by the time you head out for AL, but please let me know if you'll need more time.