ncmeta v0.0.1

0

Monthly downloads

0th

Percentile

Straightforward 'NetCDF' Metadata

Extract metadata from 'NetCDF' data sources, these can be files, file handles or servers. This package leverages and extends the lower level functions of the 'RNetCDF' package providing a consistent set of functions that all return data frames. We introduce named concepts of 'grid', 'axis' and 'source' which are all meaningful entities without formal definition in the 'NetCDF' library <https://www.unidata.ucar.edu/software/netcdf/>. 'RNetCDF' matches the library itself with only the named concepts of 'variables', 'dimensions' and 'attributes'. 'ncmeta' provides a required framework for the in-development 'tidync' project <https://github.com/hypertidy/ncmeta>.

Readme

Travis-CI Build Status AppVeyor Build Status Coverage Status

ncmeta

Straightforward NetCDF metadata for use in building interfaces to this format.

Installation

You can install ncmeta from github with:

# install.packages("devtools")
devtools::install_github("hypertidy/ncmeta")

Example

This is a basic example which shows you how to solve a common problem:

nc_inq(filename) # one-row summary of file

nc_dim(filename, 0)  ## first dimesion
nc_dims(filename)  ## all dimensions

Compare timings.

library(ncmeta)
f <- system.file("extdata", "S2008001.L3m_DAY_CHL_chlor_a_9km.nc", package = "ncmeta")
u <- "https://upwell.pfeg.noaa.gov/erddap/tabledap/FRDCPSTrawlLHHaulCatch"

library(microbenchmark)
junk <- capture.output(a <- microbenchmark(nc_open = ncdf4::nc_open(f), 
               ncdump = ncdump::NetCDF(f), 
               ncmeta = nc_meta(f) ,
               RNetCDF = RNetCDF::print.nc(RNetCDF::open.nc(f)), 
                times = 10)
)
print(a)
#> Unit: milliseconds
#>     expr      min       lq      mean    median        uq       max neval
#>  nc_open 14.15938 14.23332 112.95724  14.98906  21.33014 656.46713    10
#>   ncdump 93.73832 95.89619 134.31769 101.12352 107.68589 370.77173    10
#>   ncmeta 59.67635 61.19443  62.97108  61.91249  62.57958  70.01173    10
#>  RNetCDF 32.97361 33.77285  52.62526  35.87184  40.15188 135.59934    10

Functions in ncmeta

Name Description
nc_inq File info
nc_axes NetCDF axes
nc_grids NetCDF grids
nc_axis NetCDF axes
nc_att NetCDF attributes
nc_atts NetCDF attributes
ncmeta ncmeta: straightforward NetCDF metadata
nc_dim NetCDF variables Obtain information about a single dimension by index.
nc_dims NetCDF dimension
nc_sources NetCDF sources
nc_var NetCDF variable
nc_vars NetCDF variables
nc_meta Top level NetCDF metadata.
No Results!

Last month downloads

Details

License GPL-3
Encoding UTF-8
LazyData true
RoxygenNote 6.0.1
URL https://github.com/hypertidy/ncmeta
BugReports https://github.com/hypertidy/ncmeta/issues
ByteCompile TRUE
NeedsCompilation no
Packaged 2017-12-01 12:24:36 UTC; mdsumner
Repository CRAN
Date/Publication 2017-12-01 18:16:57 UTC

Include our badge in your README

[![Rdoc](http://www.rdocumentation.org/badges/version/ncmeta)](http://www.rdocumentation.org/packages/ncmeta)