---
title: "Reference Corrections"
output: rmarkdown::html_vignette
vignette: >
  %\VignetteIndexEntry{Reference Corrections}
  %\VignetteEngine{knitr::rmarkdown}
  %\VignetteEncoding{UTF-8}
---

```{r, include = FALSE}
knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>"
)
```

```{r setup, echo = FALSE}
library(NEONiso)
```

date: 2022-09-21

There are several instances across the atmospheric isotope measurements made
by NEON where there appears to be a disconnect between the "known" isotope ratio
(and in the case of CO2, the mixing ratio) of the reference materials used.
NEONiso attempts to correct these to maximize data coverage, primarily through:
a) analysis of time series plots of reference and measured values of validation
gases, and/or b) consultation with NEON staff.

As of version 0.6.0, these corrections are only applied to carbon isotopes, as 
the water isotope calibration functions are still experimental and have known
deficiencies.

The list of carbon isotope reference material corrections can be accessed using
the 'carb' data object bundled with NEONiso:

```{r, echo = FALSE}
#manually load data file:
carb <- readRDS("carb.rds")
print(carb[, -4], width = Inf, n = 27)
```

This table lists, in order, a) the site affected; b) the reference gas affected;
c) the start and end dates to which the correction is applied; d) the suspect
CO2 reference mole fraction; e) the corrected CO2 mole fraction; f) logical
of whether files recently pulled from the NEON data portal are expected to have
the CO2 values already corrected; f) the suspect d13C value; g) the corrected 
d13C value; h) the version of NEONiso where that entry was added to the table;
and i) any additional notes regarding the correction.

Note that because this table may change over time, it is possible that calibrations
performed by different versions of the code may change over time (though, hopefully
for the better.) Please post any suspected missing values to the maintainer 
as issues on the GitHub repo.