Package 'REddyProcNCDF'

Title: Reading Data from NetCDF Files for 'REddyProc'
Description: Extension to 'REddyProc' that allows reading data from netCDF files.
Authors: Department for Biogeochemical Integration at MPI-BGC, Jena, Germany [cph], Thomas Wutzler [aut, cre], Antje Maria Moffat [aut, trl]
Maintainer: Thomas Wutzler <[email protected]>
License: GPL (>= 2)
Version: 1.1.4
Built: 2024-11-26 03:06:39 UTC
Source: https://github.com/bgctw/reddyprocncdf

Help Index


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

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:

Further functionality.

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 <[email protected]> [cph], Thomas Wutzler <[email protected]> [aut, cre], Antje Maria Moffat <[email protected]> [aut, trl]

See Also

fLoadFluxNCIntoDataframe


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 <[email protected]> [cph], Thomas Wutzler <[email protected]> [aut, cre], Antje Maria Moffat <[email protected]> [aut, trl]

See Also

fLoadFluxNCIntoDataframe


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 fReadTimeSeveralCols

...

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 <[email protected]> [cph], Thomas Wutzler <[email protected]> [aut, cre], Antje Maria Moffat <[email protected]> [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 <[email protected]> [cph], Thomas Wutzler <[email protected]> [aut, cre], Antje Maria Moffat <[email protected]> [aut, trl]

See Also

fReadTimeSeveralCols

fLoadFluxNCIntoDataframe


fReadTimeSeveralCols

Description

Constructing time from columnns '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 columnns 'year',...,'hour': fReadTimeSeveralCols (this function)

  • from column in ISODate integer format: fReadTimeBerkeley

Author(s)

Department for Biogeochemical Integration at MPI-BGC, Jena, Germany <[email protected]> [cph], Thomas Wutzler <[email protected]> [aut, cre], Antje Maria Moffat <[email protected]> [aut, trl]

See Also

fLoadFluxNCIntoDataframe


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 occurence in packageNames

Value

The package name whose namespace has been loaded

Author(s)

Department for Biogeochemical Integration at MPI-BGC, Jena, Germany <[email protected]> [cph], Thomas Wutzler <[email protected]> [aut, cre], Antje Maria Moffat <[email protected]> [aut, trl]