Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Script to calc site level mean SOC and standard dev #72

Open
piersond opened this issue Oct 22, 2019 · 10 comments
Open

Script to calc site level mean SOC and standard dev #72

piersond opened this issue Oct 22, 2019 · 10 comments
Assignees

Comments

@piersond
Copy link
Contributor

How do we do this with the variable experimental structures? missing data? outliers? etc.

@wwieder
Copy link
Collaborator

wwieder commented May 7, 2020

One helpful resource I'd still like to see is a table from SoDaH that replicates Table C1 from this paper with data from all the sites (or at least NEON, LTER, and NutNet sites).
https://www.geosci-model-dev.net/8/1789/2015/gmd-8-1789-2015.pdf

Below are some suggestions that may make this easier:

  • I'd focus on the top mineral horizon (0-x cm), or maybe the top several so we can at least cover 0-10 cm.
  • We can report the mean & std dev for each variable out of control plots.
  • Additional fields to consider would be lat, lon, layer_bot, vegetation cover / ecosystem type, soil C:N.
  • Litter chemistry and ANPP may be a pain to track down, but should be doable for NEON. NOTE, litter chemistry is only available from forest sites, but foliar chemistry is more widely measured, see more on this repo link
  • We'll have to think about how to handle gradients, but at this point I'm included to just include them

From there we'd have to think about where we want to go, but I can imagine this kind of summary table will be useful for a variety of questions & applications.

@wwieder
Copy link
Collaborator

wwieder commented Jul 6, 2020

@piersond is this something you think you're able to think about?
@EmilyKykerSnowman would this be helpful for your paper?
@srearl, is this something Nathan can do?

@brunj7
Copy link
Contributor

brunj7 commented Jul 6, 2020

@wwieder @srearl Feel free to reach out to me if you need help on a specific task and we can further discuss. We have more support capacity over the summer.

@piersond
Copy link
Contributor Author

piersond commented Jul 6, 2020

@wwieder I have some time this week to start outlining a script for pulling the site means.

@piersond
Copy link
Contributor Author

I've uploaded a start to the script on GitHub, here.

For now, it's a straightforward group and summarize, and the script only dives into the process of pulling together the soil C data. When we get the soil C summary to work right, I expect we can find points along the way to revise and pull MAP, MAT, etc.

Script pulls the SoDaH database from the EDI script in the parent folder and all looks good so far.

Questions:

  1. @wwieder The example table reports C stocks, so I'm assuming we're confined to using lyr_soc_stock_calc? Is lyr_soc relevant to the table without bulk density? So much more data in lyr_soc...thoughts?

  2. @srearl Any ideas on a good way to sum soil C over depth increments? The curve ball is that sometimes the depth increments have gaps. So, I'm thinking we'll have to pass the data one sample location at a time through a function that can both find and extrapolate over the depth gaps, then sum the analyte (e.g. soil C) by depth increment to a specified target depth. I'm glad to get started on such a function, but I'm also wondering if Nathan would be interested in giving it a shot? Might also be worthwhile to talk it through on Zoom to either outline the function or to see if we can find a better approach.

@wwieder
Copy link
Collaborator

wwieder commented Jul 14, 2020 via email

@srearl
Copy link
Contributor

srearl commented Jul 14, 2020

Thanks for getting this started @piersond. Could you hold my hand a little bit, and point me to an example of where the gaps come into play? Also bringing @NateHaywood into this loop.

@piersond
Copy link
Contributor Author

@srearl Sorry about the delayed response. I outlined a functional approach to analyte stock calcs by lat-long location last night. I'll touch base when I have the script working and we can all discuss.

@srearl
Copy link
Contributor

srearl commented Jul 21, 2020

cool and no worries - @NateHaywood is already starting to tune on this so let us keep him in the loop

@piersond
Copy link
Contributor Author

piersond commented Jul 23, 2020

The calc_profile_stocks.R script is now functional, though it still needs a lot of proofing, an option to calc stocks using bulk denisty (right now it's doing a profile avg for lyr_soc), and further summary functions to combine near locations.

You can see the output for lyr_soc in this table. The 1's and 2's in the table rows are error codes for locations that have only one layer, or have many layers that overlap.

@wwieder if you have a few minutes next week, let's discuss the more exact details for the tbl values. i.e. how to combine locations? depth limits? Shouldn't take long to work up those final lyr_soc numbers from where the script stands now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants