CFVariableL3b: CF data variable for the NASA L3b format

CFVariableL3bR Documentation

CF data variable for the NASA L3b format

Description

This class represents a CF data variable that provides access to data sets in NASA level-3 binned format, used extensively for satellite imagery.

Super classes

ncdfCF::CFObject -> ncdfCF::CFVariableBase -> ncdfCF::CFVariable -> CFVariableL3b

Public fields

variable

The name of the variable contained in this L3b data.

index

The index data of the L3b structure.

Methods

Public methods

Inherited methods

Method new()

Create an instance of this class.

Usage
CFVariableL3b$new(grp, units)
Arguments
grp

The group that this CF variable lives in. Must be called "/level-3_binned_data".

units

Vector of two character strings with the variable name and the physical units of the data variable in the netCDF resource.

Returns

An instance of this class.


Method as_matrix()

Read all the data from the file and turn the data into a matrix. If an aoi is specified, the data will be subset to that area.

This method returns a bare-bones matrix without any metadata or other identifying information. Use method data(), subset() or the [ operator rather than this method to obtain a more informative result.

Usage
CFVariableL3b$as_matrix(aoi = NULL)
Arguments
aoi

An instance of class AOI, optional, to select an area in latitude - longitude coordinates.

Returns

A matrix with the data of the variable in raw format.


Method data()

Retrieve all data of the L3b variable.

Usage
CFVariableL3b$data()
Returns

A CFArray instance with all data from this L3b variable.


Method subset()

This method extracts a subset of values from the data of the variable, with the range along both axes expressed in decimal degrees.

Usage
CFVariableL3b$subset(subset = NULL, aoi = NULL, rightmost.closed = FALSE, ...)
Arguments
subset

A list with the range to extract from each axis. The list should have elements for the axes to extract a subset from - if an axis is not present in the list the entire axis will be extracted from the array. List element names should be the axis name or designator longitude or X, or latitude or Y. Axis designators and names are case-sensitive and can be specified in any order. If values for the range per axis fall outside of the extent of the axis, the range is clipped to the extent of the axis.

aoi

Optional, an area-of-interest instance of class AOI created with the aoi() function to indicate the horizontal area that should be extracted. The longitude and latitude coordinates must be included; the X and Y resolution will be calculated if not given. When provided, this argument will take precedence over the subset argument.

rightmost.closed

Single logical value to indicate if the upper boundary of range in each axis should be included.

...

Ignored.

Details

The range of values along both axes of latitude and longitude is expressed in decimal degrees. Any axes for which no information is provided in the subset argument are extracted in whole. Values can be specified in a variety of ways that should (resolve to) be a vector of real values. A range (e.g. 100:200), a vector (⁠c(23, 46, 3, 45, 17⁠), a sequence (⁠seq(from = 78, to = 100, by = 2⁠), all work. Note, however, that only a single range is generated from the vector so these examples resolve to ⁠(100, 200)⁠, ⁠(3, 46)⁠, and ⁠(78, 100)⁠, respectively.

If the range of values for an axis in argument subset extend the valid range of the axis in x, the extracted slab will start at the beginning for smaller values and extend to the end for larger values. If the values envelope the valid range the entire axis will be extracted in the result. If the range of subset values for any axis are all either smaller or larger than the valid range of the axis in x then nothing is extracted and NULL is returned.

The extracted data has the same dimensional structure as the data in the variable, with degenerate dimensions dropped. The order of the axes in argument subset does not reorder the axes in the result; use the CFArray$array() method for this.

Returns

A CFArray instance, having an array with axes and attributes of the variable, or NULL if one or more of the elements in the subset argument falls entirely outside of the range of the axis. Note that degenerate dimensions (having length(.) == 1) are dropped from the array but the corresponding axis is maintained in the result as a scalar axis.


Method clone()

The objects of this class are cloneable with this method.

Usage
CFVariableL3b$clone(deep = FALSE)
Arguments
deep

Whether to make a deep clone.

References

https://oceancolor.gsfc.nasa.gov/resources/docs/technical/ocean_level-3_binned_data_products.pdf


ncdfCF documentation built on April 16, 2025, 9:08 a.m.