## 1. Measurement methods
Each description below is cross-referenced with the brief methods caption provided in the descriptions of the table columns.
### 1.1 Sensor deployments
The following summarizes the methods for deployed sensors. Sensors were cleaned at approximately the same time as quality assurance samples were collected (see below).
_Deployed SAMI CO<sub>2</sub> probe_: A Submersible Autonomous Moored Instrument (SAMI) CO<sub>2</sub> probe (Sunburst Sensors, Missoula, Montana, USA) was deployed directly in the channel thalweg and measured the partial pressure of dissolved CO<sub>2</sub> in river water. The pH of the indicator fluid measured by colorimetric absorbance can then be calibrated to the influence of dissolved carbon dioxide gas on the buffering system of the indicator. Calibrations were carried out in the DeGrandpre lab at University of Montana. The probe also records the water temperature and time of measurements.
_Deployed SAMI pH probe_: A Submersible Autonomous Moored Instrument (SAMI) pH probe (Sunburst Sensors, Missoula, Montana, USA) was deployed directly in the channel thalweg and measured pH in the river water. Samples of river water are automatically pumped into the SAMI and are passively mixed with indicator dye. A spectrophotometric measurement of the mixture provides a value for pH. The probe also records the water temperature and time of measurements.
_Deployed HOBO EC probe_: An Onset Hobo electrical conductivity probe (Onset Computer Corporation, Bourne, Massachusetts, USA) was deployed directly in the channel thalweg and measured the temperature-corrected electrical conductivity in river water. The electrical conductivity is measured by applying a voltage across leads with a specific geometry of connection with river water and measuring the resistance between those leads to conducting an electrical current. The probe also records the water temperature and time of measurements. The software from the manufacturer of the probe (Hobo Onset) provides a post-processor that performs the temperature-correction of the conductivity to 25 degrees Celsius. The factory calibration was used on the instrument.
_Deployed HOBO pressure probe_: An Onset Hobo pressure transducer (Onset Computer Corporation, Bourne, Massachusetts, USA) was deployed with the SAMI CO<sub>2</sub> probe to track the relative variation in river depth during the deployment. The pressure transducers derives absolute pressure by measuring the deformation of a ceramic diaphragm. The probe also records the water temperature and time of measurements.
### 1.2 Quality assurance sampling
The following methods apply to data collected for quality assurance. Sensor deployment data have not been altered based on these measurements, and they are provided for information to users of these data.
_Colorimetry with indicator dye_: For quality assurance purposes, pH of discrete river water samples was measured in a laboratory setting following the procedures in Lai et al. (2016). Briefly, indicator dyes were added to river samples stored in a 10-cm cylindrical optical cell. Values of pH for the samples were obtained by monitoring the spectrum of the dye-sample mixture via a Cary 300 spectrophotometer (Varian, Inc.). Measurements are routinely performed at ~20 degrees Celsius and corrected to in situ temperature (i.e. temperature when samples were taken) using the CO2Sys Excel spreadsheet model for the inorganic carbon system (Pierrot et al., 2006).
_Gran titration_: Alkalinity samples were measured by acidimetric open-cell titration (Gran 1952). Alkalinity is inferred from non-linear regression analysis from a titration curve between pH values of 3.5 and 3.0. Results of Gran titration are presented as molarity and can be interpreted as the molarity of hydrogen ions neutralized by proton accepting compounds dissolved in the water.
_CO2Sys calculated from alkalinity and pH_: The CO2Sys model (Pierrot et al., 2006) was used to calculate the partial pressure of carbon dioxide in sampled river water from the measured alkalinity and pH. Partial pressure of carbon dioxide was calculated for both bottle temperature at time of lab analysis and in situ river water temperature at the time of sample collection.
## 2. Data processing methods
This data product is designed to provide the provenance of final tables in a pipeline format, to the degree that provenance is available. Raw data files from instruments and manufacturer software are available in the 01\_input.zip file. The coding used to process the data is available in the 02\_protocol.zip file. In this case, final processing was carried out with R scripts and R markdown files. Incremental files created for the purpose of data processing are available in the 03\_incremental.zip file. Ready-to-use analytical data are available at the data package's root level (on the dataset landing page under the "Resources" section) and are described in the full metadata.
### 2.1. Contents of 01\_input.zip
* _003\_HoboCond\_20200212\_2017-OCT.hobo_ - Binary file for In Situ Hobo electrical conductivity sensor serial number 20200212
* _2021 Site Table.xlsx_ - Microsoft Excel file with authoritative project site list at the time of publication of these data.
* _Cond\_20200211.csv_ - Comma delimited export of data for In Situ Hobo electrical conductivity sensor serial number 20200211
* _Cond\_20200211.hobo_ - Binary file for In Situ Hobo electrical conductivity sensor serial number 20200211
* _Cond\_20200212.csv_ - Comma delimited export of data for In Situ Hobo electrical conductivity sensor serial number 20200212
* _Depth\_20183501\_111517.csv_ - Comma delimited export of data for In Situ Hobo pressure sensor serial number 20183501
* _Depth\_20183502\_111517.csv_ - Comma delimited export of data for In Situ Hobo pressure sensor serial number 20183502
* _intellectual\_rights.txt_ - A text file sourcing the license for data use.
* _people.xlsx_ - Excel file with tabular data on people associated with the project used for metadata generation.
* _SAMI\_P87\_151117.txt_ - Raw file for SAMI pH sensor serial number P87
* _SAMI\_S5u\_151117.txt_ - Raw file for SAMI CO<sub>2</sub> sensor serial number S5u
* _SAMI\_S13u\_151117.txt_ - Raw file for SAMI pH sensor serial number S13u
* _SAMI\_S53u\_151117.txt_ - Raw file for SAMI CO<sub>2</sub> sensor serial number S53u
### 2.2. Contents of 02\_protocol.zip
R code in the protocol depends on R packages: tidyr, readtext, knitr, readxl, EMLassemblyline, and xml2. Code also makes system calls to the zip command using arguments compatible with Info-Zip implementation 3.0, which appear to be mostly consistent with linux zip arguments.
* _meta/_ - Directory with narrative metadata elements incorporated into metadata summary and EML
* _abstract.md_ - A markdown file sourcing the data abstract.
* _methods.md_ - A markdown file sourcing the description of methods.
* _purpose.txt_ - A text file sourcing the description of purpose.
* _supplemental/_ - Directory with supplemental protocol provenance data
* _CO2sys\_Freshwater\_2020.xlsm_ - Version 2.1 (18 September 2012) of the CO2Sys spreadsheet (Pierrot et al., 2006) used to adjust the pH measured in the lab to ambient river temperatures at the time of sampling. (Data are not in this spreadsheet. It is provided for convenience.)
* _.RProfile_ - An R profile file with R code that establishes the appropriate working directory for the R project used to generate this data product.
* _00\_deployment\_notes.docx_ - Microsoft Word document for generating the deployment notes PDF file
* _02\_galen\_tables.Rmd_ - R markdown defining the quality assurance visualizations, tables, and metadata for Galen site data
* _02\_galen\_tables\_compile.R_ - R script that compiles the Galen site R markdown to a PDF document (03\_incremental.zip - Notes\_Galen\_Processing.pdf)
* _03\_racetrack\_tables.Rmd_ - R markdown defining the quality assurance visualizations, tables, and metadata for Racetrack site data
* _03\_racetrack\_tables\_compile.R_ - R script that compiles the Racetrack site R markdown to a PDF document (03\_incremental.zip - Notes\_Racetrack\_Processing.pdf)
* _10\_metadata.Rmd_ - R markdown defining the generation of the metadata file and the EML file based on EDI EML assembly line.
* _10\_metadata\_compile.R_ - R script that compiles the metadata R markdown to an HTML document (metadata.html) and an EML file (eml.xml).
* _99\_runall.R_ - Convenience R script for fully regenerating the data product.
* _base.R_ - Shared utility R code used in R markdown files.
* _RStudioProject.Rproj_ - An RStudio project file provided for convenience in working with the code generating this data product with the appropriate working directory.
### 2.3. Contents of 03\_incremental.zip
* _2017\_UCFR\_Sensor\_Deployment\_Data\_Stackplot\_pCO2\_pH\_T.pdf_ - A visualization generated for data quality assurance purposes. The three plots include time on the abscissa with pH, Temperature, and pCO<sub>2</sub> on separate ordinate axes.
* _Data\_2017\_LTREB\_Bottle\_Data\_For\_QA.xlsx_ - Microsoft Excel file with the original quality assurance data from grab samples compiled by Cory Beatty
* _Data\_2017\_UCFR\_Sensor\_Deployment\_QA.xlsx_ - Microsoft Excel file with the original sensor data compiled by Cory Beatty
* _metadata\_summary.html_ - Summary of metadata and the process of archiving the workflow pipeline and compiling the associated metadata into EML
* _Notes\_Deployment.pdf_ - Original deployment notes compiled by Cory Beatty
* _Notes\_Galen\_Processing.html_ - Notes on generating data tables for Galen site
* _Notes\_Racetrack\_Processing.html_ - Notes on generating data tables for Racetrack site
## 3. References:
Gran, G. 1952. Determination of the equivalence point in potentiometric titrations. Part II. Analyst 77: 661-671. doi: 10.1039/AN9527700661
Lai C.-Z., M. D. DeGrandpre, B. D. Wasser, T. A. Brandon, D. S. Clucas, E. J. Jaqueth, Z. D. Benson, C. M. Beatty, and R. S. Spauldin. 2016. Spectrophotometric measurement of freshwater pH with purified meta-cresol purple and phenol red. Limnology and Oceanography: Methods 14(12) 864-873. doi: 10.1002/lom3.10137.
Pierrot, D. E. Lewis,and D. W. R. Wallace. 2006. MS Excel Program Developed for CO<sub>2</sub> System Calculations. ORNL/CDIAC-105a. Carbon Dioxide Information Analysis Center, Oak Ridge National Laboratory, U.S. Department of Energy, Oak Ridge, Tennessee. doi: 10.3334/CDIAC/otg.CO2SYS\_XLS\_CDIAC105a
## 4. Data product development history
* 2021 August 3: Changed file names, changed cleaning time characterization
* 2021 July 27: Minor corrections, added CO2Sys, updated EDI staging
* 2021 July 22: Updated formatting in methods markdown
* 2021 July 17: Added this dev history log and updated to generate EML