-
Notifications
You must be signed in to change notification settings - Fork 84
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
coops_search() time_zone weirdness? #184
Comments
thanks for the issue @drf5n I'll have a look |
My workaround right now is to set the timezone to GMT, do the request, then assign GMT to the returned data:
|
one problem is that if we need to use LST, that's the local time zone of the station, but they don't give us the time zone of the station in the response. so we have to get it somehow, then i can correct the date values given back |
@drf5n do you ever use |
try again after reinstalling devtools::install_github("ropensci/rnoaa")
library(rnoaa)
ss <- coops_search(begin_date=20161210, end_date=20161210,station_name=8638610,product='water_level',datum='NAVD',time_zone='lst')
ss$data$t[2]
#> [1] "2016-12-10 00:06:00 EST"
rr <- coops_search(begin_date=20161210, end_date=20161210,station_name=8638610,product='water_level',datum='NAVD',time_zone='gmt')
rr$data$t[2]
#> [1] "2016-12-10 00:06:00 GMT" head(ss$data, n = 3)
#> t v s f q
#> 1 2016-12-10 00:00:00 -0.458 0.005 0,0,0,0 v
#> 2 2016-12-10 00:06:00 -0.453 0.005 0,0,0,0 v
#> 3 2016-12-10 00:12:00 -0.444 0.004 0,0,0,0 v
rr$data[51:53,]
#> t v s f q
#> 51 2016-12-10 05:00:00 -0.458 0.005 0,0,0,0 v
#> 52 2016-12-10 05:06:00 -0.453 0.005 0,0,0,0 v
#> 53 2016-12-10 05:12:00 -0.444 0.004 0,0,0,0 v # convert
ss$data$t <- as.POSIXlt(ss$data$t, tz = "GMT") head(ss$data, n = 3)
#> t v s f q
#> 1 2016-12-10 05:00:00 -0.458 0.005 0,0,0,0 v
#> 2 2016-12-10 05:06:00 -0.453 0.005 0,0,0,0 v
#> 3 2016-12-10 05:12:00 -0.444 0.004 0,0,0,0 v
rr$data[51:53,]
#> t v s f q
#> 51 2016-12-10 05:00:00 -0.458 0.005 0,0,0,0 v
#> 52 2016-12-10 05:06:00 -0.453 0.005 0,0,0,0 v
#> 53 2016-12-10 05:12:00 -0.444 0.004 0,0,0,0 v |
changes in ddad05b |
Re. LST_LDT, no, I try to always use UTC. This fix works for me. Thanks. |
Glad it works |
done |
These are consistent with what you see at https://tidesandcurrents.noaa.gov/waterlevels.html?id=8638610&units=metric&bdate=20161210&edate=20161210&timezone=GMT&datum=NAVD&interval=6&action=data
I would expect the resultant values to be the same if the times are the same, but the vaues differ while the time remains the same.
If I unclass the resultant time, I see that the timezone attribute exists but is not set:
Here, I'd expect the attribute to be set appropriately, as GMT, and EST or EST/EDT for the Sewells Point Virginia station.
How should one use the resultant data to get consistent times?
The text was updated successfully, but these errors were encountered: