nc.get.time.series {ncdf4.helpers} | R Documentation |
Returns time axis data as PCICt for a file
Description
Returns time axis data as PCICt for a file.
Usage
nc.get.time.series(
f,
v,
time.dim.name,
correct.for.gregorian.julian = FALSE,
return.bounds = FALSE
)
Arguments
f |
The file (an object of class |
v |
Optionally, the variable to look for a time dimension on. |
time.dim.name |
Optionally, the time dimension name. |
correct.for.gregorian.julian |
Specific workaround for Gregorian-Julian calendar transitions in non-proleptic Gregorian calendars |
return.bounds |
Whether to return the time bounds as an additional attribute |
Details
Retrieving time data from a NetCDF file in an intelligible format is a non-trivial problem. The PCICt
package solves part of this problem by allowing for 365- and 360-day calendars. This function complements it by returns time data for a file as PCICt
, doing all necessary conversions.
Value
A vector of PCICt objects, optionally with bounds
Note
If the file was opened with readunlim=FALSE
, it will read in the time values from the file; otherwise, it will retrieve the time values from the ncdf4
class' data structures.
References
http://cfconventions.org/Data/cf-conventions/cf-conventions-1.8/cf-conventions.html#time-coordinate
Examples
## Get time series from file
## Not run:
f <- nc_open("pr.nc")
ts <- nc.get.time.series(f)
nc_close(f)
## End(Not run)