forked from hypertidy/ncmeta
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathREADME.Rmd
81 lines (51 loc) · 3.36 KB
/
README.Rmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
---
output: github_document
---
<!-- badges: start -->
[![R-CMD-check](https://github.com/hypertidy/ncmeta/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/hypertidy/ncmeta/actions/workflows/R-CMD-check.yaml)
[![CRAN status](http://www.r-pkg.org/badges/version/ncmeta)](https://cran.r-project.org/package=ncmeta)
[![](https://cranlogs.r-pkg.org/badges/ncmeta)](https://cran.r-project.org/package=ncmeta)
<!-- badges: end -->
<!-- README.md is generated from README.Rmd. Please edit that file -->
```{r, echo = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
fig.path = "README-"
)
```
# ncmeta
The `ncmeta` package provides straightforward NetCDF metadata, with a set of consistent entity-based functions for extracting metadata from a file or online source. We aim to fill a gap in between the generality and power of the NetCDF framework and ease of use.
There are two main packages for using NetCDF in R, `RNetCDF` and `ncdf4` and ncmeta uses both, where appropriate. Both packages are very close the native API of NetCDF itself, and ncmeta simply provides an easier high-level interpretation.
## About NetCDF
NetCDF is both a data model and an API, and provides a very general
framework for expressing data formats. The explicit entities in NetCDF are
**variables**, **dimensions** and **attributes** and ncmeta provides functions `nc_vars`, `nc_dims`, and `nc_atts` to extract their names, order and other metadata. There are matching functions `nc_var`, `nc_dim`, and `nc_att` with an extra identifier to extract specific information about an individual variable, dimension, or attribute.
Also includes functions for implicit entities, these are **grids** and **axes**. These don't exist in the NetCDF specification explicitly, but are meaningful and worth making explicit. Many NetCDF tools don't explicitly present these concepts so grab hold of them with ncmeta!
A **grid** is an ordered set of dimensions, and the [Unidata site](https://www.unidata.ucar.edu/software/netcdf/) refers *informally* to this concept as **shape**.
An **axis** is an *instance* of a dimension, the use of that dimension within a particular variable.
These functions provide a more developer-friendly scheme for working with the range of formats provided by the NetCDF ecosystem.
## Installation
Install ncmeta from CRAN with:
```R
install.packages("ncmeta")
```
You can install the development version of ncmeta from github with:
```{r gh-installation, eval = FALSE}
# install.packages("devtools")
devtools::install_github("hypertidy/ncmeta")
```
## Example
This example shows some of the functions for extracting information from a NetCDF source.
```{r example,eval=FALSE}
library(ncmeta)
filename <- system.file("extdata", "S2008001.L3m_DAY_CHL_chlor_a_9km.nc", package = "ncmeta")
nc_inq(filename) # one-row summary of file
nc_dim(filename, 0) ## first dimension
nc_dims(filename) ## all dimensions
```
## Get involved!
Please let us know if you have any feedback, see the [Issues tab](https://github.com/hypertidy/ncmeta) if you found a bug or have a question. Feel free to email the maintainer directly for other questions.
---
Please note that this project is released with a [Contributor Code of Conduct](https://github.com/hypertidy/ncmeta/blob/master/CODE_OF_CONDUCT.md#contributor-code-of-conduct).
By participating in this project you agree to abide by its terms.