Giter VIP home page Giter VIP logo

daynight-q10's People

Contributors

bpbond avatar collinwoo avatar jinshijian avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar

daynight-q10's Issues

Next steps in Q10 work

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

Additional Graphs

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.

Visualizations

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.

Progress?

Hi @10aDing — can you let me know progress and where you are? Thanks! Have a good weekend.

Colin - weeks 3 and 4

  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")

More on calculating Q10

  • Record p_value of the slope, so we can filter out those days with no significant relationship
  • Record mean (TS), so we can compare whether there is difference between day-time and night-time temperature
  • Record mean (SM), so we can analyze whether day-time and night-time soil moisture are different
  • Calculate Ra (=Rs-Rh), then calculate Q10 of Ra? This can support the Ra vs Rh Q10 difference analysis

Small R2 Values

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.

New next steps!

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.)

Code Efficiency

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)
}

calc_q10 function

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 
}

Reading grib data

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:
image

Weeks 5-6

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:

  • @bpbond needs to give a feedback PR
  • We'd like to add a few Q10 calculation statistics - R2, P, and N
  • Also calculate for Rs but only for datasets with Rh - this will let us make nice comparison. So now there will be a column in the output dataset saying whether it's Rh or Rs
  • Effective visualization of these data - let's dive into this around August 10th - with @jinshijian and @stephpenn1

QA/QC thoughts:

  • summary() for the entire dataset
  • summary statistics for the entire dataset

First steps

Hi @10aDing -

What a sparkling clean new repository! 👏

I would suggest start by familiarizing yourself with the COSORE database and cosore package:

  • The draft manuscript on this is here
  • Work through the vignette in R

Let me know if you have questions.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.