lter / soilHarmonization

Homogenize LTER Soil Organic Matter Working Group data and notes
https://lter.github.io/soilHarmonization/
Other
1 stars 4 forks source link

calculated variables #31

Closed wwieder closed 4 years ago

wwieder commented 4 years ago

From our call today let's go ahead and provide standardized calculations for common results we'd like to see in the tarball.
When these are already provided in the database let's use the orig. value, We need to avoid dividing by zeros but otherwise they can be calculated like this:

Can you think of others?

wwieder commented 4 years ago

connected to https://github.com/lter/lterwg-som/issues/61

srearl commented 4 years ago

Will - I addressed some of these in an updated tarball (2019-09-28) but note that I uploaded it to the project directory but not yet to Shiny as i wanted to check with you on these first. Per your email, instead of creating new variables with _calc, I simply updated the existing variable as appropriate (e.g. missing lyr_c_to_n values were updated from lyr_soc / lyr_n if available & if lyr_c_to_n was not provided by the data provider). Of course this means that the user will not know if the CN value is derived. The exception to this is layer_thick_calc - here I did calculate a new variable since there is not already a variable pertaining to thickness. Please verify what we want to do with soc and soc_stock, these are a bit confusing so want to be sure that I get those correct.

tarball: https://drive.google.com/open?id=1rnmePE5YQdFKTr22fsBSSN2ng06MiKHa

tarball edits: https://github.com/lter/lterwg-som/blob/master/data-aggregation/harvest_HMGZD_local.R#L168

cc @piersond

wwieder commented 4 years ago

Thanks for getting started on this @srearl! I'm not really clear what the confusing is here on soc vs. soc_stock? Are some of these data not necessarily provided as expected? The calculation should be done as in the R script I provided soc_stock = lyr_soc thickness lyr_bd * 100 (to go from %C to g/m2, our target units?). Given the complications & potential for confusion, however, I wonder if we should provide the new _stock_calc fields on this one?

Your note on layer_thick is a little confusing. There are some datasets that use -1 or -10 to indicate the top of organic horizons. This should be OK. If these the meaning of layer_top and _bottom are swapped in other datasets (and this is done consistently) it makes me wonder if we should correct values in the key-key, instead of using the abs value?

My last questions is if we can put the latest tarball up on the shiny server? I'm curious if we're ending up with calculated values that are are obviously not realistic (my guess is yes), but wonder if the information that these were calculated by us vs. provided in a dataset would make any difference in how users ultimately use the data in the tarball?

Lots here, I'll be in a little later this AM, but happy to talk if it's helpful. Will

wwieder commented 4 years ago

let's also calculate soil texture where only 2 of 3 variables are provided silt = 100-(clay+sand) clay = 100-(silt + sand) sand = 100-(clay + silt)

srearl commented 4 years ago

not much to calculate here, only a few values for silt but the calcs are now added so we will have them for future data