This class represents a time axis. The functionality is provided
by the CFTime class in the CFtime package.
Super classes
ncdfCF::CFObject -> ncdfCF::CFData -> ncdfCF::CFAxis -> CFAxisTime
Active bindings
friendlyClassName(read-only) A nice description of the class.
time(read-only) Retrieve the
CFTimeinstance that manages the values of this axis.dimnames(read-only) The coordinates of the axis as a character vector.
Methods
Inherited methods
ncdfCF::CFObject$append_attribute()ncdfCF::CFObject$attribute()ncdfCF::CFObject$attributes_identical()ncdfCF::CFObject$delete_attribute()ncdfCF::CFObject$print_attributes()ncdfCF::CFObject$set_attribute()ncdfCF::CFObject$write_attributes()ncdfCF::CFData$dim()ncdfCF::CFAxis$attach_to_group()ncdfCF::CFAxis$can_append()ncdfCF::CFAxis$configure_terms()ncdfCF::CFAxis$copy_terms()ncdfCF::CFAxis$detach()ncdfCF::CFAxis$peek()ncdfCF::CFAxis$shard()
Method new()
Create a new instance of this class, including its boundary
values. A CFTime or CFClimatology instance will also be created to
manage the time magic.
Creating a new time axis is more easily done with the makeTimeAxis()
function.
Usage
CFAxisTime$new(
var,
group,
values,
start = 1L,
count = NA,
attributes = data.frame()
)Arguments
varThe name of the axis when creating a new axis. When reading an axis from file, the NCVariable object that describes this instance.
groupThe CFGroup that this instance will live in.
valuesEither the numeric values of this axis, in which case argument
varmust be aNCVariable, or an instance ofCFTimeorCFClimatologywith bounds set, and then argumentvarmust be a name for the axis.startOptional. Integer index where to start reading axis data from file. The index may be
NAto start reading data from the start.countOptional. Number of elements to read from file. This may be
NAto read to the end of the data.attributesOptional. A
data.framewith the attributes of the axis. When an emptydata.frame(default) and argumentvaris an NCVariable instance, attributes of the axis will be taken from the netCDF resource.
Method print()
Summary of the time axis printed to the console.
Method identical()
Tests if the axis passed to this method is identical to
self.
Method copy()
Create a copy of this axis. The copy is completely separate
from self, meaning that both self and all of its components are made
from new instances.
Arguments
nameThe name for the new axis. If an empty string is passed, will use the name of this axis.
groupThe CFGroup where the copy of this axis will live.
Method copy_with_values()
Create a copy of this axis but using the supplied values. The attributes are copied to the new axis. Boundary values and auxiliary coordinates are not copied.
After this operation the attributes of the newly created axes may not be accurate, except for the "actual_range" attribute. The calling code should set, modify or delete attributes as appropriate.
Arguments
nameThe name for the new axis. If an empty string is passed, will use the name of this axis.
groupThe CFGroup where the copy of this axis will live.
valuesThe values to the used with the copy of this axis. This can be a
CFTimeinstance, a vector of numeric values, a vector of character timestamps in ISO8601 or UDUNITS format, or a vector ofPOSIXctorDatevalues. If not aCFTimeinstance, thevalueswill be converted into aCFTimeinstance using the definition and calendar of this axis.
Method append()
Append a vector of time values at the end of the current values of the axis.
Arguments
fromAn instance of
CFAxisTimewhose values to append to the values of this axis.groupThe CFGroup where the copy of this axis will live.
Method indexOf()
Retrieve the indices of supplied values on the time axis.
Method slice()
Retrieve the indices of the time axis falling between two extreme values.
Method subset()
Return an axis spanning a smaller coordinate range. This
method returns an axis which spans the range of indices given by the
rng argument.
Arguments
nameThe name for the new axis. If an empty string is passed (default), will use the name of this axis.
groupThe CFGroup where the copy of this axis will live.
rngThe range of indices whose values from this axis to include in the returned axis. If the value of the argument is
NULL, return a copy of the axis.
Method write()
Write the axis to a netCDF file, including its attributes. If the calendar name is "gregorian", it will be set to the functionally identical calendar "standard" as the former is deprecated.