Skip to main content

How Barometer.today Draws Its Isobars

An in-depth look at the Python algorithms powering global isobar maps using ECMWF data and mountain filtering techniques.

AI-written
Inewgen
08 Sep 2026Source: Dev.to3 min read (0 views)
Share
How Barometer.today Draws Its Isobars

Stock photo for illustration only, not from the actual event

Font size
  • Website barometer.today visualizes global air pressure using animated isobar maps.
  • Built with Python using libraries like numpy, scipy, contourpy, and shapely.
  • Solves pressure distortion over high mountain ranges using normalized convolution and masks.
  • Handles map wrapping across longitude lines and simplifies geometries with Douglas-Peucker.

The weather visualization website barometer.today displays current air pressure readings, yesterday's changes, and weekly forecasts for cities worldwide. Its core feature is a global isobar map that animates hour by hour, spanning from one day in the past to four days into the future.

A technical breakdown published by the developers explains the concepts and algorithms used to render these weather lines. The entire system is written in Python, leveraging powerful data processing libraries such as numpy, scipy, contourpy, and shapely, which are standard tools for generating contour maps from gridded data.

Isobars are contour lines connecting points of equal atmospheric pressure on weather maps. When these lines pack tightly together, it indicates a rapid change in pressure over a short distance, typically signaling strong winds, while widely spaced lines suggest calmer conditions. Enclosed rings mark centers of high pressure (H) and low pressure (L), with deep, tightly bound low-pressure systems often representing storms.

Data for the maps originates from ECMWF global forecasts, providing sea-level pressure grids at 0.25-degree resolution (roughly 28 kilometers) worldwide. The model updates four times daily, generating approximately 120 hourly frames per update cycle.

Because raw model grids exhibit jagged cell-to-cell variations, direct contour tracing results in wobbly lines. To fix this, developers apply a Gaussian blur with a sigma value of one cell (28 km). They avoid excessively wide blurs, such as 110 km, which could mistakenly flatten a powerful 936 hPa hurricane core into a mild 993 hPa depression.

Never miss the latest news?

Subscribe to get news summaries by email - not often enough to be annoying.

โฆษณา

0.25°ECMWF Grid Resolution
2,500 mElevation Threshold for Masks
3 hPaMin Window Range for Centers

A major challenge in calculating sea-level pressure involves high plateaus and mountain ranges, where extrapolated pressure values often emerge unrealistically high. The engineering team resolved this by implementing a normalized convolution technique using a digital elevation mask for regions above 2,500 meters, ensuring outputs rely strictly on valid neighboring cells across major massifs like the Andes, Tibetan Plateau, Greenland, and Antarctica.

python code data analysis screen

Stock photo for illustration only, not from the actual event

Contours are traced using the marching squares algorithm—the same standard utilized by matplotlib. To prevent the map from breaking across longitude boundaries, the grid is padded with replicated edge columns, allowing seamless rendering across the Pacific Date Line. Finally, individual lines are simplified using the Douglas-Peucker algorithm at 0.05-degree tolerance, keeping resulting GeoJSON files compressed under 100 KB.

Source: Dev.to

Comments

Leave a Comment
0/2000

Found something wrong in this article? Report an issue with this article