DOI-USGS / dataRetrieval

This R package is designed to obtain USGS or EPA water quality sample data, streamflow data, and metadata directly from web services.
https://doi-usgs.github.io/dataRetrieval/
Other
259 stars 84 forks source link

Why do records retrieved from dataRetrieval differ from those available online at USGS.gov? #586

Closed mb451 closed 2 years ago

mb451 commented 2 years ago

What is your question? Why do records retrieved from dataRetrieval differ from those available online at USGS.gov?

To Reproduce If possible, narrow down the question to a dataRetrieval query:

The following queries produce temperature records 130 rows long spanning 1968-10-04 to 1972-06-15.

readWQPqw("USGS-03012550", "00010") 
readNWISqw("03012550", "00010") 

However, the same query conducted at https://nwis.waterdata.usgs.gov produces a much more recent and longer temperature record. I assume, perhaps incorrectly, that these two data streams should be the same.

Does anyone have any insight?

Session Info R version 4.0.4 (2021-02-15) Platform: x86_64-apple-darwin17.0 (64-bit) Running under: macOS Big Sur 10.16

Matrix products: default LAPACK: /Library/Frameworks/R.framework/Versions/4.0/Resources/lib/libRlapack.dylib

ldecicco-USGS commented 2 years ago

The modern temperature data for that site is in the "uv" or "dv" services. That means the modern data comes from a sensor - the "uv" data is the instantaneous sensor readings, the "dv" is usually daily mean (although I think with temperature they also have daily min/max). You can figure out what service to use like this:

x <- whatNWISdata(siteNumber = "03012550", parameterCd = "00010")

Then, to get the data:

dv <- readNWISdv("03012550", parameterCd = "00010")
uv <- readNWISuv("03012550", parameterCd = "00010")

The data from the "qw" service or WQP is discrete measurements (so back in the 60s-70s, someone went out there to take a measurement)