Description Usage Arguments Value Note
Restore missing and/or degenerate dimensions in the data
1 | restoreMissingDims(dims, dimNames, lonArr, latArr, ZArr, thisTimeRaw, verbose)
|
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? |
The data array with restored dimensions.
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.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.