# NOT RUN {
#avialable latitudes and longitudes
gefs_latitudes()
gefs_longitudes()
#get a list of all gefs variables
gefs_variables()
#All GEFS dimensions
gefs_dimensions()
#values for a specific dimension
gefs_dimension_values("height_above_ground")
#example location.
lat <- 46.28125
lon <- -118.2188
#Get forecast for a certain variable.
forecast <- gefs("Total_precipitation_surface_6_Hour_Accumulation_ens",
lat, lon)
#Fetch a different date (available up to 10 days prior to today)
forecast_yesterday_prec <- gefs(
"Total_precipitation_surface_6_Hour_Accumulation_ens",
lat, lon, date=format(as.Date(Sys.time()) - 1, "%Y%m%d"))
#specific ensemble and times, for the 1800 forecast.
# here ensembles 1-3 (ensembles are numbered starting with 0)
# and time for 2 days from today at 1800
date <- format(as.Date(Sys.time()) - 1, "%Y%m%d")
var <- "Temperature_height_above_ground_ens"
gefs(var, lat, lon, date = date, forecast_time = "1800", ens_idx=2:4,
time_idx=1:8)
#One ensemble, all latitudes and longitudes (this is a big file) for the
# next 3 days.
# gefs(var, ens=1, time=1:12)
# }
# NOT RUN {
# }
Run the code above in your browser using DataLab