getPoint {meteoForecast} | R Documentation |
NWP forecasts for a location
Description
The getPoint*
functions get outputs of the NWP models run by MeteoGalicia and NCEP (GFS, RAP, NAM) for a single location.
Usage
getPoint(point, vars = "swflx", day = Sys.Date(), run = "00",
resolution = NULL, vertical = NA, service = mfService())
getPointDays(point, vars = "swflx", start = Sys.Date(), end,
service = mfService(), ...)
getPointRuns(point, var = "swflx",
start = Sys.Date() - 1, end = Sys.Date(),
service = mfService(), ...)
Arguments
point |
Coordinates of the location. It can be a
|
var , vars |
Character. The name of the variables to retrieve. Use |
day |
Date or character |
run |
Character. The meteogalicia service executes the model at OOUTC and 12UTC. Therefore |
start |
Date or character. First day of the time period to retrieve. |
end |
Date or character. Last day of the time period to retrieve. |
resolution |
Numeric. Resolution in kilometers of the raster. Valid choices are 4, 12, and 36. It is only used with |
vertical |
Numeric. Vertical coordinate for variables with several levels. Its default value is |
service |
Character, which service to use, 'meteogalicia', 'gfs', 'nam', or 'rap'. |
... |
Additional arguments for |
Details
These functions download data from the MeteoGalicia and NCEP (GFS, RAP, NAM) servers using the NetCDF Subset Service. The result is returned as a zoo
time series object, with one or more csv files stored in the temporary folder (as defined by tempdir()
).
Value
getPoint
and getPointDays
produce a zoo
time series with a column for each variable included in vars
.
The time series returned by getPoint
starts at 01UTC of day
if run = '00'
or 13UTC if run = '12'
. It spans over 4 days (96 hours) if run = '00'
or 84 hours if run = '12'
.
The time series returned by getPointDays
starts at 01UTC of start
and finishes at 00UTC of end + 1
. Each day comprised in the time period is constructed with the forecast outputs corresponding to the 00UTC run of that day. Therefore, only the first 24 values obtained with getPoint
are used for each day.
The time series returned by getPointRuns
starts at 01UTC of start
and finishes at 00UTC of end + 1
. It has 4 columns, named "D3_00", "D2_00", "D1_00" and "D0_00". The column "D3_00" corresponds to the forecast results produced 3 days before the time stamp of each row, and so on.
Author(s)
Oscar Perpiñán Lamigueiro with contributions from Marcelo Almeida
References
https://mandeo.meteogalicia.es/thredds/catalogos/WRF_2D/catalog.html
https://mandeo.meteogalicia.es/thredds/catalog/gfs_0p25/fmrc/catalog.html
https://www.ncei.noaa.gov/thredds/catalog/model-nam218/catalog.html
https://www.ncei.noaa.gov/thredds/catalog/model-rap130/catalog.html
See Also
Examples
## Not run:
## If some of the next examples do not work, try using a different
## date. Check availability for each service with the links included in
## the references section.
testDay <- Sys.Date() - 1
## temperature (Kelvin) forecast from meteogalicia
tempK <- getPoint(c(0, 40), vars = 'temp', day = testDay)
## Cell does not coincide exactly with request
attr(tempK, 'lat')
attr(tempK, 'lon')
## Units conversion
tempC <- tempK - 273
library(lattice)
## Beware: the x-axis labels display time using your local timezone.
Sys.timezone()
## Use Sys.setenv(TZ = 'UTC') to produce graphics with the timezone
## of the objects provided by meteoForecast.
xyplot(tempC)
## Multiple variables
vars <- getPoint(c(0, 40), vars = c('swflx', 'temp'), day = testDay)
xyplot(vars)
## Vertical coordinates
tempK1000 <- getPoint(c(0,40),
vars = "Temperature_surface",
day = testDay,
service ="gfs", vertical = 1000)
## Time sequence
radDays <- getPointDays(c(0, 40),
start = testDay - 3,
end = testDay)
xyplot(radDays)
## Variability between runs
radRuns <- getPointRuns(c(0, 40),
start = testDay - 3,
end = testDay)
xyplot(radRuns, superpose = TRUE)
## variability around the average
radAv <- rowMeans(radRuns)
radVar <- sweep(radRuns, 1, radAv)
xyplot(radVar, superpose = TRUE)
## End(Not run)