get.datetime.seq {M3}R Documentation

Read in a sequence of date-time steps from a Models3-formatted file.

Description

Read the date-time steps in the Models3-formatted file. Put these into R's datetime format.

Usage

get.datetime.seq(file)

Arguments

file

File name of Models3-formatted file which contains the date-time information of interest.

Details

This function relies on the R package ncdf4 to read information from Models3-formatted files, since the Models3 format is built on netCDF
(https://www.unidata.ucar.edu/software/netcdf/).

Value

Vector of sequence of datetimes included in the Models3-formatted file, in POSIXct format.

Warning

This code assumes that the time step is not negative. For instance, the Models3 I/OAPI does allow for negative time steps, but these negative time steps will NOT be handled properly by this function. For more information about Models3 date-time conventions, see
https://www.cmascenter.org/ioapi/documentation/all_versions/html/DATETIME.html.

Note

This function is called by function get.M3.var, but it will probably not be called by most users.

Author(s)

Jenise Swall

References

Information about the Models3 date-time conventions is available at
https://www.cmascenter.org/ioapi/documentation/all_versions/html/DATETIME.html.

See Also

DateTimeClasses, seq.POSIXt, get.M3.var

Examples

## As mentioned in notes above, user will not typically call
## this function directly.

## Find the path to a demo file with lambert conic conformal projection.
lcc.file <- system.file("extdata/ozone_lcc.ncf", package="M3")

## Get vector containing date-times available in this file.
datetime.seq <- get.datetime.seq(lcc.file)

[Package M3 version 0.4 Index]