View source: R/ERAgetNearestTimeseries.R
ERAgetNearestTimeseries | R Documentation |
Reads a NetCDF file containing ERA reanalysis data and extracts the timeseries of the specified variable. Some of the the commonly-used variables are:
Parameter | Units | Variable |
10 m eastward wind component | m/s | u10 |
10 m northward wind component | m/s | v10 |
2 metre temperature | K | t2m |
2 metre dewpoint | K | d2m |
Downward surface solar radiation* | J/m^2 | ssrd |
Downward surface thermal radiation* | J/m^2 | strd |
Surface net solar radiation* | J/m^2 | ssr |
Surface net thermal radiation* | J/m^2 | str |
Total precipitation* | m of water | tp |
Parameters marked with an asterisk are cumulative values, and must be deaccumulated using the deaccumERA function.
ERAgetNearestTimeseries( ncdfFile, varName, pointLon, pointLat, projection = "+proj=utm +zone=13 +ellps=WGS84", timezone = "", quiet = TRUE, logfile = "" )
ncdfFile |
Required. Name of the NetCDF file containing ERA data. |
varName |
Required. Name of the NetCDF variable to extract. |
pointLon |
Required. Decimal longitude of desired location. Note that the NetCDF longitude is 0-360, so add 360 to negative longitudes. |
pointLat |
Required. Decimal latitude of desired location. |
projection |
Optional. Projection to be used to convert latitudes and longitudes to locations. Used for finding the nearest ERA gridpoint. The default, +proj=utm +zone=13 +ellps=WGS84, is only valid for Western Canada. If you are processing data for the whole world, you can use the August Epicycloidal Projection which is +proj=august +lon_0=90w . |
timezone |
Required. The name of the timezone of the data as a character string. This should be the timezone of your data, but omitting daylight savings time. Note that the timezone code is specific to your OS. To avoid problems, you should use a timezone without daylight savings time. Under Linux, you can use CST and MST for Central Standard or Mountain Standard time, respectively. Under Windows or OSX, you can use etc/GMT+6 or etc/GMT+7 for Central Standard and Mountain Standard time. DO NOT use America/Regina as the time zone, as it includes historical changes between standard and daylight savings time. |
quiet |
Optional. Suppresses display of messages, except for errors. If you are calling this function in an R script, you will usually leave |
logfile |
Optional. Name of the file to be used for logging the action. Normally not used. |
If unsuccessful, returns FALSE
. If successful, returns a standard CRHMr dataframe containing the datetime and the extracted data, which are unpacked (i.e. the NetCDF multiplier and offset have been applied).
Kevin Shook
ERAdeaccum
## Not run: ssrd <- ERAgetNearestTimeseries('ssrd.nc', 'ssrd', 243.5, 51.69, timezone='Etc/GMT+7') t2m <- ERAgetNearestTimeseries('t2m.nc', 't2m', 243.5, 51.69, timezone='Etc/GMT+7') tp <- ERAgetNearestTimeseries('tp.nc', 'tp', 243.5, 51.69, timezone='Etc/GMT+7') strd <- ERAgetNearestTimeseries('strd.nc', 'strd', 243.5, 51.69, timezone='Etc/GMT+7') u10 <- ERAgetNearestTimeseries('u10v10.nc', 'u10', 243.5, 51.69, timezone='Etc/GMT+7') v10 <- ERAgetNearestTimeseries('u10v10.nc', 'v10', 243.5, 51.69, timezone='Etc/GMT+7') d2m <- ERAgetNearestTimeseries('d2m.nc', 'd2m', 243.5, 51.69, timezone='Etc/GMT+7') ## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.