getField_NetCDF: Get a Field for NetCDF

View source: R/Format-NetCDF.R

getField_NetCDFR Documentation

Get a Field for NetCDF

Description

An internal function that reads data from an NetCDF .nc file.

Usage

getField_NetCDF(
  source,
  quant,
  layers = NULL,
  target.STAInfo,
  file.name,
  verbose = FALSE,
  nc.verbose = FALSE,
  vars.to.ignore = c("time_bnds", "lon_bnds", "lat_bnds", "lat", "lon"),
  calendar = "standard"
)

Arguments

source

A Source containing the meta-data about the NetCDF source

quant

A Quantity object to specify what quantity should be opened.

layers

A character string (or a vector of character strings) specifying which variables from the NetCDF file are to be read. NULL (default) means read all.

file.name

Character string holding the name of the file. This can be left blank, in which case the file name is automatically generated

verbose

A logical, set to true to give progress/debug information

nc.verbose

A logical, set to true to give progress/debug information from the ncdf4 package functions. This can be a lot, so it is handy to control that separately.

vars.to.ignore

A list of character strings specifying which cvariables *not* to read. These are typically metadata about the coordinate data (hence the defaults ""time_bnds", "lon_bnds", "lat_bnds", "lat" and "lon"), but you can also use this argument to ignore a particular data variable from a file.

calendar

Character string, sometimes the calendar string on the time axis can be incorrect or missing. Here you can manually provide it. Note: A common error in paleo files is "standard" instead of "proleptic_gregorian". Specifically, if you have dates with years 1582 (the start of the Gregorian calendar) and it includes leap years the calendar needs to be set to "proleptic_gregorian".

target.sta.info

An STAInfo object defining the spatial-temporal-annual extent over which we want the data

Value

A list containing firstly the data.table containing the data, and secondly the STAInfo for the data that we have

Author(s)

Matthew Forrest matthew.forrest@senckenberg.de


MagicForrest/DGVMTools documentation built on Aug. 23, 2024, 8:05 a.m.