Read in Boca Rio Manta time series, 2022-08-12 to 2022-09-30, calibration logs, back-calibrate RV values, and recalculate TRYP and CDOM values from the RV values and a “stable” calibration based on long-term mean RV-TYRP values for the Boca Rio sonde (SN 4105).

Read in Boca Rio Manta data

##             Date.time Temperature   pH ORP Depth  Cond TURB  HDO CDOM
## 1 2022-08-12 13:00:00       22.15 8.08 149  0.51 46970 3.40 7.32 30.2
## 2 2022-08-12 13:10:00       22.81 8.02 147  0.51 46270 4.10 6.65 32.0
## 3 2022-08-12 13:20:00       23.21 7.97 142  0.51 45650 4.75 6.22 33.8
## 4 2022-08-12 13:30:00       23.34 7.96 143  0.51 45560 5.13 6.03 33.0
## 5 2022-08-12 13:40:00       23.59 7.92 143  0.51 45210 5.23 5.68 33.9
## 6 2022-08-12 13:50:00       23.64 7.92 144  0.51 45090 5.43 5.57 33.6
##   Chlorophyll TRYP
## 1         2.0 12.1
## 2         2.6 12.3
## 3         2.8 12.4
## 4         2.8 12.4
## 5         3.0 13.1
## 6         3.0 12.6
## [1] "2022-08-12 13:00:00 PDT" "2022-09-27 09:30:00 PDT"

Plot time series for QAQC

Plot conductivity (identifies when sonde is dry)

Plot regular time series of turb, cond, tryp, cdom Zoom into the sampling period

Load in QAQC notes

Make sure it worked by plotting resulting time series on top of original

Read in Boca Rio cal logs

Plot time series with calibration dates on top

Plot all time series together, with calibration dates in purple to check for discontinuities Discontinuities could be due to cleaning, so not alwasy a problem.

## [1] "No zero point in the calibration.  Assuming RV value at new calibration value is long-term min RV"

## [1] "No zero point in the calibration.  Assuming RV value at new calibration value is long-term min RV"

##         manta            date sensor serial_no units          rv   old new  srf
## 81 MT01204105  8/3/2022 17:46   TRYP      2081   ppb 0.099707100    NA 100 <NA>
## 83 MT01204105 8/30/2022 17:46   TRYP      2081   ppb 0.019941420 19.94 100  100
## 84 MT01204105 8/30/2022 17:48   TRYP      2081   ppb 0.005521238  5.52   0  100
## 91 MT01204105   9/9/2022 9:57   TRYP      2081   ppb 0.015921590 72.12 100  100
##                                                                         comment
## 81 Filler from 8/30. Factory cal was 20ppb but 5x too low based on 8/30 reading
## 83                                                                             
## 84                                                                         Done
## 91                                                                         Done
##              Date.time       Date
## 81 2022-08-03 17:46:00 2022-08-03
## 83 2022-08-30 17:46:00 2022-08-30
## 84 2022-08-30 17:48:00 2022-08-30
## 91 2022-09-09 09:57:00 2022-09-09

Plot original and RV values. Note that for the sampling event (9/9/2022), there is little change, because the calibration for the sampling time had similar parameters as the default recalibration. Note that the red time series, which is in the final output, exludes the data from the QAQC flagged times.

Zoom into the sampled time period

## [1] "No zero point in the calibration.  Assuming RV value at new calibration value is long-term min RV"

## [1] "No zero point in the calibration.  Assuming RV value at new calibration value is long-term min RV"

##         manta            date sensor serial_no units         rv    old new  srf
## 82 MT01204105  8/3/2022 17:46   CDOM  21201199   ppb 2.17338500     NA 300 <NA>
## 87 MT01204105 8/30/2022 18:27   CDOM  21201199   ppb 2.17338500 226.70 300  100
## 88 MT01204105 8/30/2022 18:29   CDOM  21201199   ppb 0.02398879   0.80   0  100
## 92 MT01204105  9/9/2022 10:03   CDOM  21201199   ppb 2.80593300 388.28 300  100
##                                                                   comment
## 82 Filler from 8/30 b/c it's a new sensor with no prior calibration data.
## 87                                                                       
## 88                                                                   Done
## 92                                                                   Done
##              Date.time       Date
## 82 2022-08-03 17:46:00 2022-08-03
## 87 2022-08-30 18:27:00 2022-08-30
## 88 2022-08-30 18:29:00 2022-08-30
## 92 2022-09-09 10:03:00 2022-09-09

##         manta            date sensor serial_no units        rv    old new srf
## 73 MT01204105   8/3/2022 8:30   TURB       922   FNU 0.0224999  -1.14   0 N/A
## 74 MT01204105   8/3/2022 8:32   TURB       922   FNU 0.9621580 756.10 600  80
## 85 MT01204105 8/30/2022 18:17   TURB       922   NTU 0.1488130  79.14 100 N/A
## 86 MT01204105 8/30/2022 18:19   TURB       922   NTU 0.0223966  -0.06   0  96
## 89 MT01204105   9/9/2022 9:46   TURB       922   NTU 0.1365210  90.41 100 N/A
## 90 MT01204105   9/9/2022 9:47   TURB       922   NTU 0.0225750   0.08   0 107
##    comment           Date.time       Date
## 73         2022-08-03 08:30:00 2022-08-03
## 74    Done 2022-08-03 08:32:00 2022-08-03
## 85         2022-08-30 18:17:00 2022-08-30
## 86    Done 2022-08-30 18:19:00 2022-08-30
## 89         2022-09-09 09:46:00 2022-09-09
## 90    Done 2022-09-09 09:47:00 2022-09-09

Apply standard calibration to TRYP, CDOM, TURB TRYP: RV = 0.004 (0 ppb), RV = 0.016 @ 100ppb

Zoom in on 9-9-2022 to 9-12-2022. Original and recalibrated values are nearly the same…the calibraiton log values for 2022-09-09 were close to the “standard calibration.”

Add flags

Write to a new file