forc-db / ForC

Global Forest Carbon Database
https://forc-db.github.io/
Creative Commons Attribution 4.0 International
54 stars 24 forks source link

finish/load script to plot climate of ForC sites #36

Closed teixeirak closed 7 years ago

teixeirak commented 7 years ago

Please load the script used to create this figure: image

Modify as follows:

bpbond commented 7 years ago

I did something similar recently, plotting a database over the CRU climate data to produce this figure: climate_space Happy to share code/data if useful.

teixeirak commented 7 years ago

I'd like to put that in the background of this figure; it would be great if you could share the code.

bpbond commented 7 years ago

Here's the relevant code:

read_csv("outputs/crudata_period.csv.gz") %>%
  print_dims() %>%
  # bin by temp and precip
  mutate(tmp_round = round(tmp / 2, 0) * 2, 
         pre_round = round(pre / 300, 0) * 300) %>%
  group_by(tmp_round, pre_round) %>%
  summarise(area_km2 = sum(area_km2)) ->
  crudata_period

p <- ggplot(crudata_period, aes(tmp_round, pre_round)) + 
  geom_tile(aes(fill = area_km2)) + 
  scale_fill_continuous(low = "lightgrey", high = "black", guide = FALSE) +
  geom_point(data = srdb, aes(mat_hadcrut4, map_hadcrut4, color = Study_midyear), alpha = I(0.5)) + 
  scale_color_continuous(guide = FALSE) +
  xlab(expression(MAT~(degree*C))) + ylab("MAP (mm)")
print(p)
bpbond commented 7 years ago

crudata_period.csv.gz

Here's the data file this code reads, a summary of CRU data for 1990-2014. I can compute another period if you'd prefer.

teixeirak commented 7 years ago

Thanks! That time period is great. @ValentineHerr, could you please take a stab at this?

ValentineHerr commented 7 years ago

@teixeirak where should we store CRU data? If we use it in the code it should be somewhere.

teixeirak commented 7 years ago

Assuming its okay to make it public (@bpbond ?) , lets add a separate "supplementary resources" folder and put it there.

ValentineHerr commented 7 years ago

climate_of_forc_sites

@teixeirak, is this figure working for you ? (I tried to attach it, let me know if that doesn't work).

ValentineHerr commented 7 years ago

It needs some twists probably... @teixeirak, Do you want me to create a new directory to archive the figures ?

teixeirak commented 7 years ago

(a) looks wonderful! One small change-- let's do the same as in the original version with black symbols for ForC climate values and white/black outline symbols for those pulled from a database.

for (b),

Considering the changes to b, it will probably be best to have them stacked instead of side-by-side. There are no size restrictions, so feel free to make them big.

Yes, please create a figures directory.

ValentineHerr commented 7 years ago

For empty symbols, I was using a file called "SITES.missing.map.mat.WorldClim". Should I upload it into "supplementary resources"? I also have the script that creates that file. should I uploaded it too ? If yes, do you want it in "scripts/archive" or "supplementary resources"?

teixeirak commented 7 years ago

let's put both in a folder called supplementary resources/WorldClim data

bpbond commented 7 years ago

Re public data, sure, it's just summarized HadCRUT4 data, and those are public.

Figure looks great!

ValentineHerr commented 7 years ago

climate_of_forc_sites @teixeirak is this better/good to go?

teixeirak commented 7 years ago

Perfect! Your idea for the Koppen plot was better than mine.

On Aug 23, 2017, at 5:36 PM, ValentineHerr notifications@github.com<mailto:notifications@github.com> wrote:

[climate_of_forc_sites]https://user-images.githubusercontent.com/19673377/29639622-67bb187a-8829-11e7-922d-e058c36be097.png @teixeirakhttps://github.com/teixeirak is this better/good to go?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHubhttps://github.com/forc-db/ForC/issues/36#issuecomment-324469639, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AGD7jnKkBgCDEYop-kHAIo1-mp4qGPK1ks5sbJtrgaJpZM4O_CC9.

teixeirak commented 7 years ago

Reopening because I think we still need to load the script

ValentineHerr commented 7 years ago

done