collinwoo / daynight-q10 Goto Github PK
View Code? Open in Web Editor NEWLicense: MIT License
License: MIT License
Johnston, A. S. A. and Sibly, R. M.: The influence of soil communities on the temperature sensitivity of soil respiration, Nat Ecol Evol, 2(10), 1597–1602, 2018. http://dx.doi.org/10.1038/s41559-018-0648-6
Suseela, V., Conant, R. T., Wallenstein, M. D. and Dukes, J. S.: Effects of soil moisture on the temperature sensitivity of heterotrophic respiration vary seasonally in an old-field climate change experiment, Glob. Chang. Biol., 18(1), 336–348, 2012. http://dx.doi.org/10.1111/j.1365-2486.2011.02516.x
Reanalaysis climate data
There has been trouble downloading the L03 files from https://gimms.gsfc.nasa.gov/SMOS/jbolten/FAS/L03/. We should try to find a way to download all the files in a timely and practical manner, probably by using FTP to ftp://gimms.gsfc.nasa.gov/SMOS/jbolten/FAS/.
The conclusion section of my SRP still lacks some analysis. More suggestions for graphs that could lead to further insight would be appreciated. This issue is for suggestions for graphing the COSORE data.
Hi @10aDing can you paste in some of your current data visualizations so we can discuss.
Also to-do from our call: join MAT/MAP with Q10 tables, and then graph MAT (x) versus MAP (y), coloring points by computed Q10.
Hi @10aDing — can you let me know progress and where you are? Thanks! Have a good weekend.
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")
It seems that a large amount of the variability in the model is unaccounted for as indicated by small R2 values. It would be preferable to reduce this variability, or at least verify that the variability isn't caused by errors in calculation.
1 - tag me or @jinshijian for suggestions on improving code efficiency
2 - drake? same thing, one of us can demonstrate and set up if interested
3 - start with annual values, computing for each site-year: mean soil moisture, mean soil temperature, Q10, MAT and MAP; include IGBP
4 - plot temperature versus soil moisture versus Q10 (e.g. a geom_tile()
or geom_point()
or multi-panel
(Extensions to this could include computing by site-year-chamber, and/or site-year-month.)
The code I wrote to extract the moisture from multiple files (SMOStif) takes about three minutes to run with the large dataset of 100,000 timestamps. Finding a way to reduce this runtime would be desirable. The code is pasted below:
SMOStif <- function(datevec, lon, lat){
tifiles <- list.files("LO3_tif")
dateFiles <- list()
fileDates <- unique(as.Date(datevec))
for(date in fileDates){
probDate <- c(date-1, date, date+1)
probDate %>% lapply(as.Date) %>% lapply(format, "%Y%m%d") -> probDate
probDate[1] <- paste0(probDate[1], "_")
probDate[3] <- paste0("_",probDate[3])
patterns <- paste(probDate, collapse="|")
matchfiles <- tifiles[grep(patterns, tifiles)]
if(length(matchfiles) >0){
matchfiles <- paste0("./LO3_tif/", matchfiles)
}
fileRow <- data.frame(Surface.File = matchfiles[1], Subsurface.File = matchfiles[2])
dateFiles[[toString(as.Date(date))]] <- fileRow
}
bind_rows(dateFiles, .id = "Date") %>%
distinct(Surface.File, .keep_all = TRUE) %>%
filter(!is.na(Surface.File)) -> dateFiles
#I can't use mutate on the raster function so I thought this for loop was the next best option
if(nrow(dateFiles) > 0){
for(value in 1:nrow(dateFiles)){
dateFiles[value, 4] = extractSMOS(dateFiles[[value, 2]], lon, lat)
dateFiles[value, 5] = extractSMOS(dateFiles[[value, 3]], lon, lat)
}
}
dateFiles %>% rename(Surface = V4, Subsurface = V5) %>%
mutate(Lon = lon, Lat = lat)-> dateFiles
print(dateFiles)
return(dateFiles)
}
This is in many ways the central function--it will be used a LOT. It will take two inputs, temp and resp, and determine the Q10 (temperature sensitivity).
calc_q10 <- function(temp, resp) {
# remove any negative flux values
# fit a linear model (see function "lm") of ln(resp) as a function of temp
# calculate q10 as exp(10b) where b is the slope of the linear regression
}
I don't know what the data in the .grib files are trying to convey. The projection type seems to be stereographic (https://proj.org/operations/projections/stere.html), so I have no idea if it extracts data based on latitude and longitude. My function for extracting moisture data from specific coordinates seems to only work for very specific values and returns NA for all others. Having a better understanding of stereographic projections and how to convert them to other formats (namely, latlon) would be a good start.
Here is an image of the information in the raster object extracted from one of the .grib files:
At this point we have a big data frame (6K rows?) with weekly Q10 values, for Rh, by dataset, year, week, day/night, and soil temperature depth.
Next steps:
QA/QC thoughts:
summary()
for the entire datasetIt is good to identify what is the percentage of Rh also reported Ts
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.