-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathREADME.Rmd
130 lines (98 loc) · 4.33 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
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
120
121
122
123
124
125
126
127
128
129
---
title: "R Tools for Obspack, Receptors and Footprints (rtorf)"
output: github_document
---
```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE)
```
![GitHub commit activity](https://img.shields.io/github/commit-activity/y/noaa-gml/rtorf)
[![R-CMD-check](https://github.com/noaa-gml/rtorf/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/noaa-gml/rtorf/actions/workflows/R-CMD-check.yaml)
![GitHub Repo stars](https://img.shields.io/github/stars/noaa-gml/rtorf)
[NOAA Obspack](https://gml.noaa.gov/ccgg/obspack/) is a collection of green house 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)
```
## ObsPack summary
The first step consists in constructing a summary for the ObsPack.
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:/torf/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/
## Implementation in python:
I'm currently implementing a version in python:
```{r, include=F}
data.frame(
stringsAsFactors = FALSE,
R = c("fex","invfile",
"obs_addltime","obs_addstime","obs_addtime","obs_agg",
"obs_find_receptors","obs_footname","obs_format","obs_freq",
"obs_index","obs_invfiles","obs_list.dt","obs_meta",
"obs_out","obs_plot","obs_rbind","obs_read","obs_read_csvy",
"obs_read_nc","obs_roundtime","obs_summary",
"obs_table","obs_trunc","obs_write_csvy","plot.invfile",
"print.invfile","sr","summary.invfile"),
description = c("File extension",
"Methods for objects with class 'invfile'",
"local hour (bsed on longitude and time)","Add solar time into obspack",
"Add times into obspack","Aggregates ObsPack by time",
"Compares expected receptors","Expected footprint name",
"Formatting data","return numeric vector in intervals",
"Summary of the ObsPack files (.txt)",
"Generate files to perform inverse modeling","list.dt","Read obspack metadata",
"outersect","Read obspack metadata","rbind obspack",
"Read obspack (.txt)","reads CSVY","Read obspack (.nc)",
"round seconds from \"POSIXct\" \"POSIXt\" classes",
"Summary of the ObsPack files (.txt)","Obspack Table",
"Trunc numbers with a desired number of decimals",
"Generates YAML and write data.frame",
"Methods for objects with class 'invfile'","Methods for objects with class 'invfile'",
"Extacts n last characters",
"Methods for objects with class 'invfile"),
Python = c("","","","","","","","",
"","","OK","","","","","","","","","OK","",
"","","","","","","","")
) -> df
```
```{r, eval=TRUE, echo=FALSE}
knitr::kable(df)
```