This class represent discrete CF axes, i.e. those axes whose coordinate values do not represent a physical property. The coordinate values are ordinal values equal to the index into the axis.
Super classes
ncdfCF::CFObject -> ncdfCF::CFData -> ncdfCF::CFAxis -> CFAxisDiscrete
Active bindings
friendlyClassName(read-only) A nice description of the class.
dimnames(read-only) The coordinates of the axis as an integer vector, or labels for every axis element if they have been set.
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$copy_with_values()ncdfCF::CFAxis$detach()ncdfCF::CFAxis$identical()ncdfCF::CFAxis$peek()ncdfCF::CFAxis$shard()
Method new()
Create a new instance of this class. The values of this axis are always a sequence, but the sequence may start with any positive value such that the length of this instance falls within the length of the axis on file, if there is one.
Creating a new discrete axis is more easily done with the
makeDiscreteAxis() function.
Usage
CFAxisDiscrete$new(var, group, start = 1L, count)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.
startOptional. Integer value that indicates the starting value of this axis. Defults to
1L.countNumber of elements in the axis.
Method print()
Summary of the axis printed to the console.
Method copy()
Create a copy of this axis. The copy is completely separate from this axis, meaning that both this axis 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 indexOf()
Find indices in the axis domain. Given a vector of numerical
values x, find their indices in the values of the axis. Outside
values will be dropped.
Method slice()
Given a range of coordinate values, returns the indices into the axis that fall within the supplied range. If the axis has auxiliary coordinates selected then these will be used for the identification of the indices to return.
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, 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 append()
Append a vector of values at the end of the current values of the axis.
Arguments
fromAn instance of
CFAxisDiscretewhose length to add to this axis.groupThe CFGroup where the copy of this axis will live.
Method write()
Write the axis to a netCDF file, including its attributes, but only if it has an associated NC variable in the file.