create_netcdf_time_axis: Create a time axis unit known to work for netCDF

View source: R/time_dimensions.R

create_netcdf_time_axisR Documentation

Create a time axis unit known to work for netCDF

Description

Create a time axis unit known to work for netCDF

Usage

create_netcdf_time_axis(d, time_step = "hours since", tzoffset)

Arguments

d

an object coercible to a POSIXct

time_step

the character prefix to put before the date, in the netCDF time axis unit definition.

tzoffset

an optional character, the time offset from UTC, e.g. '+1000' for 10 hours ahead of UTC. Can be missing, in which case it must be explicitly a UTC time. Note that the tzoffset completely supersedes the time zone if present.

Value

a character, the axis units to use for the netCDF 'time' dimension

Examples

start_time <- ISOdate(year=2010, month=08, day=01, hour = 12, min = 0, sec = 0, tz = 'UTC')
create_netcdf_time_axis(d=start_time)
start_time <- ISOdate(year=2015, month=10, day=04, hour = 01, 
  min = 0, sec = 0, tz = 'Australia/Sydney')
create_netcdf_time_axis(d=start_time, tzoffset='+1000')


jmp75/efts documentation built on Sept. 3, 2024, 7:13 a.m.