writeNetCDF: A function to write netCDF output files

View source: R/ukghg.R

writeNetCDFR Documentation

A function to write netCDF output files

Description

This function writes netCDF output files

Usage

writeNetCDF(ghgName, datect, proj, res, flux)

Arguments

ghgName

Greenhouse gas: one of "ch4", "co2", "n2o", "c2h6" or "voc". Defaults to "ch4".

datect

A vector of timestamps in POSIXct format.

proj

Geographic projection for the gridded data, either "OSGB" or "LonLat".

res

Resolution for the gridded data, either 1, 20 or 100 km or 0.01 degrees for LonLat. Defaults to "1km".

flux

a ukghg flux object

Examples

## Not run: 
startDate <- as.POSIXct(strptime("01/06/2006", "%d/%m/%Y"), tz = "UTC")
endDate   <- as.POSIXct(strptime("02/06/2006", "%d/%m/%Y"), tz = "UTC")
# create a sequence of dates
nTimes <- 2
datect <- seq(startDate, endDate, length = nTimes)
# calculate fluxes for these times
myFlux <- calcFlux("ch4", datect, proj = "OSGB", res = "100", "mol", "nano")
rf <- writeNetCDF("ch4", datect, proj = "OSGB", res = "100", myFlux)

## End(Not run)

NERC-CEH/ukghg documentation built on March 31, 2022, 3:16 a.m.