Birth date temperature

Day 6 of 30DayMapChallenge. Raster
R
spatial
datavisualization
30DayMapChallenge
Author

Michaël

Published

2024-11-06

Modified

2024-11-11

A photo of Valley of the roses in Morocco

Valley of the roses – CC-BY-NC-ND by Riccardo Maria Mantero

Day 6 of 30DayMapChallenge: « Raster » (previously).

What was the temperature at your birth place when you were born?

Copernicus provides many climate datasets. We can use ERA5 post-processed daily statistics on single levels from 1940 to present to display the weather on your birth date.

Some packages help to download and manipulate ERA5 data ({KrigR}, {Ag5Tools}, {ecmwfr}, or directly by the CDS API,…) but for this one shot, we’ll do a manual download from the web interface.

You need to create a (free) account first.

Then we can chose the product:

Data

library(terra)

temperature <- rast("65361bd1333e205e6e593c9179183e4a.nc") |> 
  rotate()

temperature <- temperature - 273.15
crs(temperature) <- "+proj=longlat"
temperature <- project(temperature, "+proj=eqearth")

Map

plot(temperature,
     main = "Mean temperature on 1970-01-01",
     axes = FALSE,
     col = map.pal("magma"),
     plg = list(title = bquote("°C"),
                cex = 0.7))
mtext("data: Copernicus ERA5", cex = 0.8, side = 1, line = .5, at = 16000000)
Map of mean temperature at 2 m on 1970-01-01
Figure 1: Mean temperature at 2 m on 1970-01-01 from ERA5