Skip to contents

Each obspack file has a header with metadata and this function reads selected fields from the metadata and add them as columns. This new columns are used later to be filtered

Usage

obs_read_nc(
  index,
  categories = "flask",
  att = FALSE,
  expr = NULL,
  solar_time = TRUE,
  as_list = FALSE,
  verbose = FALSE,
  warnings = FALSE
)

Arguments

index

data.table

categories

character; ONE category : of c("aircraft-pfp", "aircraft-insitu", "surface-insitu", "tower-insitu", "aircore", "surface-pfp", "shipboard-insitu", "flask").

att

Logical, if global attributes should be added to data.table

expr

String expressions to filter data.table internally

solar_time

Logical, add solar time?

as_list

Logical to return as list

verbose

Logical to show more information

warnings

Logical to show warnings when reading NetCDF, especially global attributes

Value

A data.frame with with an index obspack.

Examples

{
# Do not run
obs <- system.file("data-raw", package = "rtorf")
index <- obs_summary(obs)
dt <- obs_read(index)
}
#> Number of files of index: 1
#>           sector     N
#>           <char> <int>
#> 1:         flask     1
#> 2: Total sectors     1
#> Detected 0 files with agl
#> Detected 1 files without agl
#> Searching flask...
#> 1: ch4_aoa_aircraft-flask_19_allvalid.txt