GEMPAK, the GEneral Meteorology PAcKage, is one of the legacy tools that has seen wide usage for such applications. Since the National Center for Environmental Prediction announced it was discontinuing development of GEMPAK, the use of Python to replace GEMPAK scripting seems like a natural progression. However, until recently, many of the core functions of GEMPAK, especially calculations for gridded data (“grid diagnostics”) were not available in Python. MetPy has developed many features in this area in the last year, bringing it closer to parity with GEMPAK.
While it is possible to replicate many GEMPAK analyses in Python, to date this has required scripts that are longer and more complicated than previously required for GEMPAK. Much of this results from the fact that Python is a full, general purpose programming language and expresses actions in an imperative fashion; in contrast, GEMPAK scripting involved setting variables describing the state of the plot in what is referred to as a declarative programming model. One of the challenges with the declarative model, as done in GEMPAK, is that it is not as readily extended to more advanced applications in comparison with traditional programming language environments. MetPy now has a prototype, simplified declarative-like plotting interface to enable users to generate simple plots with a few lines of easy to understand code, but enables modification and tweaking of these plots with the full power of the Python language.
This presentation will demonstrate recent work in MetPy to explore and implement a declarative programming model for plotting in Python. Based around the Jupyter project’s Traitlets framework, this new plotting interface in MetPy greatly simplifies the process of creating meteorological visualization in Python. Early proof of concept work in utilizing this interface along with the Jupyter Notebook’s Widget toolkit will also be presented as a model for streamlined interactive graphics in the notebook interface.