NetCDF: Information about a NetCDF file, in convenient form.

Description Usage Arguments Details Value See Also Examples

Description

NetCDF scans all the metadata provided by the ncdf4::nc_open function, and organizes it by the entities in the file.

Usage

1
NetCDF(x)

Arguments

x

path to NetCDF file

Details

Users of 'NetCDF' files might be familiar with the command line tool 'ncdump -h' noting that the "header" argument is crucial for giving a compact summary of the contents of a file. This package aims to provide that information as data, to be used for writing code to otherwise access and manipulate the contents of the files. This function doesn't do anything with the data, and it doesn't access any of the data.

A NetCDF file contains the following entities, and each gets a data frame in the resulting object:

attribute 'attributes' are general metadata about the file and its variables and dimensions
dimension 'dimensions' are the axes defining the space of the data variables
variable 'variables' are the actual data, the arrays containing data values
group 'groups' are an internal abstraction to behave as a collection, analogous to a file.

In addition to a data for each of the main entities above 'NetCDF' also creates:

unlimdims the unlimited dimensions identify those which are not a constant lenghth (i.e. spread over files)
dimvals a link table between dimensions and its coordinates
file information about the file itself
vardim a link table between variables and their dimensions

Currently 'file' is expected to and treated as having only one row, but future versions may treat a collection of files as a single entity.

The 'ncdump -h' print summary above is analogous to the print method ncdf4::print.ncdf4 of the output of ncdf4::nc_open. The approach here is under review, probably forever. https://github.com/hypertidy/ncdump/issues/8

Value

A list of data frames with an unused S3 class 'NetCDF', see details for a description of the data frames. The 'attribute' data frame has class 'NetCDF_attributes', this is used with a custom print method to reduce the amount of output printed.

See Also

ncdf4::nc_open which is what this function uses to obtain the information

Examples

1
rnc <- NetCDF(system.file("extdata", "S2008001.L3m_DAY_CHL_chlor_a_9km.nc", package= "ncdump"))

r-gris/ncdump documentation built on May 26, 2019, 1:33 p.m.