RAnEn::writeNetCDF writes a formatted object into a NetCDF file. The output NetCDF file can be used by C++ utilities.

writeNetCDF(
  file.type,
  obj,
  file.out,
  global.attrs = list(author = paste("RAnEn", packageVersion("RAnEn"),
    "from GEOlab, Penn State"), Time = format(Sys.time())),
  nchars.max = 50
)

Arguments

file.type

The type of the object to be written to a file. It only supports Observations and Forecasts for now.

obj

A list object to write into the file.

file.out

The output file path.

nchars.max

The maximum length of string.

global.attr

A list with names and values for global attributes. The values will be written as strings. Please make sure list members have names.

Value

A boolean for whether the writing is complete.

Details

The parameter obj is an R list object with the following members:

  • ParameterNames

  • ParameterCirculars (optional)

  • StationNames (optional)

  • Xs

  • Ys

  • Times

  • Data

  • FLTs (required for type Forecasts)

Please note that ParameterWeights member is not written to files.

Author

Weiming Hu weiming@psu.edu