Skip to content

Commit

Permalink
Merge pull request #80 from lanl/cv-testing
Browse files Browse the repository at this point in the history
Merge cv testing to main, to make consistent with 0.6.0 release
  • Loading branch information
rfiorella authored Sep 20, 2022
2 parents 76deb48 + 0405a35 commit 1b37b1c
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 16 deletions.
2 changes: 0 additions & 2 deletions .Rbuildignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@
^uncertainty_testing\.R$
^test_workflows_parallel\.R$
^test_workflows_parallel\.log$
^uncertainty_analysis\.R$
^extract_data_for_Gabe\.R$
^refCorrections\.xlsx$
^make_ref_corrections_data\.R$
^LICENSE\.md$
11 changes: 6 additions & 5 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Package: NEONiso
Type: Package
Title: Tools to Calibrate and Work with NEON Atmospheric Isotope Data
Version: 0.6.0.9000
Version: 0.6.0
Authors@R: c(person("Rich", "Fiorella", email = "rfiorella@lanl.gov",
role = c("aut", "cre"), comment = c(ORCID = "0000-0002-0824-4777")))
Maintainer: Rich Fiorella <rfiorella@lanl.gov>
Expand All @@ -11,11 +11,12 @@ Description: Functions for downloading,
calibrating, and analyzing atmospheric isotope data bundled
into the eddy covariance data products of the National Ecological
Observatory Network (NEON) <https://www.neonscience.org>.
In this version, calibration tools are provided for only the
carbon isotope products. Tools for calibrating water isotope
products are under development. More details are found in Fiorella et al. (2021)
Calibration tools are provided for carbon and water isotope products.
Carbon isotope calibration details are found in Fiorella et al. (2021)
<doi:10.1029/2020JG005862>, and the readme
file at <https://github.com/lanl/NEONiso>.
file at <https://github.com/lanl/NEONiso>. Tools for calibrating water
isotope products have been added as of 0.6.0, but have known deficiencies
and should be considered very experimental currently.
License: GPL-3
BugReports: https://github.com/lanl/NEONiso/issues
URL: https://github.com/lanl/NEONiso
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ There will be two major changes and a minor change coming to this package in the

Several months of data on the NEON data portal have an issue where the Picarro time clock has diverged from the valve manifold time. A fix has been developed, but has not been propagated to the NEON data portal.


## Copyright notice:

© 2022. Triad National Security, LLC. All rights reserved.
Expand Down
20 changes: 11 additions & 9 deletions test_workflows.R
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
# 8) calibrate_water_linreg_bysite works

# where does uncalibrated data live?
data.dir <- '~/airflow/data/01-DP4_00200_001/'
data.dir <- '~/Desktop/DP4_00200_001/'

# set test_date
#test_date <- "2022-01-01"
Expand All @@ -27,22 +27,22 @@ devtools::load_all()
dir.create(paste0('~/NEONcal/',test_date,"_tests"))

# which tests to run?
run_test1 <- TRUE
run_test1 <- FALSE
run_test2 <- FALSE
run_test3 <- FALSE
run_test3 <- FALSE
run_test4 <- FALSE
run_test5 <- FALSE
run_test6 <- FALSE
run_test7 <- FALSE
run_test8 <- FALSE
run_test8 <- TRUE
rapid_test <- FALSE # if rapid, only run ~5% of possible site months.

# load required packages:
library(rhdf5)
library(dplyr)
library(lubridate)

#----------------------------- -----------------------
#----------------------------------------------------
# Carbon tests:
#----------------------------------------------------
# calibrate_carbon_bymonth tests:
Expand Down Expand Up @@ -78,7 +78,8 @@ if (run_test1 | run_test2 | run_test3 | run_test5) {
}

if (run_test4 | run_test6) {
csites <- c(NEONiso:::terrestrial_core_sites(), NEONiso:::terrestrial_relocatable_sites())
#csites <- c(NEONiso:::terrestrial_core_sites(), NEONiso:::terrestrial_relocatable_sites())
csites <- "ONAQ"
}

# water files
Expand All @@ -100,13 +101,14 @@ if (run_test7) {

# get names only.
wnames.lst <- strsplit(wnames,split="/")
wnames.tmp <- sapply(wnames.lst,'[[',7)
wnames.tmp <- sapply(wnames.lst,'[[',8)

wnames.out <- gsub(".h5",".calibrated.h5",wnames.tmp)
}

if (run_test8) {
wsites <- NEONiso:::water_isotope_sites()
# wsites <- NEONiso:::water_isotope_sites()
wsites <- "ONAQ"
}

# if we're doing rapid testing!
Expand Down Expand Up @@ -187,7 +189,7 @@ if (run_test4) {
fout <- list.files(paste0(data.dir,csites[i],'/'), pattern = '.h5', full.names=FALSE)

calibrate_carbon(fin,
paste0('~/NEONcal/',test_date,'_tests/04/',fout[1]),
paste0('~/NEONcal/',test_date,'_tests/04/',fout[length(fout)]),
site=csites[i], r2_thres = 0.95,
calibration_half_width = 100000)
}
Expand Down

0 comments on commit 1b37b1c

Please sign in to comment.