-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathREADME.Rmd
More file actions
119 lines (83 loc) · 3.39 KB
/
Copy pathREADME.Rmd
File metadata and controls
119 lines (83 loc) · 3.39 KB
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
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
---
title: "R Tools for Observations, Receptors and Footprints (rtorf)"
output: github_document
---
```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE)
```
<img src="man/figures/logo.png" align="right" alt="" width="220" />

[](https://github.com/noaa-gml/rtorf/actions/workflows/R-CMD-check.yaml)

[NOAA Obspack](https://gml.noaa.gov/ccgg/obspack/) is a collection of greenhouse gases observations
`rtorf` only depends on `data.table` and `ncdf4`, which is basically parallel C,
so it can be installed in any machine.
## Installation
Using git bash/powershell
```{bash installb, eval = F}
git clone https://github.com/noaa-gml/rtorf
R CMD INSTALL rtorf
```
Using remotes R package
```{r install, eval = F}
remotes::install_github("noaa-gml/rtorf")
```
```{r call, include = T, message=F, warning=F}
library(rtorf)
library(data.table)
utils::packageVersion("rtorf")
```
## ObsPack summary
The first step consists in constructing a summary for ObsPack (CH4, CO2 or other).
This is required to read the data, but also, identify `agl`,
which is present in some of the file names.
This function returns a `data.frame`.
Optionally, the user can indicate a path to store the `data.frame`.
`obs_summary` also prints a summary of the data. The second
argument is the categories, and by default includes the categories
shown below, to account for all the files.
Then the summary `data.frame` contains
the columns `id` as the full path to each
file, `name` which is the name or relative path of the file, `n`
just an id, `sector` such as tower, and the column `agl`
which indicates the `agl` indicated in the name of the file
if available. To read the documentation of this function,
the user must run `?obs_summary`.
> We first define the categories
```{r read1, eval = T}
cate = c(
"aircraft-pfp",
"aircraft-insitu",
"aircraft-flask",
"surface-insitu",
"surface-flask",
"surface-pfp",
"tower-insitu",
"aircore",
"shipboard-insitu",
"shipboard-flask"
)
obs <- "Z:/obspack/obspack_ch4_1_GLOBALVIEWplus_v5.1_2023-03-08/data/nc/"
index <- obs_summary(obs = obs, categories = cate)
```
For each one of these dataset ids, check the articles in the documentation
https://noaa-gml.github.io/rtorf/
e.g. for the `aircraft-pfp` we can read $CO_2$ and $CH_4$ [here](https://noaa-gml.github.io/rtorf/articles/aircraft-pfp.html)
## Implementation in python:
I'm currently implementing a version in python [pytorf](https://github.com/noaa-gml/pytorf):
## Special thanks to all the
**contributors**
[](https://github.com/noaa-gml/rtorf/graphs/contributors)
and
**Stargazers**
<p>
<a href="https://github.com/noaa-gml/rtorf/stargazers">
<img src="http://reporoster.com/stars/dark/noaa-gml/rtorf"/>
</a>
</p>
### Note about legacy code.
I received the task of reformat legacy code used to read PARTICLE.DAT and generate
NetCDF. This code is really old and since STILT and other have permissive licenses,
it is here, however, some code is not exported to NAMESPACE.
A future version of rtorf, will have a new design for the legacy code,
a modern and efficient approach, keeping the essential tasks.