USGS-R / drb-gw-hw-model-prep

Code repo to prepare groundwater and headwater-related datasets for modeling river temperature in the Delaware River Basin
Other
0 stars 3 forks source link

Combine met driver data with NHDv2-scale attributes #17

Closed lekoenig closed 2 years ago

lekoenig commented 2 years ago

Combine meteorological driver data aggregated at the NHDv2-scale with the segment/catchment attributes in p2_input_drivers_nhd.

lekoenig commented 2 years ago

We currently estimate mean width and other NHD-scale input drivers for the "mainstem" reaches represented by the COMIDs in p1_nhd_reaches_along_NHM. Within the 3,229 COMIDs in p1_nhd_reaches_along_NHM there are 47 flowline reaches without catchments (i.e., AREASQKM = 0) and so they do not have meteorological data.

Usually these reaches with AREASQKM = 0 represent little extensions, artificial paths, or NHD artifacts. I'd suggest we omit these reaches since they don't have met data. It looks like there are 5 sites that got snapped to these zero-area reaches, so I'll have to check the impact of excluding those reaches.

> tar_load(p1_nhd_reaches_along_NHM)
> tar_load(p2_drb_temp_sites_w_segs)
> comids_not_in_climate <- p1_nhd_reaches_along_NHM %>% filter(areasqkm == 0) %>% pull(comid)
> p2_drb_temp_sites_w_segs %>% filter(comid %in% comids_not_in_climate)
# A tibble: 5 x 4
  site_id                           comid fish_dist_to_outlet_m bird_dist_to_subseg_m
  <chr>                             <int>                 <dbl>                 <dbl>
1 11NPSWRD_WQX-ERMN_DEWA_BMI_3030 2585051                 -861.                 41.9 
2 11NPSWRD_WQX-MIDN_VAFO_03F      4782567                    0                   5.21
3 USGS-01436000                   4148042                    0                  58.3 
4 USGS-414858074375901            4148042                 -556.                  3.90
5 USGS_Leetown-SP8                2585051                 -126.                 52.2 
> 
lekoenig commented 2 years ago

I took a closer look at these sites that were originally matched to zero-area reaches. I don't see an issue with omitting zero-area reaches from p1_nhd_reaches_along_NHM. In all cases above, the new site matches after omitting zero-area reaches seemed equally plausible. Here's an example of USGS_Leetown-SP8, with the original site match (top) and the site match if we omit zero-area reaches:

old_match

new_match