| DODSGrab | R Documentation |
This function interfaces with the NOMADS server to download weather, ocean, and sea ice data.
The available models can be viewed by calling NOMADSRealTimeList and NOMADSArchiveList.
The data arrives in ascii format, so this function can be used to retrieve data on any operating system.
DODSGrab(model.url, model.run, variables, time, lon, lat,
levels = NULL, ensembles = NULL, display.url = TRUE,
verbose = FALSE, request.sleep = 1)
model.url |
A model URL for a specific date, probably from |
model.run |
A specific model run to get, probably from |
variables |
A list of the data types to get. |
time |
A two component vector denoting which time indices to get. |
lon |
A two component vector denoting which longitude indices to get. |
lat |
A two component vector denoting which latitude indices to get. |
levels |
A two component vector denoting which levels to get, if applicable. |
ensembles |
A two component vector denoting which ensemble runs to get, if applicable. |
display.url |
If |
verbose |
If |
request.sleep |
If multiple requests are to be sent to the server, pause by this many seconds between them. This is courteous and also helps prevent timeouts. |
model.data |
A structure with a series of elements containing data extracted from GrADS-DODS system. |
Daniel C. Bowman danny.c.bowman@gmail.com
GetDODSDates, GetDODSModelRuns, GetDODSModelRunInfo
#An example for the Global Forecast System 0.5 degree model
#Make a world temperature map for the latest model run
## Not run:
#Figure out which model is most recent
model.urls <- GetDODSDates("gfs_0p50")
latest.model <- tail(model.urls$url, 1)
model.runs <- GetDODSModelRuns(latest.model)
latest.model.run <- tail(model.runs$model.run, 1)
#Download worldwide temperature data at 2 m
variable <- "tmp2m"
time <- c(0, 0) #Analysis run, index starts at 0
lon <- c(0, 719) #All 720 longitude points
lat <- c(0, 360) #All 361 latitude points
model.data <- DODSGrab(latest.model, latest.model.run,
variable, time, lon, lat)
#Make it into a nice array and plot it
model.grid <- ModelGrid(model.data, c(0.5, 0.5))
image(model.grid$z[1,1,,])
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.