BASIN-3D/basin3d

Enhanced Plugin: Add USGS Instananeous Values to the USGS Plugin

Closed this issue · 3 comments

Enhance the existing USGS plugin to return instaneous values from the USGS Instaneous Values. (See https://waterservices.usgs.gov/rest/IV-Service.html)

Terms

  • Daily Values (DV) - daily averages of measurements
  • Instananeous Values (IV) - No aggregattion. This may return high volume of data due to the frequency of the measurements.

AGGREGATION_DURATION is specified as None - this will retrieve IV from the IV Service.
AGGREGATION_DURATION is DAY - data from the DV service.

Initial tasks

  • Can we switch out the endpoint url and user the DV plugin logic as is? This will require comparing the response JSON of the two services. You could also just switch the endpoint urls and try some queries.
  • Review IV Service parameters and see if the mappings to BASIN-3D Variables are similar to DV Service. Query IV Service for the DV Service variables to see if they return values.
  • Proposal for implementation of IV service in USGS Plugin
  • Documentation should be developed and provided for the entire USGS plugin

@heycatwonton: I think this BASIN-3D query is a good one for investigating the IV service.

get_timeseries_data(synthesizer=synthesizer, monitoring_features=["USGS-09110000"], observed_property_variables=['RDC', 'WT'], start_date='2019-10-25', end_date='2019-10-28')

  • Can we switch out the endpoint url and use the DV plugin logic as is? This will require comparing the response JSON of the two services. You could also just switch the endpoint urls and try some queries.
  • Yes, we can switch out the endpoint url and use the DV plugin logic as is. Replace DV with IV
  • Review IV Service parameters and see if the mappings to BASIN-3D Variables are similar to DV Service. Query IV Service for the DV Service variables to see if they return values.
  • Mappings are the same for IV and DV service parameters. But IV service does not return values for most of the parameters.

I just noticed that

synthesizer.monitoring_features(datasource='USGS', feature_type='subbasin',
                                              monitoring_features=subbasin_id and [subbasin_id] or None)

calls the following daily values url. Should this be something general and not service specific

  1. https://waterservices.usgs.gov/nwis/dv?huc=18090208&format=json&statCd=00003

Log output

2022-05-26T08:50:20.499 INFO * basin3d.core.access USGS.MonitoringFeature - url:https://waterservices.usgs.gov/nwis/dv?huc=18090208&format=json&statCd=00003