This class represents a numeric axis. Its values are numeric. This class is used for axes with numeric values but without further knowledge of their nature. More specific classes descend from this class.
Super classes
ncdfCF::CFObject -> ncdfCF::CFData -> ncdfCF::CFAxis -> CFAxisNumeric
Active bindings
friendlyClassName(read-only) A nice description of the class.
dimnames(read-only) The coordinates of the axis as a vector. These are by default the values of the axis, but it could also be a set of auxiliary coordinates, 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$detach()ncdfCF::CFAxis$peek()ncdfCF::CFAxis$shard()ncdfCF::CFAxis$write()
Method new()
Create a new instance of this class.
Creating a new axis is more easily done with the makeAxis() function.
Usage
CFAxisNumeric$new(
var,
group,
values,
start = 1L,
count = NA,
orientation = "",
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.
valuesOptional. The values of the axis in a vector. The values have to be numeric with the maximum value no larger than the minimum value + 360, and monotonic. Ignored when argument
varis aNCVariableobject.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.orientationOptional. The orientation of the axis: "X", "Y", "Z" "T", or "" (default) when not known or relevant.
attributesOptional. A
data.framewith the attributes of the axis. When an emptydata.frame(default) and argumentvaris anNCVariableinstance, attributes of the axis will be taken from the netCDF resource.
Method print()
Summary of the axis printed to the console.
Method range()
Retrieve the range of coordinate values in the axis.
Method indexOf()
Retrieve the indices of supplied coordinates on the axis. If the axis has boundary values then the supplied coordinates must fall within the boundaries of an axis coordinate to be considered valid.
Arguments
xA numeric vector of coordinates whose indices into the axis to extract.
methodExtract index values without ("constant", the default) or with ("linear") fractional parts.
rightmost.closedWhether or not to include the upper limit. This parameter is ignored for this class, it always is
TRUE.
Method slice()
Given a range of domain coordinate values, returns the indices into the axis that fall within the supplied range. If the axis has bounds, any coordinate whose boundary values fall entirely or partially within the supplied range will be included in the result.
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.
Method identical()
Tests if the axis passed to this method is identical to
self.
Method append()
Append a vector of values at the end of the current values
of the axis. Boundary values are appended as well but if either this
axis or the from axis does not have boundary values, neither will the
resulting axis.
Arguments
fromAn instance of
CFAxisNumericwhose values to append to the values of this axis.groupThe CFGroup where the copy of this axis will live.
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.