This class represent CF labels, i.e. a variable of character type that provides a textual label for a discrete or general numeric axis. See also CFAxisCharacter, which is an axis with character labels.
Super classes
ncdfCF::CFObject -> ncdfCF::CFData -> CFLabel
Active bindings
friendlyClassName(read-only) A nice description of the class.
valuesSet or retrieve the labels of this object. In general you should use the
coordinatesfield rather than this one. Upon setting values, if there is a linked netCDF resource, this object will be detached from it.coordinates(read-only) Retrieve the labels of this object. Upon retrieval, label values are read from the netCDF resource, if there is one, upon first access and cached thereafter.
length(read-only) The number of labels in the set.
dimidThe netCDF dimension id of this label set. Setting this value to anything other than the correct value will lead to disaster.
Methods
Inherited methods
ncdfCF::CFObject$append_attribute()ncdfCF::CFObject$attach_to_group()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$detach()ncdfCF::CFData$dim()
Method new()
Create a new instance of this class.
Usage
CFLabel$new(var, group, values = NA, start = NA, count = NA)Arguments
varThe NCVariable instance upon which this CF object is based when read from a netCDF resource, or the name for the object new CF object to be created.
groupThe CFGroup that this instance will live in.
valuesOptional. The labels of the CF object. Ignored when argument
varis aNCVariableobject.startOptional. Integer index value indicating where to start reading data from the file. The value may be
NA(default) to read all data, otherwise it must not be larger than the number of labels. Ignored when argumentvaris not anNCVariableinstance.countOptional. Integer value indicating the number of labels to read from file. The value may be
NAto read to the end of the labels, otherwise its value must agree with the correspondingstartvalue and the number of labels on file. Ignored when argumentvaris not anNCVariableinstance.
Method print()
Prints a summary of the labels to the console.
Method identical()
Tests if the object passed to this method is identical to
self.
Method copy()
Create a copy of this label set. 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 label set. If an empty string is passed, will use the name of this label set.
groupThe CFGroup where the copy of this axis will live.
Method slice()
Given a range of domain coordinate values, returns the indices into the axis that fall within the supplied range.
Method subset()
Retrieve a subset of the labels.
Arguments
nameThe name for the new label set, optional.
groupThe CFGroup where the copy of this label set will live.
rngThe range of indices whose values from this axis to include in the returned axis.
Method write()
Write the labels to a netCDF file, including its attributes.