write2ncdf4.pca: Saves climate data as netCDF.

View source: R/write2ncdf.R

write2ncdf4.pcaR Documentation

Saves climate data as netCDF.

Description

Method to save 'pca' data as netCDF, making sure to include the data structure and meta-data (attributes). The code tries to follow the netCDf 'CF' convention. The method is built on the ncdf4 package.

Usage

## S3 method for class 'pca'
write2ncdf4(
  x,
  ...,
  file = "esd.pca.nc",
  prec = "short",
  verbose = FALSE,
  scale = 0.01,
  offset = 0,
  missval = -99
)

Arguments

x

data object

...

additional arguments

file

file name

prec

Precision: see ncvar_def

verbose

TRUE - clutter the screen.

scale

Sets the atttribute 'scale_factor' which is used to scale (multiply) the values stored (to save space may be represented as 'short').

offset

Sets the attribute 'add_offset' which is added to the values stored (to save space may be represented as 'short').

missval

Missing value: see ncvar_def

Details

To save space, the values are saved as short (16-bit signed integer that can hold values between -32768 and 32767). (see NC_SHORT in https://www.unidata.ucar.edu/software/netcdf/docs/data_type.html).

Value

None

See Also

write2ncdf4


metno/esd documentation built on April 29, 2024, 3:34 p.m.