nc.get.compress.dims: Get X and Y dimension variables for reduced (compressed)...

View source: R/helpers.r

nc.get.compress.dimsR Documentation

Get X and Y dimension variables for reduced (compressed) grids

Description

Get X and Y dimension variables for reduced (compressed) grids.

Usage

nc.get.compress.dims(f, v)

Arguments

f

The file (an object of class ncdf4)

v

The name of a variable

Details

The CF metadata convention defines a method for implementing reduced grids (grids missing pieces of themselves); they call this compression by gathering. This function retrieves the X and Y dimensions for reduced (compressed) grids, returning a list containing the X and Y dimensions.

Value

A list consisting of two members of class ncdim4: x.dim for the X axis, and y.dim for the Y axis.

References

http://cfconventions.org/Data/cf-conventions/cf-conventions-1.8/cf-conventions.html#reduced-horizontal-grid

Examples

## Get compress dimensions from file.
## Not run: 
f <- nc_open("pr.nc")
compress.dims <- nc.get.compress.dims(f, "pr")
nc_close(f)

## End(Not run)


ncdf4.helpers documentation built on April 12, 2025, 1:39 a.m.