write2ncdf4.station: Saves climate data as netCDF.

View source: R/write2ncdf.R

write2ncdf4.stationR Documentation

Saves climate data as netCDF.

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

## S3 method for class 'station'
write2ncdf4(
  x,
  ...,
  file = "station.nc",
  prec = "short",
  offset = 0,
  missval = -99,
  it = NULL,
  stid = NULL,
  append = FALSE,
  scale = 0.1,
  torg = "1899-12-31",
  stid_unlim = FALSE,
  namelength = 24,
  nmin = 30,
  verbose = FALSE,
  doi = "NA",
  namingauthority = "NA",
  processinglevel = "NA",
  creatortype = "NA",
  creatoremail = "NA",
  institution = "NA",
  publishername = "NA",
  publisheremail = "NA",
  publisherurl = "NA",
  project = "NA",
  nspc = 100,
  start = "Jan"
)

Arguments

x

data object

...

additional arguments

file

file name

prec

Precision: see ncvar_def

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

it

a time index, see subset

stid

station id

append

a Boolean; if TRUE append output to existing file - not used currently

scale

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

torg

Time origin

stid_unlim

a Boolean; if TRUE the stid dimension is unlimited

namelength

a numeric specifying the number of characters in dimension and variable names

nmin

Only calculate summary statistics for stations with nmin years of data (e.g. 30 years).

verbose

TRUE - clutter the screen.

doi

- Data ID. All the following arguments are meant to accommodate for the convention described at https://adc.met.no/node/4

namingauthority

The organization that provides the initial id (see above) for the dataset (see https://adc.met.no/node/4).

processinglevel

A textual description of the processing (or quality control) level of the data. (see https://adc.met.no/node/4).

creatortype

Specifies type of creator with one of the following: 'person', 'group', 'institution', or 'position'. If this attribute is not specified, the creator is assumed to be a person. (see https://adc.met.no/node/4).

creatoremail

The email address of the person (or other creator type specified by the creator_type attribute) principally responsible for creating this data. (see https://adc.met.no/node/4).

institution

The name of the institution principally responsible for originating this data. (see https://adc.met.no/node/4).

publishername

The name of the person (or other entity specified by the publisher_type attribute) responsible for publishing the data file or product to users, with its current metadata and format. (see https://adc.met.no/node/4).

publisheremail

The email address of the person (or other entity specified by the publisher_type attribute) responsible for publishing the data file or product to users, with its current metadata and format. (see https://adc.met.no/node/4).

publisherurl

The URL of the person (or other entity specified by the publisher_type attribute) responsible for publishing the data file or product to users, with its current metadata and format. (see https://adc.met.no/node/4).

project

The name of the project(s) principally responsible for originating this data. (see https://adc.met.no/node/4).

nspc

The size of chunks of data processes sequentially in order to limit the need of computer memory. Smaller number requires less memory.

start

specifies the start month of the year (default is January)

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.