Import Copernicus climate data via API, process netCDF and map with ggplot2

preview_player
Показать описание
This tutorial shows you how to access Copernicus Climate Data Store API through KrigR package in R, retrieve climate data in netCDF format, and create powerful static and animated visualizations for any country in the world using ggplot2 and gganimate

0:00 Prologue
0:50 Intro
02:03 Set working directory
04:14 Install KrigR
06:06 Load libraries
11:59 API id & key
12:49 Copernicus Climate Data Store
18:08 Registration
20:32 KrigR - documentation
26:12 KrigR - build query
32:32 KrigR - download data
33:55 netCDF
37:43 Plot June 2022 temperature for Poland
41:32 Quick & dirty map
42:51 netCDF to dataframe
44:46 Pivot dataframe
47:25 Create dates from layer names
57:35 Breaks
01:02:10 Spectral palette
01:06:22 ggplot2 code
01:14:17 ggplot2 theme
01:21:26 Panel map of poland
01:22:39 gganimate
01:29:31 Save map as gif
01:30:13 Timelapse temperature map
01:31:33 Closing

Check the full code in my GitHub repo:

Follow my work on Instagram:

Let's connect on Twitter:

If you like my work, consider buying me a coffee:

Music credits go to:

David Hyde:
Music provided by RFM
Рекомендации по теме
Комментарии
Автор

Caught a typo at 1:23:43 : it should be `plot.subtitle = element_text(size = 40, color = "#c43c4e", hjust = .5, vjust = -1)`. Sorry guys! I fixed the code in my GitHub repo

milos-makes-maps
Автор

I have myself struggled with netcdf in R due to lack of tutorials, all of my fellow researchers use Python for the same. You are a godsend😇

Aaqib..
Автор

Climate data is always fun to work with. Great tutorial!

AleksPopovic
Автор

Very nice tutorial and so glad you're making good use of KrigR

richarddavy
Автор

I am speechless with the high quality of your tutorial, impressive as always!

amribetkhalid
Автор

Another amazing tutorial. Thanks a lot.

lbarq
Автор

Thank you for sharing! Exactly what I was looking for!

pythonGIS
Автор

Very insightful video. Thanks for sharing. R community struggle to find netcdf data tutorials. I was currently checking and testing R packages to get remote sensing and grided climate data into R. I found packages such as chirps, climater, luna as well as KrigR. Nice to see you are using KrigR. Can you name any other packages similar to above mentioned ones?

mukhtarabdi
Автор

Thank you for your sharing with us such a nice tutorial. Every step is clear but the challenge I faced when I was trying to apply the tutorial steps is, I couldn't get API_User and API_key instead what I got are USER Id and API_Token, and when I insert these it sends error message, are they different ? I watched some tutorial applied similar to what I have, I accepted all terms and conditions, why mine denied? Is that a must to install python to get API user and Key? I need you guide. Thank you for your time!

alemayehumullatuadashio
Автор

A really helpful Video sadly when i use my api it tells me that there is an unexpected token is there a work around?

zswlutt
Автор

Many thanks Milos, you are great. How can I plot shp boundary of state in each map?

frap
Автор

Nice tutorial, Sir! If I may ask, is this method possible to be used to download global sea level data from copernicus?

bag
Автор

What a great video! Very clear and easy to follow. However, R seems to have issues with my API Key, outrightly rejecting it with "unexpected token xxx". Anyway to work around it? I have tried to make the 32-character key a string variable but the download won't work. I have used underscore instead of the dash (minus sign - that comes with the key but that won't work either. Even removing the minus separator isn't working. I am now stuck. Any help is highly welcome. Thank you!

paullokubal
Автор

Great video ! I am looking for maritime wind data at high time resolution (ex 10 min) for single locations... do you know where I could find it ?

Guazz
Автор

Thank you for sharing! I am having trouble installing KrigR. Could you please let me know which version of R you are using?

milospljakic
Автор

Nice work sir but may I ask which program runner or device should I use to run this code

WilliamGriv
Автор

If I don´t know the projection reference system, can i use the same code to map in ggplot?. Ps: your videos are amazing. Thank you.

clararomero
Автор

Thanks for the great tutorial! I followed it until the last part; it seems like the PC is interpreting the height and width as pixels instead of inches. Do you have any idea why this is happening?

carsk
Автор

Sir ... How to get temperature data and rainfall data in CSV format for a region?

gunngunn
Автор

Thank you for your help. After running the request I got the following :
CDS Request & Data Download
[1] "Building request"
[1] "Checking request validity"
Error in CumulativeCheck && !CumVar : invalid 'x' type in 'x && y', how this can be solved? The main point still I am in doubt is, I didn't installed CDI API for window. I'm using window, does is matter?

alemayehumullatuadashio
visit shbcf.ru