ECMWFCode4Earth / challenges_2022

Discover the ECMWF Summer of Weather Code 2022 challenges.
11 stars 3 forks source link

Challenge 22 - Bringing Magics weather maps to Matplotlib #5

Open jwagemann opened 2 years ago

jwagemann commented 2 years ago

Challenge 22 - Bringing Magics weather maps to Matplotlib

Stream 2 - Web development for weather, climate and atmosphere

Goal

Make high-quality weather maps integrated in matplotlib

Mentors and skills



Challenge description

Why do we need a solution Magics is a meteorologically oriented graphical library, it means that it knows how to visualise meteorological data coded on GRIB and/or NetCDF on different projections of the globe. Over the years, we have developed a set of predefined visual definitions, making it easy to visualise the most common meteorological parameters. A python interface was created a few years ago following the concepts of the ECMWF tool called Metview, now we are in the process to design a new python interface mapgpye [https://magpye.readthedocs.io/en/latest/] which will follow a more pythonic/matplotlib approach. A typical magpye program will either create an image either PDF, or PNG, and use python library to display the result in Jupyter notebook.

What could be the solution We would like to extend the functionalities and investigate the use of Matplotlib to give users interactivity with the maps on Jupyter notebooks, and to be able to mix in a single figure meteorological maps and Matplotlib graphs.

Magics has its own binary output format that could be used to map the graphics into Matplotlib axes. We have developed a proof of concept that could be the starting point and illustrate the different challenges to solve. While we have already some ideas how this could be implemented, we also open to new ideas on how best take advantage of Matplotlib.

Try it on binder: Binder

Contributors will work through the magpye GitHub and ReadTheDocs spaces and will be publicly acknowledged as contributors.


sylvielamythepaut commented 2 years ago

Hi, Thank you for your interest in our challenge. The code used in the example notebook is available ( in particular the code to binary, used to interpret the Magics binary output and pass it to matplotlib ) is available on github : https://github.com/ecmwf/magics-python The magpye (matplotlib like) package is available also on github https://github.com/ecmwf/magpye

Sylvie