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

  Рет қаралды 4,551

Milos Makes Maps

Milos Makes Maps

Күн бұрын

Пікірлер: 47
@milos-makes-maps
@milos-makes-maps Жыл бұрын
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
@Aaqib..
@Aaqib.. Жыл бұрын
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😇
@milos-makes-maps
@milos-makes-maps Жыл бұрын
I'm happy that this tutorial will be of help to you and your colleagues!
@Aaqib..
@Aaqib.. Жыл бұрын
@@milos-makes-maps 😌yessirrr
@richarddavy6925
@richarddavy6925 Жыл бұрын
Very nice tutorial and so glad you're making good use of KrigR
@milos-makes-maps
@milos-makes-maps Жыл бұрын
Thank you! I came across the package recently as I was preparing this tutorial on visualizing weather data. It'll help R users access valuable climate data instead of struggling to learn Python.
@lbarq
@lbarq Жыл бұрын
Another amazing tutorial. Thanks a lot.
@milos-makes-maps
@milos-makes-maps Жыл бұрын
Thanks for your continuous support, Luis! Hope this one works for you!
@amribetkhalid5344
@amribetkhalid5344 Жыл бұрын
I am speechless with the high quality of your tutorial, impressive as always!
@milos-makes-maps
@milos-makes-maps Жыл бұрын
Wow, thank you very much for your inspiring message, Amribet! I'm looking forward to creating more content to benefit our R community ☺️
@AleksPopovic
@AleksPopovic Жыл бұрын
Climate data is always fun to work with. Great tutorial!
@milos-makes-maps
@milos-makes-maps Жыл бұрын
Thank you so much for your feedback! I'm glad you enjoyed the tutorial on accessing and visualizing climate data. Climate data indeed holds a wealth of valuable information, and it's exciting to explore and analyze it. If you have any specific projects or questions related to climate data analysis, feel free to share them
@pythonGIS
@pythonGIS Жыл бұрын
Thank you for sharing! Exactly what I was looking for!
@milos-makes-maps
@milos-makes-maps Жыл бұрын
Perfect! I'm glad that it's also useful for Python users like yourself!
@mazyarmohammadi1575
@mazyarmohammadi1575 2 ай бұрын
very useful
@mukhtarabdi824
@mukhtarabdi824 Жыл бұрын
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?
@milos-makes-maps
@milos-makes-maps Жыл бұрын
Thanks! I was surprised with the scarcity of R tutorials on netCDF files. I'm looking forward to trying those other packages that you enlisted, thanks for sharing them with me. Have you tried rWind for downloadind wind data? I have a tutorial on visualizing wind direction and speed with R: milospopovic.net/mapping-wind-data-in-r/
@milospljakic3050
@milospljakic3050 9 ай бұрын
Thank you for sharing! I am having trouble installing KrigR. Could you please let me know which version of R you are using?
@milos-makes-maps
@milos-makes-maps 9 ай бұрын
Hey, I use R 4.3.1. What is the issue that you encounter?
@milospljakic3050
@milospljakic3050 7 ай бұрын
Hello! I appreciate your comment. I'm currently using R version 4.3.2, and unfortunately, I'm facing issues installing the KrigR package. It seems like there might be compatibility or installation-related issues. If you have any suggestions or insights on how to resolve this, I'd greatly appreciate your assistance. Thank you!@@milos-makes-maps
@Guazz712
@Guazz712 5 ай бұрын
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 ?
@milos-makes-maps
@milos-makes-maps 5 ай бұрын
Thanks! I have this video on how to get and visualize global wind data: kzbin.info/www/bejne/mmm5i4Cgnad5rac
@user-qn8ms9qq4c
@user-qn8ms9qq4c 7 ай бұрын
Nice work sir but may I ask which program runner or device should I use to run this code
@milos-makes-maps
@milos-makes-maps 7 ай бұрын
Hi, I use R in VSCode. If you are interested in setting up R in VSCode, I prepared a tutorial here: kzbin.info/www/bejne/oWiceWt7mrdogNEsi=nnflXLbv5WegnFkW
@bagasanindhito2884
@bagasanindhito2884 11 ай бұрын
Nice tutorial, Sir! If I may ask, is this method possible to be used to download global sea level data from copernicus?
@milos-makes-maps
@milos-makes-maps 11 ай бұрын
Thank you very much! It should be possible if it's part of ERA5
@paullokubal5649
@paullokubal5649 8 ай бұрын
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!
@milos-makes-maps
@milos-makes-maps 8 ай бұрын
Hey, thanks! I'm happy you find my tutorial clear and straightforward! I've been thinking what could be the cause. So, KrigR is a wrapper for the ecmwfr package. Can you try setting your username and password using this chunk: # Install from CRAN install.packages("ecmwfr") # Set API key for ECMWF Web API ecmwfr::wf_set_key(user = "your.email@address.com", key = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", service = "ECMWF") # Set API key for Climate Data Store ecmwfr::wf_set_key(user = "your.email@address.com", key = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", service = "CDS") And then try to run the KrigR chunk
@paullokubal5649
@paullokubal5649 8 ай бұрын
Thank you so much @@milos-makes-maps for your response. I have navigated it. All it needed was to make the IUD and User Key string characters by using the double quotes. It worked perfectly. One thing I have realised is that the aggregation of the downloaded files (I am downloading hourly temperature) takes too long. Is there a quick way I can combine (I think append is the more appropriate task I want to do) the over 200 files I have downloaded?
@frap8625
@frap8625 Жыл бұрын
Many thanks Milos, you are great. How can I plot shp boundary of state in each map?
@milos-makes-maps
@milos-makes-maps Жыл бұрын
My pleasure! You can simply append the existing ggplot2 code with this line: geom_sf(data = boundary_sf, fill = "transparent", color = "grey10", size = .125) where `boundary_sf` is your shp boundarty object name, `fill = "transparent"` makes the polygon interior transparent so that temperature raster is visible beaneath it, `color` defines the boundary color and `size` defines its thickness. Let me know if you need more clarification or you have further questions!
@frap8625
@frap8625 Жыл бұрын
Hi Milos, how can I plot a single yearly map? If I remove "facet_wrap(~ datum)" it seems that give me one single map of Jennuary.
@milos-makes-maps
@milos-makes-maps Жыл бұрын
​@@frap8625This requires to aggregate several layers of a single raster to a single layer. You can use the app function from the terra package. The app function applies a function to the values of a SpatRaster across layers or between layers. For example, let's use poland_temp raster from the tutorial as an example. The chunk below will aggregate the multi-layered poland_temp SpatRaster to a single layer by taking the mean value for each cell: poland_temp_agg
@clararomero8163
@clararomero8163 Жыл бұрын
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.
@milos-makes-maps
@milos-makes-maps Жыл бұрын
Thank you for your comment and I’m glad you found my videos helpful! To answer your question, if you don’t know the projection reference system, you can still use the same code to map in ggplot2. Your safest bet would be to transform your sf object to EPSG:4326 by applying sf::st_transform(4326) to it. Alternatively, you can try to coerce your object to EPSG:4326 in ggplot2 like this: coord_sf(crs = 4326). Let me know if this works for you!
@carsk893
@carsk893 Жыл бұрын
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?
@milos-makes-maps
@milos-makes-maps Жыл бұрын
Thanks Carlos! Do you refer to gganimate::animate part? If yes, then you can pass units = "px" to it. This will switch the measuring units from inches to pixels. I hope this helps!
@carsk893
@carsk893 Жыл бұрын
@@milos-makes-maps Oh I see, so I tried units = "in" and is working :) Thank you for everything, have a great week!
@milos-makes-maps
@milos-makes-maps Жыл бұрын
@@carsk893 ah super, glad it worked! Thanks, have a wonderful week!
@gunngunn6763
@gunngunn6763 Жыл бұрын
Sir ... How to get temperature data and rainfall data in CSV format for a region?
@milos-makes-maps
@milos-makes-maps Жыл бұрын
Hello, my tutorial already shows how to transform the temperature netCDF into dataframe. In order to export it into CSV, you should use write.csv() from base R
@gunngunn6763
@gunngunn6763 Жыл бұрын
Thank you for responding Sir 🙏🙏🙏
@geomensurainteligente
@geomensurainteligente Жыл бұрын
Error: object xxxxxxxxxx' not found. A great video, I wanted to apply the same, but when using the id and the key, the latter does not recognize it. What do you advise me to do? Thank you very much for your time and thank you.
@milos-makes-maps
@milos-makes-maps Жыл бұрын
Hey, thanks! Did you register at Earthdata to get your ID and key? Because those asterisk characters in the field won't work
@paullokubal5649
@paullokubal5649 8 ай бұрын
Wow. What a great video. However, my API Key is being rejected by R wit "unexpected token with xxx" error. I have registered and I have the UID and the API Key but R keeps finding errors with the user key. Any workaround it? Thank you.
@BoulkhessaimHamza
@BoulkhessaimHamza 5 ай бұрын
hello milos, and thank you for the amazing tuto i am a beginer and i am stuck at this step when i applied Algeria_temp_long$ord
@milos-makes-maps
@milos-makes-maps 5 ай бұрын
Could you share your code in a GitHub repo?
How to Create Amazing Eurostat Maps in 2024 with R and ggplot2
45:37
Milos Makes Maps
Рет қаралды 1,8 М.
Introducing NetCDF and the CF and ACDD conventions
12:16
Luke Data Manager
Рет қаралды 3,1 М.
나랑 아빠가 아이스크림 먹을 때
00:15
진영민yeongmin
Рет қаралды 14 МЛН
Фейковый воришка 😂
00:51
КАРЕНА МАКАРЕНА
Рет қаралды 6 МЛН
Using the python CDSAPI to access the climate data store
11:41
Climate Unboxed
Рет қаралды 13 М.
3D forest height maps with ggplot2 and rayshader in R
59:57
Milos Makes Maps
Рет қаралды 14 М.
Create stunning Urban Maps with QGIS and the QuickOSM Plugin
9:03
Open Source for Architects
Рет қаралды 17 М.
The Ultimate Guide to R-ArcGIS Connection and NDVI Mapping
42:20
Milos Makes Maps
Рет қаралды 2 М.
Read and Plot NetCDF Data in Python with xarray and rioxarray
21:51
Geospatial School
Рет қаралды 10 М.
3D elevation and urban area maps with R
45:02
Milos Makes Maps
Рет қаралды 3,4 М.
NetCDF: Extract Specific Coordinate Data from Climate Models
11:46
나랑 아빠가 아이스크림 먹을 때
00:15
진영민yeongmin
Рет қаралды 14 МЛН