-
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
Add functions to access GEFS ensemble forecasts. #106
Conversation
* Add R/gefs.R containing functionality to access GEFS forecasts and several helper functions. * Add tests/testthat/test-gefs.R to test new gefs functions. * modify package files: * DESCRIPTION now includes ncdf4 package in suggests, * NAMESPACE exports gefs function, * rnoaa-package.r updated to include reference to ncdf4
@potterzot Thanks for this! A few thoughts:
you can make commits and push to this same PR, changes will be added here |
@@ -33,10 +33,11 @@ Imports: | |||
scales, | |||
rgdal, | |||
XML, | |||
jsonlite | |||
jsonlite, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove trailing comma
Changes include: * switch from ncdf4 to ncdf * add function check for ncdf (from bouy.R) * generate documentation and namespace exports for gefs functions * roll back rnoaa-package doc to remove ncdf4 references * include link to gefs web page in documentation * include skip_on_cran() where tests make a web api call * minor fixes (trailing commas, etc...)
@sckott Thanks for your comments. Update should address all of these. Switched over to ncdf, etc... Two commits, the second to call ncdf functions like |
@potterzot thanks!
Yep, that's what I do https://github.com/ropensci/rnoaa/blob/master/R/buoy.R#L127 |
#' # here ensembles 1-3 (ensembles are numbered starting with 0) | ||
#' # and time for 2 days from today at 1800 | ||
#' var = "Temperature_height_above_ground_ens" | ||
#' gefs(var, lat, lon, forecast_time = "1800", ens_idx=2:4, time_idx=1:8) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@potterzot This eg doesn't work for me, thoughts?
gefs(var, lat, lon, forecast_time = "1800", ens_idx=2:4, time_idx=1:8)
#> Error in R_nc_open: NetCDF: Can't read file
#> Error in ncdf::open.ncdf(gefs_url) :
#> Error in open.ncdf trying to open file #> http://motherlode.ucar.edu/thredds/dodsC/grib/NCEP/GEFS/Global_1p0deg_Ensemble/members/GEFS_Global_1p0deg_Ensemble_20150909_1800.grib2
i think that URL doesn't exist, perhaps the URL is not being built correctly?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, yes, It's not yet 1800 UTC so it fails. I will rewrite to add a date that is the previous day so that it will work regardless of the hour that someone runs it.
If you try `forecast_time = "0600" for ex., it should work. Will push an update in a sec.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
great, thanks, guess I should have caught that
Add date for previous day so that the example may be run at any time. Previously the example could give an error if the 1800UTC forecast link was not up yet.
thanks, this is awesome @potterzot |
Add functions to access GEFS ensemble forecasts.
Awesome! I'd like to add acknowledgement for a professor that wrote some python code I had pushed a change to gefs.R, but I think I pushed it to my fork's #' @references Data description: \url{ Nicholas Potter On Thu, Sep 10, 2015 at 10:34 AM, Scott Chamberlain <
|
Yes, we can add that. If okay with you, i made a bit.ly link out of that GEFS reference link as its longer than 100 characters, and CRAN check doesn't like that. The link: http://bit.ly/noaagefs |
Sounds great. Thanks for your help! |
Hello,
This is my first pull request so I hope I am doing this correctly. Please let me know if I need to change something. I've tried to create the new files in the same format and style as existing rnoaa code. Here's the commit message:
Add functions to access GEFS ensemble forecasts.
several helper functions.