createStdNcdfFile: createStdNcdfFile

Description Usage Arguments Details Value Author(s)

View source: R/createStdNcdfFile.R

Description

create an new ncdf file with standardized attributes and dimensions

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
createStdNcdfFile(var.names = setdiff(names(data), 
    timeVar), file.name = c(), units = "[]", 
    lat.values = numeric(), long.values = numeric(), 
    time.values = data$time, lat.length = length(lat.values), 
    long.length = length(long.values), time.length = length(time.values), 
    year.start.end = c(), scale_factor = 1, 
    add_offset = 0, type.var = "NC_DOUBLE", 
    missing_value = -9999, con.atts = c(), 
    timeVar = "time", data = data.frame(), 
    ...)

Arguments

var.names

string vector: name of the target variables in the file

file.name

character string: name of the file. If not given, this is determined automatically in a standardized way from the variable name and the dimension extends.

units

string vector: units of variable (should be compatible with udunits)

lat.values

numeric values: coordinate values for the latitude positions.

long.values

numeric values: coordinate values for the longitude positions.

time.values

POSIXct vector: values for the time dimension

lat.length

integer: length of the latitude dimension

long.length

integer: length of the longitude dimension

time.length

integer: length of the time dimension

year.start.end

integer vector (length two): start and end year. If not given, this is determined from the time vector.

scale_factor

numeric: scale factor

add_offset

numeric: offset

type.var

character string: type of the data

missing_value

numeric: missing data value

con.atts

RNetCDF file connection: Possible file to use as source

timeVar

the name of the time variable for copying attributes to the new file.

data

named list of cubes or a data.frame with values to store

...

further arguments to createLatLongTime such as units, user, timeVar

Details

This function writes an empty ncdf file with variable names, dimensions and attributes formatted in a standardized way.

All variables, except time, are stored using the same specification (scale_factor, add_offset, missing_value, type.var)

if a single variable is stored, data can be given as a cube instead of a list or data.frame

Value

character string: name off the file created.

Author(s)

Jannis v. Buttlar, Thomas Wutzler


bgctw/ncdfTools documentation built on Jan. 29, 2020, 1:16 p.m.