This class represents a netCDF group, the object that holds elements like dimensions and variables of a netCDF file. This class also holds references to any CF objects based on the netCDF elements held by the group.
Direct access to groups is usually not necessary. The principal objects held by the group, CF data variables and axes, are accessible via other means. Only for access to the group attributes is a reference to a group required.
ncdfCF::NCObject
-> NCGroup
resource
Access to the underlying netCDF resource.
fullname
The fully qualified absolute path of the group.
parent
Parent group of this group, the owning CFDataset
for the
root group.
subgroups
List of child NCGroup
instances of this group.
NCvars
List of netCDF variables that are located in this group.
NCdims
List of netCDF dimensions that are located in this group.
NCudts
List of netCDF user-defined types that are located in this group.
CFvars
List of CF data variables in this group. There must be a
corresponding item in NCvars
for each item in this list.
CFaxes
List of axes of CF data variables in this group. There must
be a corresponding item in NCvars
for each item in this list. Note
that the CF data variable(s) that an axis is associated with may be
located in a different group. Also, objects that further describe the
basic axis definition, such as its bounds, labels, ancillary data, may
be located in a different group; all such elements can be accessed
directly from the CFAxis instances that this list holds.
CFlabels
List of labels located in this group.
CFaux
List of auxiliary variables. These could be CFAxisScalar or CFAuxiliaryLongLat that hold longitude and latitude values for every grid point in the data variable that references them.
CFcrs
List of grid mappings located in this group.
friendlyClassName
(read-only) A nice description of the class.
handle
(read-only) Get the handle to the netCDF resource for the group
new()
Create a new instance of this class.
NCGroup$new(id, name, fullname, parent, resource)
id
The identifier of the group.
name
The name of the group.
fullname
The fully qualified name of the group.
parent
The parent group of this group. NULL
for the root group.
resource
Reference to the CFResource instance that provides access to the netCDF resource.
...
Passed on to other methods.
hierarchy()
Prints the hierarchy of the group and its subgroups to the console, with a summary of contained objects. Usually called from the root group to display the full group hierarchy.
NCGroup$hierarchy(idx = 1L, total = 1L)
idx, total
Arguments to control indentation. Should both be 1 (the default) when called interactively. The values will be updated during recursion when there are groups below the current group.
find_by_name()
Find an object by its name. Given the name of an object,
possibly preceded by an absolute or relative group path, return the
object to the caller. Typically, this method is called
programmatically; similar interactive use is provided through the
[[.CFDataset
operator.
NCGroup$find_by_name(name, scope = "CF")
name
The name of an object, with an optional absolute or relative group path from the calling group. The object must either an CF construct (data variable, axis, auxiliary axis, label, or grid mapping) or an NC group, dimension or variable.
scope
Either "CF" (default) for a CF construct, or "NC" for a netCDF group, dimension or variable.
The object with the provided name in the requested scope. If the
object is not found, returns NULL
.
find_dim_by_id()
Find an NC dimension object by its id. Given the id of a dimension, return the NCDimension object to the caller. The dimension has to be found in the current group or any of its parents.
NCGroup$find_dim_by_id(id)
id
The id of the dimension.
The NCDimension object with an identifier equal to the id
argument. If the object is not found, returns NULL
.
unused()
Find NC variables that are not referenced by CF objects. For debugging purposes only.
NCGroup$unused()
List of NCVariable.
addAuxiliaryLongLat()
Add an auxiliary long-lat variable to the group. This method
creates a CFAuxiliaryLongLat from the arguments and adds it to the
group CFaux
list, but only if the combination of lon
, lat
isn't
already present.
NCGroup$addAuxiliaryLongLat(lon, lat, bndsLong, bndsLat)
lon, lat
Instances of NCVariable having a two-dimensional grid of longitude and latitude values, respectively.
bndsLong, bndsLat
Instances of CFBounds with the 2D bounds of the
longitude and latitude grid values, respectively, or NULL
when not
set.
self
invisibly.
fullnames()
This method lists the fully qualified name of this group, optionally including names in subgroups.
NCGroup$fullnames(recursive = TRUE)
recursive
Should subgroups be scanned for names too (default is
TRUE
)?
A character vector with group names.
dimensions()
List all the dimensions that are visible from this group including those that are defined in parent groups (by names not defined by any of their child groups in direct lineage to the current group).
NCGroup$dimensions()
A vector of NCDimension objects.
variables()
This method lists the CF data variables located in this group, optionally including data variables in subgroups.
NCGroup$variables(recursive = TRUE)
recursive
Should subgroups be scanned for CF data variables too
(default is TRUE
)?
A list of CFVariable.
axes()
This method lists the axes located in this group, optionally including axes in subgroups.
NCGroup$axes(recursive = TRUE)
recursive
Should subgroups be scanned for axes too (default is
TRUE
)?
A list of CFAxis descendants.
grid_mappings()
This method lists the grid mappings located in this group, optionally including grid mappings in subgroups.
NCGroup$grid_mappings(recursive = TRUE)
recursive
Should subgroups be scanned for grid mappings too
(default is TRUE
)?
A list of CFGridMapping instances.
clone()
The objects of this class are cloneable with this method.
NCGroup$clone(deep = FALSE)
deep
Whether to make a deep clone.