Skip to content

Commit

Permalink
Upload most recent version of test_workflows.R
Browse files Browse the repository at this point in the history
  • Loading branch information
rfiorella committed Aug 12, 2021
1 parent 9f6e2d0 commit faaaa4a
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions test_workflows.R
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
# 7) calibrate_water_linreg_bymonth works
# 8) calibrate_water_linreg_bysite works

library(NEONiso)

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

Expand All @@ -25,13 +27,13 @@ dir.create(paste0('/Volumes/GradSchoolBackup/NEONcal/',test_date,"_tests"))
# which tests to run?
run_test1 <- FALSE
run_test2 <- FALSE
run_test3 <- TRUE
run_test3 <- FALSE
run_test4 <- TRUE
run_test5 <- TRUE
run_test6 <- TRUE
run_test5 <- FALSE
run_test6 <- FALSE
run_test7 <- FALSE
run_test8 <- FALSE
rapid_test <- TRUE # if rapid, only run ~5% of possible site months.
rapid_test <- FALSE # if rapid, only run ~5% of possible site months.

# load required packages:
library(rhdf5)
Expand Down Expand Up @@ -181,15 +183,15 @@ if (run_test3) {
}

if (run_test4) {
dir.create(paste0('/Volumes/GradSchoolBackup/NEONcal/',test_date,'_tests/04'))
dir.create(paste0('/Volumes/GradSchoolBackup/NEONcal/',test_date,'_tests/04a'))

for (i in 1:length(csites)) {

fin <- list.files(paste0(data.dir,csites[i],'/') , pattern = '.h5', full.names=TRUE)
fout <- list.files(paste0(data.dir,csites[i],'/'), pattern = '.h5', full.names=FALSE)

calibrate_carbon(fin,
paste0('/Volumes/GradSchoolBackup/NEONcal/',test_date,'_tests/04/',fout[1]),
paste0('/Volumes/GradSchoolBackup/NEONcal/',test_date,'_tests/04a/',fout[1]),
site=csites[i], r2_thres = 0.95,
calibration_half_width = 100000)
}
Expand Down Expand Up @@ -256,7 +258,7 @@ if (run_test8) {
dir.create(paste0('/Volumes/GradSchoolBackup/NEONcal/',test_date,"_tests/08"))

for (i in 1:length(wsites)) {
calibrate_water_linreg_bysite(paste0(data.dir,wsites[i],'/'),
calibrate_water(paste0(data.dir,wsites[i],'/'),
paste0('/Volumes/GradSchoolBackup/NEONcal/',test_date,'_tests/08/'),
site=wsites[i], r2_thres = 0.95,
calibration_half_width = 100000)
Expand Down

0 comments on commit faaaa4a

Please sign in to comment.