CFBounds | R Documentation |
This class represents the boundaries of an axis or an auxiliary longitude-latitude grid.
The class manages the boundary information for an axis (2 vertices per element) or an auxiliary longitude-latitude grid (4 vertices per element).
ncdfCF::CFObject
-> CFBounds
friendlyClassName
(read-only) A nice description of the class.
length
(read-only) The length of the second dimension of the data, i.e. the number of boundary values.
vertices
(read-only) The length of the first dimension of the data, i.e. the number of vertices that make up a boundary.
values
Set or retrieve the boundary values of this object. Upon retrieval, values are read from the netCDF resource, if there is one, upon first access and cached thereafter. Upon setting values, if there is a linked netCDF resource, this object will be detached from it.
ncdfCF::CFObject$append_attribute()
ncdfCF::CFObject$attribute()
ncdfCF::CFObject$delete_attribute()
ncdfCF::CFObject$detach()
ncdfCF::CFObject$dim()
ncdfCF::CFObject$print_attributes()
ncdfCF::CFObject$set_attribute()
ncdfCF::CFObject$update_coordinates_attribute()
ncdfCF::CFObject$write_attributes()
new()
Create an instance of this class.
CFBounds$new( var, values, start = NA, count = NA, attributes = data.frame(), owner_dims = 1L )
var
The name of the boundary variable when creating a new boundary variable. When reading a boundary variable from file, the NCVariable object that describes this instance.
values
Optional. The values of the boundary variable. This must be
a numeric matrix whose first dimension has a length equal to the number
of vertices for each boundary, and the second dimension is as long as
the CFObject
instances that use these boundary values. Ignored when
argument var
is a NCVariable
object.
start
Optional. Vector of indices where to start reading boundary
data along the dimensions of the data. The vector must be NA
to read
all data, otherwise it must have a length equal to the dimensionality
of the owning object + 1.
count
Optional. Vector of number of elements to read along each
dimension of the boundary data. The vector must be NA
to read to the
end of each dimension, otherwise it must have a length equal to the
dimensionality of the owning object + 1.
attributes
Optional. A data.frame
with the attributes of the
boundary object. When an empty data.frame
(default) and argument
var
is an NCVariable
instance, attributes of the bounds object will
be taken from the netCDF resource.
owner_dims
Optional, the number of dimensions of the object that these boundary values pertain to. Default is 1.
A new instance of this class.
print()
Print a summary of the object to the console.
CFBounds$print(attributes = TRUE, ...)
attributes
Default TRUE
, flag to indicate if the attributes of
the boundary values should be printed.
...
Arguments passed on to other functions. Of particular interest
is width =
to indicate a maximum width of attribute columns.
range()
Retrieve the lowest and highest value in the bounds.
CFBounds$range()
copy()
Create a copy of this bounds object The copy is completely
separate from self
, meaning that both self
and all of its
components are made from new instances.
CFBounds$copy(name = "")
name
The name for the new bounds object. If an empty string is passed, will use the name of this bounds object.
The newly created bounds object.
subset()
Return a boundary variable spanning a smaller coordinate range. This currently only applies to 1-D axes.
This method returns boundary values which span the range of indices
given by the rng
argument.
CFBounds$subset(rng)
rng
The range of values from this bounds object to include in the returned object.
A CFBounds
instance covering the indicated range of indices.
append()
Append boundary values at the end of the current values of the boundary variable.
CFBounds$append(from)
from
An instance of CFBounds
whose values to append to the
values of this boundary variable.
A new CFBounds
instance with values from this boundary variable
and the from
boundary variable appended. If argument from
is
NULL
, return NULL
.
write()
Write the boundary variable to a netCDF file. This method
should not be called directly; instead, CFVariable::save()
will call
this method automatically.
CFBounds$write(h, object_name)
h
The handle to a netCDF file open for writing.
object_name
The name of the object that uses these boundary values, usually an axis but could also be an auxiliary CV or a parametric Z axis.
clone()
The objects of this class are cloneable with this method.
CFBounds$clone(deep = FALSE)
deep
Whether to make a deep clone.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.