-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathstep_6_final_report.Rmd
404 lines (364 loc) · 12.2 KB
/
step_6_final_report.Rmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
---
title: "Final report"
author: "Gracie Goheen"
date: "`r Sys.Date()`"
output:
github_document:
toc: true
---
```{r}
knitr::opts_chunk$set(echo = TRUE)
```
```{r include = FALSE}
library(tidyverse)
library(sf)
# Parameters
# File where generated answers are saved, by default in the home directory
file_answers <- "/Users/graciegoheen/Downloads/dcl/own/file_answers.rds"
# Maximum temperature .grid file for December 29 2019
max_temp_file <- "/Users/graciegoheen/Downloads/dcl/own/2019122920191229.grid"
# Geometry data for countries
countries_data <- "/Users/graciegoheen/Downloads/dcl/ne_110m_admin_0_countries/ne_110m_admin_0_countries.shp"
# Geometry data for cities
places_data <- "/Users/graciegoheen/Downloads/dcl/own/ne_110m_populated_places/ne_110m_populated_places.shp"
# Map colors
colors <-
c(
"18" = "#f6d387",
"21" = "#f3bc67",
"24" = "#eda455",
"27" = "#ea955a",
"30" = "#df8561",
"33" = "#da8368",
"36" = "#d16768",
"39" = "#bf191f",
"42" = "#97040b",
"45" = "#6f0206"
)
# Australian climate variability & change - Time series graphs - mean temperature
temp_anon_file <- "/Users/graciegoheen/Downloads/dcl/own/latestsort_temp.txt"
# Temperature average from 1961 - 1990) in °C according to the Australian Government Bureau of Meteorology
temp_avg <- 21.8
# Australian climate variability & change - Time series graphs - rainfall anonmaly
rain_anon_file <- "/Users/graciegoheen/Downloads/dcl/own/latestsort_rainfall_anon.txt"
# Australian climate variability & change - Time series graphs - rainfall total
rain_total_file <- "/Users/graciegoheen/Downloads/dcl/own/latestsort_rainfall.txt"
# Rainfall average from 1961 - 1990 in mm according to the Australian Government Bureau of Meteorology
rain_avg <- 465.2
# Color for 2019 column
color_2019 <- "#c7432e"
# Colors for year range graph
range_colors <-
c(
"1910-1980s" = "#dcd0c5",
"1990s" = "#b8dae4",
"2000s" = "#6284a4",
"2010s" = "#a35066"
)
# NASA "Active Fires Dataset" via FIRMS (1 km estimates)
nasa_fire_link <- "https://raw.githubusercontent.com/rfordatascience/tidytuesday/master/data/2020/2020-01-07/MODIS_C6_Australia_and_New_Zealand_7d.csv"
#===============================================================================
temp_anon <-
read_table(
temp_anon_file,
col_names = c("year", "temp_anomaly_c")
) %>%
mutate(year = year %>% str_extract("^\\d{4}") %>% as.double())
rain_anon <-
read_table(
rain_anon_file,
col_names = c("year", "rainfall_anomaly_mm")
) %>%
mutate(year = year %>% str_extract("^\\d{4}") %>% as.double())
rain_total <-
read_table(
rain_total_file,
col_names = c("year", "rainfall_mm")
) %>%
mutate(year = year %>% str_extract("^\\d{4}") %>% as.double())
nasa_fire <- read_csv(nasa_fire_link)
countries <- read_sf(dsn = countries_data)
australia <-
countries %>%
filter(NAME == "Australia")
places <- read_sf(dsn = places_data)
aus_places <-
places %>%
filter(SOV0NAME == "Australia")
max_temp_matrix <-
max_temp_file %>%
read_delim(
delim = " ",
col_names = FALSE,
na = "99999.90",
trim_ws = TRUE,
skip = 6,
n_max = 691) %>%
select(-X887) %>%
as.matrix()
max_temp <-
crossing(i = 1:691, j = 1:886) %>%
mutate(
max_temp = map2_dbl(i, j, ~ max_temp_matrix[.x,.y]),
lat = -44.500 + 0.050 * 691 - 0.050 * i,
long = 112.000 + 0.050 * j
) %>%
select(long, lat, max_temp)
```
Austrailia's most recent fire season was one of the most extreme in its history, with around 11m hectares burnt and over than 120 fires still raging as of January 21st. This total area is more than five times the area destroyed by the 2018 California wildfires. More than 20% of Austrailia's forest has been destroyed and many highly-populated areas have faced severe burning. According to [The Guardian](https://www.theguardian.com/australia-news/datablog/ng-interactive/2019/dec/07/how-big-are-the-fires-burning-on-the-east-coast-of-australia-interactive-map), "this season's bushfires in south-eastern Australia have killed at least 32 people and destroyed almost 2,000 homes in New South Wales, Victoria and South Australia."
So, why was this year so bad for bushfires in Australia?
Note: This project uses data from a [tidytuesday challenge](https://github.com/rfordatascience/tidytuesday/blob/master/data/2020/2020-01-07/readme.md).
Source articles:
*[Here’s Where Australia’s Destructive Wildfires Are Burning, New York Times](https://www.nytimes.com/interactive/2020/01/02/climate/australia-fires-map.html)
*[Australia fires: A visual guide to the bushfire crisis, BBC News](https://www.bbc.com/news/world-australia-50951043)
*[Australia’s deadly wildfires in numbers, Financial Times](https://www.ft.com/content/c068339e-3c55-11ea-b232-000f4477fbca)
```{r}
temp_2019 <-
temp_anon %>%
filter(year == 2019)
temp_anon %>%
ggplot(aes(year, temp_anomaly_c)) +
geom_col(fill = "grey") +
geom_col(data = temp_2019, aes(year, temp_anomaly_c, fill = color_2019)) +
scale_y_continuous(
breaks = seq(-1, 1.5, 0.5),
labels = c("-1°", "-0.5°", "0°", "+0.5°", "+1°", "+1.5°")
) +
annotate(
"text",
x = c(2013, 1998, 1917, 1915.8, 1917),
y = c(1.5, 1.05, -1.35, 1.5, 0.5),
label =
c(
"2019 →",
"1998",
"1917",
"warmer than average",
"Annual temperature above or below \nthe 1961–1990 average"
),
color = c("black", "gray", "gray", "black", "cornflowerblue"),
hjust = c(0.5, 0.5, 0.5, 0.5, 0),
size = 3.5
) +
theme(
axis.title.x = element_blank(),
axis.text.x = element_blank(),
axis.text.y = element_text(color = "black"),
axis.ticks = element_blank(),
legend.position = "none",
panel.background = element_rect(fill = "transparent"),
panel.grid = element_line(color = "transparent"),
panel.grid.major.y = element_line(color = "gray97")
) +
labs(
title = "2019 was Australia’s hottest year",
x = NULL,
y = NULL,
caption = "Source: Australian Government Bureau of Meteorology"
)
```
```{r}
rain_2019 <-
rain_anon %>%
filter(year == 2019)
rain_anon %>%
ggplot(aes(year, rainfall_anomaly_mm)) +
geom_col(fill = "grey") +
geom_col(data = rain_2019, aes(year, rainfall_anomaly_mm, fill = color_2019)) +
scale_y_continuous(
breaks = seq(-200, 200, 100),
labels = c("-200", "-100", "0", "100", "200")
) +
annotate(
"text",
x = c(2013, 1974, 1902, 1900, 1924),
y = c(-180, 310, -165, 200, 100),
label =
c(
"2019 →",
"1974",
"1902",
"millimeters",
"Rainfall difference \nfrom average"
),
color = c("black", "gray", "gray", "black", "cornflowerblue"),
hjust = c(0.5, 0.5, 0.5, 0.5, 0),
size = 3.5
) +
theme(
axis.title.x = element_blank(),
axis.text.x = element_blank(),
axis.text.y = element_text(color = "black"),
axis.ticks = element_blank(),
legend.position = "none",
panel.background = element_rect(fill = "transparent"),
panel.grid = element_line(color = "transparent"),
panel.grid.major.y = element_line(color = "gray97")
) +
labs(
title = "2019 was Australia’s driest year",
x = NULL,
y = NULL,
caption = "Source: Australian Government Bureau of Meteorology"
)
```
The ideal conditions for the spread of wildfires are a hot and dry climate matched with strong winds. 2019 was both the hotest and driest year on record for Austrailia.
```{r}
temp_total <-
temp_anon %>%
mutate(temp_c = temp_anomaly_c + temp_avg) %>%
left_join(
y = rain_total,
by = "year"
) %>%
mutate(
year_range =
case_when(
year < 1990 ~ "1910-1980s",
year < 2000 ~ "1990s",
year < 2010 ~ "2000s",
year < 2020 ~ "2010s"
)
)
top_temp_recent <-
temp_total %>%
filter(year > 2010) %>%
top_n(temp_c, n = 4)
temp_total %>%
ggplot(aes(temp_c, rainfall_mm, fill = factor(year_range))) +
geom_hline(yintercept = rain_avg, color = "gray40", linetype = "dashed") +
geom_vline(xintercept = temp_avg, color = "gray40", linetype = "dashed") +
geom_point(shape = 21, color = "white", size = 3, alpha = 0.8) +
geom_point(shape = 21, color = "black", size = 3, data = top_temp_recent) +
ggrepel::geom_text_repel(
aes(label = year),
data = top_temp_recent,
size = 3,
nudge_x = c(-0.25, -0.25, 0.05, -0.25),
hjust = 0
) +
annotate(
geom = "text",
x = c(-Inf, Inf, Inf, -Inf),
y = c(Inf, Inf, -Inf, -Inf),
label = c("Cold and wet", "Hot and wet", "Hot and dry", "Cold and dry"),
hjust = c(-0.1, 1.1, 1.1, -0.1),
vjust = c(2, 2, -1, -1),
color = "gray40"
) +
scale_x_continuous(expand = expand_scale(add = c(0.6, 0.8))) +
scale_fill_manual(
values = range_colors
) +
coord_fixed(ratio = 0.004) +
guides(
fill =
guide_legend(
title.position = "top",
title.hjust = 0.5,
label.position = "bottom",
nrow = 1)
) +
theme(
legend.position = "top",
legend.spacing.x = unit(1.0, "cm"),
legend.key = element_blank(),
legend.text = element_text(margin = margin(t = -5)),
panel.background = element_rect(fill = "transparent"),
panel.grid = element_line(color = "transparent"),
panel.grid.major.y = element_line(color = "gray97"),
panel.grid.minor = element_blank()
) +
labs(
title = "Record heat and drought have fuelled Austrailia's bushfires",
subtitle = "Average annual temperature and rainfall 1910-2019",
x = "Temperature (°C)",
y = "Rainfall (mm)",
fill = NULL,
caption = "Source: Australian Government Bureau of Meteorology"
)
```
Drought and heatwaves are becoming more and more prevelant. Looking towards Austrailia's next fire season, there is a growing risk that fires of this magnitude could happen again.
```{r}
nasa_fire_aus_only <-
st_intersection(
x = nasa_fire %>% st_as_sf(coords = c("longitude", "latitude"), crs = 4326) ,
y = australia
)
nasa_fire_aus_only %>%
transmute(
longitude = st_coordinates(geometry) %>% as_tibble() %>% pull(X),
latitude = st_coordinates(geometry) %>% as_tibble() %>% pull(Y)
) %>%
ggplot() +
geom_sf(data = australia, size = 0.1, fill = "seashell") +
geom_point(
aes(x = longitude, y = latitude),
color = "firebrick3",
size = 1,
alpha = 0.2
) +
geom_sf(data = aus_places, color = "cornflowerblue", alpha = 0.8) +
geom_sf_text(
aes(label = NAME),
size = 3,
data = aus_places,
nudge_x = 0.5,
hjust = 0
) +
theme_void() +
labs(
title = "Location of Active Fires (1 km estimations)",
subtitle = "Points represent any detection of fire, not actual area burned",
caption = "Source: NASA MODIS"
)
```
Many of these active fires have been concentrated in New South Wales - one of the most populated parts of Austrailia.
```{r}
max_temp_aus_only <-
st_intersection(
x = max_temp %>% st_as_sf(coords = c("long", "lat"), crs = 4326) ,
y = australia
)
```
```{r}
max_temp_aus_only %>%
transmute(
max_temp = pmin(45, 3 * round(max_temp / 3)),
long = st_coordinates(geometry) %>% as_tibble() %>% pull(X),
lat = st_coordinates(geometry) %>% as_tibble() %>% pull(Y)
) %>%
ggplot() +
geom_raster(aes(x = long, y = lat, fill = factor(max_temp))) +
geom_sf(data = australia, size = 0.1, fill = NA) +
geom_sf(data = aus_places, color = "white") +
geom_sf_label(
aes(label = NAME),
size = 2,
data = aus_places
) +
scale_fill_manual(
values = colors,
breaks = seq(18, 45, 3)
) +
guides(
fill =
guide_legend(
title.position = "top",
title.hjust = 0.5,
label.position = "bottom",
nrow = 1)
) +
theme_void() +
theme(
legend.position = "bottom",
legend.direction = "horizontal"
) +
labs(
title = "Mean maximum temperature",
subtitle = "Dec 29 2019",
fill = "Mean maximum temperature (°C)",
caption = "Source: BOM Austrailia, Natural Earth"
)
```
Australia surpassed its all-time temperature record twice in December: An average maximum of 40.9°C on December 17 and 41.9°C on December 18. As the temperature continues to rise and rainfall becomes less frequent, the elevated fire risk in Australia will continue.