Closed aspaetzel closed 3 years ago
Composite samples are definitely problematic. I had to put in a special set of rules awhile back: https://github.com/USGS-R/dataRetrieval/blob/master/R/importRDB1.r#L218
It's especially hard with mixes of composite and not composite because of the way they are reported. I'll go see if I can retain the reported USGS words without screwing up any actual times.
Here's the results from the latest PR. I'm still exploring if there are other composite issues that I don't test:
x<- readNWISqw("01115114","00666","2010-10-01","2020-09-30",expanded = TRUE, reshape = FALSE, tz = "America/Jamaica")
> tail(x[,c("sample_dt", "sample_tm", "sample_end_dt", "sample_start_time_datum_cd_reported", "startDateTime","sample_start_time_datum_cd", "endDateTime")])
sample_dt sample_tm sample_end_dt sample_start_time_datum_cd_reported
75 2019-07-10 11:30 <NA> EDT
76 2019-07-22 11:30 <NA> EDT
77 2019-07-22 21:21 2019-07-24 EDT
78 2019-08-27 10:00 <NA> EDT
79 2019-09-24 04:51 2019-09-25 EDT
80 2019-09-26 12:00 <NA> EDT
startDateTime sample_start_time_datum_cd endDateTime
75 2019-07-10 10:30:00 America/Jamaica <NA>
76 2019-07-22 10:30:00 America/Jamaica <NA>
77 2019-07-22 20:21:00 America/Jamaica 2019-07-24 12:11:00
78 2019-08-27 09:00:00 America/Jamaica <NA>
79 2019-09-24 03:51:00 America/Jamaica 2019-09-25 00:48:00
80 2019-09-26 11:00:00 America/Jamaica <NA>
@aspaetzel could you install dataRetrieval like this:
remotes::install_github("USGS-R/dataRetrieval")
and let me know if your composite samples look OK? I changed the code again...I think making it even more simple, but it would be great to get your eyes on it too.
Yes, working perfectly now! Thank you SO much!
Awesome, thanks for checking.
Does dataRetrieval 2.7.6.9001 readNWISqw tz work with sites and pcodes with composite samples?
Expected behavior sample_start_time_datum_cd_reported should be EST/EDT sample_start_time_datum_cd should be America/Jamaica
If you change the code above to ask for pcode 00940, then it works. None of the chloride samples are composites.
The time conversions are correct, but the reported time zone is incorrect.