This Project Pythia Cookbook accesses, analyzes, and visualizes real-time and archived surface meteorological observations from a worldwide network of (mostly) airport locations, originally encoded in METAR format.
Motivation¶
While a number of Pythia cookbooks have focused on raster-based datasets (e.g., NWP and reanalysis output in NetCDF and Zarr), there is a need for similar examples which use direct observational data at actual physical locations. These inherently tabular datasets are well-suited for not only Python tools such as Pandas but also those that provide database-like query-based services (e.g. DuckDB).
Structure¶
We will work with a cloud-served, continually-updating archive of METAR observations that are in GeoParquet format. We will use DuckDB to query them, create a simple method to visualize world-wide surface weather observations at a given hour, perform a variety of time-series analyses, and statically and/or interactively visualize our results with Matplotlib, Geopandas and Lonboard.
Section 1 (Introduction)¶
We will describe the file format of the METAR archive (Parquet) and give an overview of DuckDB, which we will use to perform SQL-like queries on the archive.
Section 2 ( Examples )¶
Create a synoptic station model plot from METAR observations at a current or user-specified hour.
Perform an interactive visualization of METAR data using GeoPandas.
Perform an interactive visualization of METAR data using Lonboard.
Time-series analysis
Compare METAR observations to gridded reanalyses
Demonstrate an AI agent that translates METAR observations into plain-language text.
Running the Notebooks¶
You can either run the notebooks in the Cookbook using Binder or on your local machine.
Running on Binder¶
The simplest way to interact with a Jupyter Notebook is through
Binder, which enables “one click”
execution in the cloud. Simply navigate your mouse to
the top right corner of the book chapter you are viewing and click
on the rocket ship icon (see screenshots here),
and a text box will appear. Type or paste the Pythia Binder link
(https://binder.projectpythia.org) and click “Launch”.
After a few moments you should be presented with a
notebook that you can interact with. You’ll be able to execute code
and even change the example programs. At first the code cells
have no output, until you execute them by pressing
Shift+Enter. Complete details on how to interact with
a live Jupyter notebook are described in the Pythia Foundations chapter Getting Started with
Jupyter.
Note, not all Cookbook chapters are executable. If you do not see the rocket ship icon, such as on this page, you are not viewing an executable book chapter.
Running on Your Own Machine¶
If you are interested in running this material locally on your computer, you will need to follow this workflow:
Clone the
https://github.com/ProjectPythia/METAR_archive-cookbookrepository:git clone https://github.com/ProjectPythia/METAR_archive-cookbook.gitMove into the
METAR_archive-cookbookdirectorycd METAR_archive-cookbookCreate and activate your conda environment from the
environment.ymlfileconda env create -f environment.yml conda activate METAR-archive-cookbookMove into the
notebooksdirectory and start up Jupyterlabcd notebooks/ jupyter lab