RAnEn::ncvar_get_times is a convenient function to read Times from
a already open NetCDF file connection. It echos the API of ncdf4:ncvar_get
but it differs in that it checks for any reading imprecision and corrects
for small errors.
ncvar_get_times(
nc,
var_name,
origin = "1970-01-01",
tz = "UTC",
to_posix = T,
epsilon = 1e-05
)
An object of class ncdf4 (as returned by either function nc_open or function nc_create), indicating what file to read from.
The variable name for Times
The origin used for converting to POSIX time
The time zone
Whether to convert times to POSIX
The maximum reading error to correct. Otherwise, an error is thrown.
A vector of times