Closed tphilippi closed 5 years ago
Title should probably change to reflect DST spring-forward connection.
want me to change the title?
Please do. If there is a way for me to change it, I don't know what it is. I've also tried time_zone = "GMT" instead of lower case, but that didn't help.
I might be able to get to this next week if you haven't figured out the problem before then.
tell me what title you want and i'll put it in, though i think you should be able to hit the Edit button above and do it (if you open an issue you should have abilitty to change tht title)
thanks, having a look soon
@tphilippi sorry about delay on this:
noaa_compact()
is defined as function(l) Filter(Negate(is.null), l)
- it's only used to filter out empty/zero length arguments given by the user. So it shouldn't affect the actual inputs themselves.
these don't seem to be a problem anymore - i can't replicate the issue.
your 1st eg returns no data
chunk_temp <- coops_search(begin_date = 20170313,
end_date = 20170313,
station_name = '9410230',
product = 'water_temperature',
datum = 'MLLW',
units = 'metric', time_zone = 'gmt',
application = 'NPS-I&M')$data
your 2nd example returns times with the dates
head(coops_search(begin_date = 20170312,
end_date = 20170312,
station_name = '9410230',
product = 'water_level',
datum = 'MLLW',
units = 'metric', time_zone = 'gmt',
application = 'NPS-I&M')$data)
#> t v s f q
#> 1 2017-03-12 00:00:00 0.058 0.069 0,0,0,0 v
#> 2 2017-03-12 00:06:00 0.079 0.089 0,0,0,0 v
#> 3 2017-03-12 00:12:00 0.112 0.069 0,0,0,0 v
#> 4 2017-03-12 00:18:00 0.145 0.075 0,0,0,0 v
#> 5 2017-03-12 00:24:00 0.163 0.074 0,0,0,0 v
#> 6 2017-03-12 00:30:00 0.198 0.075 0,0,0,0 v
as does the 3rd example.
closing - @tphilippi reopen if this is still an issue
Title should probably change to reflect DST spring-forward connection.
The CRAN version of coops_search() returns a data.frame with only dates, not dates & times, for requests to the NOAA Tides & Currents API that include 20170312 for station 9410230 (La Jolla CA SIO Pier). The same issue happens with 20160313 (last year's spring forward date). Compare (works):
To (no times returned):
In the second result, t has only date components, not times. Requests for multiple days of data are missing times for all days if 2017-03-12 is included in the interval requested. The same behavior occurs for station 9410170, and for all 6 stations (CA & FL) that I checked.
Hypothesis 1: Note that local time at these stations went to DST early the morning of 2017-03-12, but the calls are in 'gmt' to avoid that issue. Is there something in noaa_compact() that can be tripped up by DST even using gmt? The same dropped times occurs for 2016 spring forward 2016-03-13:
Times come through fine for fall back 2016-11-06 (not shown).
Hypothesis 2: Perhaps the API is returning a non-printing character somewhere in the date, and a call to as.POSIXct() in noaa_compact() sees that character and doesn't parse the time components. [This is less likely now that I've tested multiple sites, and found the same behavior for 2016-03-13.] When I compose the url for data in .csv format I get data that reads fine in R:
I can't do much more on this for another week or 2.
I haven't figured out where noaa_compact() is, and more critically, I can't manually test the NOAA API with json & xml results directly into R from work, as our firewall mangles certificates.