DOI-USGS / national-flow-observations

This repository pulls national flow data from NWIS
Other
4 stars 8 forks source link

Include all U.S. territories #19

Closed cnell-usgs closed 2 years ago

cnell-usgs commented 3 years ago

By looping through HUCs to find sites (https://github.com/USGS-R/national-flow-observations/blob/master/10_nwis_pull/src/inventory_nwis.R), a number of island territories are not included: Guam, Virgin Islands, American Samoa, and the Northern Marianas.

limnoliver commented 2 years ago

Julie's idea is to use a bbox on the islands to find the sites, and leave the HUC part alone.

padilla410 commented 2 years ago

List of bounding boxes (summary derived from census data) https://anthonylouisdagostino.com/bounding-boxes-for-all-us-states/

cnell-usgs commented 2 years ago

What about regions outside of CONUS? Could take official state and territory boundaries and pull the bounding box from them.

limnoliver commented 2 years ago

I think ^that's the plan. Leave the current call to HUCs alone to capture CONUS + AK + HI, but use bboxes to capture territories. Right @padilla410?

padilla410 commented 2 years ago

Yes, that's correct, Sam. This data pull and munge needs to be completed in the next two weeks or so. Because of that time constraint, I want to keep the bulk of the pipeline the same (using HUCs). The territories you listed will be added using bboxes because there are no HUCs in the territories. I added the link above so I don't go looking for it again later.

padilla410 commented 2 years ago

Method update!

the dataRetrieval functions called by the pipeline (whatNWIS, readNWISdv, readNWISuv) don't accept bounding boxes. Instead I am going to use the territory specific state codes (us_terr <- c('AS', 'GU', 'MP') ) for Guam, American Samoa, and Northern Marianas.

According to USGS doc Puerto Rico and the US Virgin Islands are both included in HUC 21:

Region 21  Caribbean Region --The drainage within: (a) the Commonwealth
           of Puerto Rico; (b) the Virgin Islands of the United States;
           and (c) other United States Caribbean outlying areas. Includes
           land areas over which the United States has some degree of
           interest, jurisdiction, or sovereignty.

That being said, I will check the output and make sure that they are there.

padilla410 commented 2 years ago

FYI, verification that PR and USVI are already in the data pull:

> nwis_dv_inventory <- readRDS('10_nwis_pull/inout/nwis_dv_inventory.rds')
> 
> nwis_dv_inventory %>% 
+   arrange(desc(site_no)) %>% 
+   head(20) %>% 
+   select(agency_cd, site_no, station_nm)
       agency_cd  site_no                                         station_nm
29736       USGS 50348000               SALT RIVER AT CANNAN, ST. CROIX USVI
29733       USGS 50345000       JOLLY HILL GUT AT JOLLY HILL, ST. CROIX USVI
29729       USGS 50334500   BETHLEHEM GUT AT HWY 66 AT FAIRPLAINS, ST. CROIX
29726       USGS 50333500          RIVER GUT NR GOLDEN GROVE, ST. CROIX USVI
29722       USGS 50332000                 RIVER GUT AT RIVER, ST. CROIX USVI
29720       USGS 50295500            CRUZ BAY GUT AT CRUZ BAY, ST. JOHN USVI
29717       USGS 50295000              GUINEA GUT AT BETHANY, ST. JOHN, USVI
29711       USGS 50294000            FISH BAY GUT AT FISH BAY, ST. JOHN USVI
29706       USGS 50292600   LAMESHUR BAY GUT AT LAMESHUR BAY, ST. JOHN  USVI
296851      USGS 50276000       TURPENTINE RUN AT MARIENDAL, ST. THOMAS USVI
29645       USGS 50274000        TURPENTINE RUN AT MT. ZION, ST. THOMAS USVI
29641       USGS 50252000 BONNE RESOLUTION GUT AT BONNE RESOLUTION ST THOMAS
29638       USGS 50233000  QUEBRADA PILON AT COLONIA PUERTO REAL, VIEQUES PR
29636       USGS 50232000      QUEBRADA LA MINA NR LA ESPERANZA, VIEQUES, PR
29634       USGS 50231000 QDA COFRESI TRIBUTARY NR ISABEL SEGUNDA VIEQUES PR
296321      USGS 50215000     DRAINGAGE CANAL AT CULEBRA AIRPORT, CULEBRA PR
29231       USGS 50148890  RIO CULEBRINAS AT MARGARITA DAMSITE NR AGUADA, PR
28988       USGS 50147800              RIO CULEBRINAS AT HWY 404 NR MOCA, PR
27954       USGS 50145395                   RIO CASEI ABV HACIENDA CASEI, PR
27878       USGS 50145000              RIO GRANDE DE ANASCO AT EL ESPINO, PR