Type: | Package |
Version: | 1.1.4 |
Title: | Reading Data from NetCDF Files for 'REddyProc' |
Description: | Extension to 'REddyProc' that allows reading data from netCDF files. |
URL: | https://github.com/bgctw/REddyProcNCDF |
License: | GPL-2 | GPL-3 [expanded from: GPL (≥ 2)] |
Encoding: | UTF-8 |
LazyData: | true |
Depends: | R (≥ 3.0.0), REddyProc |
Suggests: | ncdf4, RNetCDF, testthat, knitr, rmarkdown |
RoxygenNote: | 6.0.1 |
NeedsCompilation: | no |
Packaged: | 2018-05-11 06:58:48 UTC; twutz |
Author: | Department for Biogeochemical Integration at MPI-BGC, Jena, Germany [cph], Thomas Wutzler [aut, cre], Antje Maria Moffat [aut, trl] |
Maintainer: | Thomas Wutzler <twutz@bgc-jena.mpg.de> |
Repository: | CRAN |
Date/Publication: | 2018-05-11 11:22:53 UTC |
Reading data from NetCDF files for REddyProc
Description
This package enhances REddyProc a package for standard and extensible Eddy-Covariance data post-processing includes uStar-filtering, gap-filling, and flux-partitioning. A general description and an online tool based on this REddyProc can be found here: https://www.bgc-jena.mpg.de/bgi/index.php/Services/REddyProcWeb.
This package adds functionality to read data from netCDF files.
Details
Reading data from NetCDF files was formerly part of REddyProc, but has been factored to this own package to decrease the number of dependencies in REddyProc.
The main functions
Reading standard data from a NetCDF file:
fLoadFluxNCIntoDataframe
Reading a specific variable from a NetCDF file:
fAddNCFVar
The package works with alternative backend-packages that are installed.
For the default is the first entry of argument packageNames
in requireNetCDFPackage
.
If the preference order for a specific package is changed, provide argument
use: prefNcPkg = requireNetCDFPackage(myPreferenceNameVector)
and
subsequently specify argument ncPkg = prefNcPkg
to other functions.
Time may be stored in different formats, and fLoadFluxNCIntoDataframe
is parameterized by a argument fReadTime
.
The following functions are provided to construct time from different formats:
These functions help with the preparation of your data for the analysis:
from columnns 'year',...,'hour':
fReadTimeSeveralCols
from column in ISODate integer format:
fReadTimeBerkeley
Further functionality.
Get site information from BGI NetCDF files:
fLoadFluxNCInfo
Author(s)
Department for Biogeochemical Integration at MPI-BGC, Jena, Germany
fAddNCFVar
Description
Add variable from NetCDF file to data frame
Usage
fAddNCFVar(data, varNames, fileName, ncPkg = requireNetCDFPackage(),
callingFunction = "", varRenames = varNames,
...)
Arguments
data |
Data frame |
varNames |
Variable name or names (vector of strings) |
fileName |
NetCDF file name as a string |
ncPkg |
scalar string of package name to be used to be tried to used in this order |
callingFunction |
Name (string) of function called from |
varRenames |
Name (string) of the variable in data, offer renaming |
... |
further arguments to var.get.nc or ncvar_get , such as start and count |
Value
Data frame with new nc variable added.
Author(s)
AMM, KS, TW Department for Biogeochemical Integration at MPI-BGC, Jena, Germany <REddyProc-help@bgc-jena.mpg.de> [cph], Thomas Wutzler <twutz@bgc-jena.mpg.de> [aut, cre], Antje Maria Moffat <antje.moffat@bgc.mpg.de> [aut, trl]
See Also
Get site information from BGI NetCDF files
Description
Load site information attributes such as latitude, longitude and others from BGI NetCDF files
Usage
fLoadFluxNCInfo(fileName, ncPkg = requireNetCDFPackage(),
callingFunction = "")
Arguments
fileName |
NetCDF file name as a string |
ncPkg |
scalar string of package name to be used |
callingFunction |
Name (string) of function called from |
Details
Description of attribute list:
- ID
SiteID
- DIMS
Number of data rows
- LON
Longitude
- LAT
Latitude
- TZ
Time zone
- ELEV
Elevation
- IGBP
IGBP class
Value
Attibute list
Author(s)
AMM, TW Department for Biogeochemical Integration at MPI-BGC, Jena, Germany <REddyProc-help@bgc-jena.mpg.de> [cph], Thomas Wutzler <twutz@bgc-jena.mpg.de> [aut, cre], Antje Maria Moffat <antje.moffat@bgc.mpg.de> [aut, trl]
See Also
Load data from a NetCDF file
Description
Load specified variables and time stamp information from NetCDF file in Fluxnet BGI format. The time stamp information needs to be provided as variables 'year', 'month', 'day', 'hour'.
Usage
fLoadFluxNCIntoDataframe(varNames, fileName,
ncPkg = requireNetCDFPackage(), fReadTime = fReadTimeSeveralCols,
...)
Arguments
varNames |
string vector of variables to be read in |
fileName |
File name as a string |
ncPkg |
scalar string of package name to be used |
fReadTime |
function that reads time columns
It must append columns year (from 0AD), month, day, and hour (fractional)
See |
... |
further arguments to var.get.nc or ncvar_get, such as start and count |
Value
Data frame with data from nc file.
Author(s)
AMM, KS, TW Department for Biogeochemical Integration at MPI-BGC, Jena, Germany <REddyProc-help@bgc-jena.mpg.de> [cph], Thomas Wutzler <twutz@bgc-jena.mpg.de> [aut, cre], Antje Maria Moffat <antje.moffat@bgc.mpg.de> [aut, trl]
Examples
examplePath <- system.file(
file.path('examples','Example_DE-Tha.1996.1998.hourly_selVars.nc')
, package = "REddyProcNCDF")
EddyNCData <- fLoadFluxNCIntoDataframe(c('NEE', 'Rg', 'NEE_f'), examplePath)
fReadTimeBerkeley
Description
Reads time columns (year, month, day, hour) from column in ISODate integer format
Usage
fReadTimeBerkeley(data, fileName, ncPkg = requireNetCDFPackage(),
callingFunction = "", colTime = "TIMESTAMP_END",
...)
Arguments
data |
Data frame |
fileName |
NetCDF file name as a string |
ncPkg |
scalar string of package name to be used |
callingFunction |
Name (string) of function called from |
colTime |
the column name (string) holding time with format described in details |
... |
further arguments to var.get.nc or ncvar_get, such as start and count |
Details
In the Berkeley-Release of the fluxnet data, the time is stored as an integer with base10-digits representing YYYYMMddhhmm
Author(s)
Department for Biogeochemical Integration at MPI-BGC, Jena, Germany <REddyProc-help@bgc-jena.mpg.de> [cph], Thomas Wutzler <twutz@bgc-jena.mpg.de> [aut, cre], Antje Maria Moffat <antje.moffat@bgc.mpg.de> [aut, trl]
See Also
fReadTimeSeveralCols
Description
Constructing time from columns 'year',...,'hour'
Usage
fReadTimeSeveralCols(data, fileName, ncPkg = requireNetCDFPackage(),
callingFunction = "", colYear = "year",
colMonth = "month", colDay = "day", colHour = "hour",
defaultHour = 0, ...)
Arguments
data |
Data frame |
fileName |
NetCDF file name as a string |
ncPkg |
scalar string of package name to be used |
callingFunction |
Name (string) of function called from |
colYear |
Name (string) of variable holding the year |
colMonth |
Name (string) of variable holding the month |
colDay |
Name (string) of variable holding the day |
colHour |
Name (string) of variable holding the hour |
defaultHour |
(numeric) default that is used when colHour = NA , when only days are specified |
... |
further arguments to var.get.nc or ncvar_get , such as start and count |
Details
Time may be stored in different formats, and fLoadFluxNCIntoDataframe
is parameterized by a argument fReadTime
.
The following functions are provided to construct time from different formats:
These functions help with the preparation of your data for the analysis:
from columns 'year',...,'hour': fReadTimeSeveralCols (this function)
from column in ISODate integer format:
fReadTimeBerkeley
Author(s)
Department for Biogeochemical Integration at MPI-BGC, Jena, Germany <REddyProc-help@bgc-jena.mpg.de> [cph], Thomas Wutzler <twutz@bgc-jena.mpg.de> [aut, cre], Antje Maria Moffat <antje.moffat@bgc.mpg.de> [aut, trl]
See Also
requireNetCDFPackage
Description
require namespace of given NetCDF package
Usage
requireNetCDFPackage(packageNames = c("RNetCDF",
"ncdf4"))
Arguments
packageNames |
string vector: Name of R NetCDF packages to be tried to used in this order |
Details
currently 'RNetCDF' and 'ncdf4' are supported Loading package namespace is tried in the order of occurrence in packageNames
Value
The package name whose namespace has been loaded
Author(s)
Department for Biogeochemical Integration at MPI-BGC, Jena, Germany <REddyProc-help@bgc-jena.mpg.de> [cph], Thomas Wutzler <twutz@bgc-jena.mpg.de> [aut, cre], Antje Maria Moffat <antje.moffat@bgc.mpg.de> [aut, trl]