CollinWoo / daynight-Q10

MIT License
2 stars 0 forks source link

Colin - weeks 3 and 4 #8

Closed bpbond closed 4 years ago

bpbond commented 4 years ago
  1. Identify soil temperature columns
  2. Go through them one by one. Extract the depth and put it into its own column, and then put the calculated Q10 into its own column
main_results <- list()
for( ... a loop through the datasets ...) {

results <- data.frame(columns = temperature_columns, depth = NA, q10 = NA, n = NA)
for(tcol in temperature_columns) {
     results$depth <- ...
     results$n <- nrow(dat)
     results$q10 <- calc_q10(dat[tcol], dat$flux)
}

main_results[[dataset]] <- results
}

main_results <- bind_rows(main_results, .id = "Dataset")
bpbond commented 4 years ago

This is all inside a larger loop going through the datasets themselves.

In the above code I'm assuming that temperature_columns is a character vector holding the names of CSR_Txxx columns.

bpbond commented 4 years ago

There is CSR_TAIR and/or CSR_TCHAMBER. Be careful with these - you will want to set depth to ...? Let's say -1 for now.

bpbond commented 4 years ago

Here's a better grep: tcols <- grep("^CSR_T(AIR|[0-9]+)", names(dsd))

bpbond commented 4 years ago

Next steps after 2020-07-23 phone call with @jinshijian and @10aDing :

bpbond commented 4 years ago

So the output data frame from the above processing should look something like this

bpbond commented 4 years ago

@jinshijian noted good idea of start with just one dataset, work all the way through developing pipeline, and after robust you can expand to all

bpbond commented 4 years ago

Notes from call with @10aDing 2020-07-29:

bpbond commented 4 years ago

Let's stick with just calculating for Rh for now.