forc-db / ERL-review

Analyses supporting Environmental Research Letters review paper
Creative Commons Attribution 4.0 International
0 stars 0 forks source link

Write code outputting numbers to fill in forest C cycle diagrams #6

Closed teixeirak closed 6 years ago

teixeirak commented 6 years ago

We will want to create a series of ensemble C cycle diagrams similar to this one (Anderson-Teixeira et al. 2016 GCB):

image

Forest types will be:

@ValentineHerr, please create code that outputs the statistics (calculated in issue #2) as text as in this figure for easy copy/pasting into the figure.

teixeirak commented 6 years ago

@ValentineHerr, see this file for mapping of variables onto C cycle diagram. I'm also recording conversion factors and data filters that should be applied. I will create an accompanying readme file to explain.

teixeirak commented 6 years ago

I've added a rough draft version of the C cycle diagram. There are some changes, including adding some additional variables and moving the stocks off to the side. @ValentineHerr, I hope this doesn't conflict with your progress on this issue. There's plenty of flexibility here, so please let me know what you think.

ValentineHerr commented 6 years ago

@teixeirak ,

I built the frame for the figure:

image

There will be minor adjustments but I believe it is looking good. Right? Are the stock supposed to be changing size like the arrows?

Next step will be to calculate the values and bring the right painting in the background (I created a folder here to store them. I probably will need some more guidance on how to use this file, especially variables like NEE_cum_C. Maybe we can talk in person when you come back. I need to continue on Iara and Craig's modelling this afternoon.

teixeirak commented 6 years ago

This is great; thank you! I'm so glad that you're able to automate this. It is generally looking good. There will be some minor cleanup/ adjustments, but the concept is solid.

A few adjustments for now:

ValentineHerr commented 6 years ago

I'll incorporate changes, no problem. I should be able to make the semi-transparent boxes. I think the resolution of the image can be improved. I just copy-pasted in github and probably lost a lot there.

teixeirak commented 6 years ago

Great! Yes, I think Github reduces the resolution. The figure at the top of this issue obviously became fuzzy when pasted here.

teixeirak commented 6 years ago

@bpbond, @nkunert, and @hmullerlandau, if you would like to review/ comment on the C cycle diagrams (other than trivial changes), now is the best time. Here is the rough draft version of the C cycle diagram that Valentine is automating in R. This file maps the ForC variables onto the C cycle diagram (e.g., indicates which are and are not mapped, groups similar variables).

bpbond commented 6 years ago

Wow @ValentineHerr nice work - cool to have this automated. I assume your code will be able remove the toucan for a temperate forest, and add a moose for boreal, etc.? :)

Seriously though, I like the figure, although the two Rsoil sub-arrows dominating the middle might be moved to the right, for visual symmetry and better clarity? (I.e. more like in @teixeirak 's original Powerpoint.)

teixeirak commented 6 years ago

I wouldn’t be surprised if @ValentineHerr could write R script to paint a moose, but we won’t go there because I don’t want to automate away my job!

Valentine nicely reproduced my earlier, ugly rough draft, so please base comments on this file under the assumption that she'll be able to replicate it.

teixeirak commented 6 years ago

@ValentineHerr, please check your code-- I'm looking at eddy flux (GPP, NEE, Reco) records from tropical forests, and something is wrong. I believe there should be only one record for young forests, and I'm counting at least 10 geographic areas for mature forests. I'm also noting that the young forests have a lot more data than they should based on the TropForC review paper.

ValentineHerr commented 6 years ago

Good catch, the script that created the variable averages per Biome was not handling age correctly. I think I fixed the problem. Let me know if you find anything else.

teixeirak commented 6 years ago

Looks good. I'll let you know if I catch anything else.

Another minor thing-- How are you scaling the arrows for young forests where the flux is a function of age? Let's scale according to the predicted value for forests at age 50.

teixeirak commented 6 years ago

Also, please switch order of equations at the bottom of the diagram so that they're in sequential order.

teixeirak commented 6 years ago

@ValentineHerr, some more small modifications on this (also listing the two above):

ValentineHerr commented 6 years ago

I believe I covered every thing above. I decided to use dashed lines for the arrows where there is less than 10 geographic.areas. Let me know if you don't like it.

Should I separate BNPP variables? I am thinking that we could have BNPP stop half way and split into 2 arrows for fine and coarse. That way those arrows could also have attributes relative to the amount of data we have and to the mean value (or predicted value at age 50).

teixeirak commented 6 years ago

Yes, good idea to separate BNPP. Please put BNPP_coarse on the right side (closer to the tree).

I think the dashed lines work well, but we might think about the sample size cutoff. 10 geographic areas is a fairly high bar.

ValentineHerr commented 6 years ago

could be 10 plots ?

I pushed my changes on BNPP.

teixeirak commented 6 years ago

I'd prefer to stick with geographic areas, as I'm concerned about pseudoreplication. Let's lower the threshhold to 7.

Please do the same for the stocks-- outline boxes with dashed lines when <7 geographic areas.

ValentineHerr commented 6 years ago

Ok I've changed the threshold to 7 and made the dash line for stocks too.

Next and hopefully last step for this issue will be to put the right background behind each diagram.

teixeirak commented 6 years ago

This is looking great.

Could you please change to fitting functions of ln[age], as in issue #11? Note that we may eventually put in more specialized functions for certain variables, but ln[age] seems to be fairly good as a generic function.

ValentineHerr commented 6 years ago

Just as a note, the fitting functions won't be exactly the same as in issue #11 since we are working one biome at a time here. In other words, Biome won't be a fixed effect in these equations.

teixeirak commented 6 years ago

That's fine, and actually preferable in that we expect differences in the slope with age across biomes that can't be detected through those analyses. An alternative to consider for issue #11 would be plotting these relationships instead of the model with biome as a fixed effect, but that would exclude biome-variable combinations with lower sample sizes, so let's leave it as is for now.

ValentineHerr commented 6 years ago

I made the following changes but none of the results turned out significant:

All the equations disappeared in the diagrams. If we remove plot name from the random effects, we get some of them back (and actually we get extra more for Temperate Conifer YOUNG, probably due to the log of age...)

Let me know what you think.

teixeirak commented 6 years ago

Plot.name should be left out (for young forests only) because plot names often indicate different sites in a chronosequence. For mature forests, plot. name should either be included as a random effect nested within geographic.area or we should compute an average for each plot (weighted by sampling time) before conducting the analysis.

teixeirak commented 6 years ago

The rest sounds good.

ValentineHerr commented 6 years ago

I thought the modeling was only for young forest. I was following issue #2

teixeirak commented 6 years ago

You're right, sorry for the confusion.

teixeirak commented 6 years ago

This is basically done, so I'm closing. Minor cleanup will be part of issue #18.