write2ncdf: Saves climate data as netCDF.

Description Usage Arguments Value Author(s) See Also Examples

Description

Method to save station 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

1
2
3
write2ncdf(x,file,...)
write2ncdf.station(x,file,prec='short',missval=-99.9,offs=0,scalf=0.1,
                   torg='1899-12-31',verbose=FALSE)

Arguments

x

data object

file

file name

prec

Precision: see ncvar_def

missval

Missing value: see ncvar_def

offs

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

scalf

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

torg

Time origin

verbose

TRUE - clutter the screen.

Value

A "zoo" "field" object with additional attributes used for further processing.

Author(s)

R.E. Benestad

See Also

test.retrieve.ncdf4.

Examples

1
2
3
nacd <- station(src='nacd')
X <- annual(nacd)
write2ncdf(X,file='test.nc')

metno/esd.test documentation built on May 22, 2019, 7:49 p.m.