restoreMissingDims: Restore missing and/or degenerate dimensions in the data

Description Usage Arguments Value Note

View source: R/loadEnsemble.R

Description

Restore missing and/or degenerate dimensions in the data

Usage

1
restoreMissingDims(dims, dimNames, lonArr, latArr, ZArr, thisTimeRaw, verbose)

Arguments

dims

the data array just loaded from the NetCDF

dimNames

vector of dimensions names present in file

lonArr

numeric vector of longitude values

latArr

numeric vector of latitude values

ZArr

numeric vector of Z values

thisTimeRaw

numeric vector of time values

verbose

logical. Print info as we go?

Value

The data array with restored dimensions.

Note

There are two cases to consider here. (1) If we load a dimension with only one value (one month, one depth, etc) then that dimension will be dropped by the .ncvar_get function (there's a 'collapse_degen' option available in ncdf4, but not in ncdf). (2) A dimension is missing entirely, e.g. in a time-only file, or a space-only grid area file. In either case, we want those dimensions (of length 1) back in the data array.

This is an internal RCMIP5 function and not exported.


RCMIP5 documentation built on May 1, 2019, 6:28 p.m.