
Chris Parmer
December 4, 2026
Tracking the LA storm: a case study in weather radar maps and combining data feeds with Plotly
TL;DR
- We built a weather radar map in Python with Plotly and Dash for the Los Angeles storm of Nov 30 to Dec 2, 2026, and lined it up with 1,356 reports of flooding, fallen trees and mudslides that people made to the city's 311 line.
- It combines five public feeds from two places: the City of Los Angeles open data portal (311 reports and the city boundary) and the Iowa Environmental Mesonet at Iowa State (NEXRAD radar tiles, airport rain gauges and National Weather Service flash flood warnings).
- The radar is a raster tile layer on a Plotly map, the warnings and city outline are GeoJSON line layers, and the reports are ordinary scatter points. A Dash slider steps through the storm in 133 half-hour frames, and the Play button runs as a WebSocket callback instead of a dcc.Interval.
- Most of the work was lining the feeds up in time: the radar archive runs on UTC, 311 on Pacific time, and the rain gauges report once an hour.
- The prompt we gave the coding agent, the code and what we learned are below.
El Niño storms have been ripping through the West Coast these past few weeks. When a big storm hits a city, the information about it is spread across many places. The weather service has the radar and the warnings, airports log the rain, and the city logs every call about a flooded street or a fallen tree. Each source is public, but each has its own format, its own clock and its own website, so it's hard to see them together.
A good way to understand a storm is to put those sources on one screen and move through time. Two weeks ago we did that for San Francisco Bay's king tide storm, with a flood watch app built on open NOAA data. This time we picked the storm that hit Los Angeles from Monday, Nov 30 to Wednesday, Dec 2, 2026, and built a small Dash app that shows the weather radar and the 311 reports side by side, with a slider to move through the storm.

What does the map show?
The app has two maps and a chart, all on the same clock.
- Top: the weather radar. This is the NEXRAD radar composite, the same radar picture TV weather maps use. Green is light rain and red is very heavy rain. The white dashed shapes are flash flood warnings from the National Weather Service, and the solid white line is the City of Los Angeles.
- Bottom: the 311 reports. Every report of flooding (cyan), fallen or blocking trees (purple) and mudslides (pink) made to MyLA311, the city's service request line. Reports from the last three hours are big and glow, and older ones fade into small dots.
- Right: the running count. The number of reports so far, split by type, with hourly rain shown as gray bars behind it.
The top map is zoomed out to all of Southern California on purpose. When the storm covered the whole basin on Tuesday, a close-up view was a solid sheet of yellow and green. From farther out you can see the storm's shape: a band running north to south along the coast, with dry desert to the east. The bottom map is zoomed in on the city, because that's where the reports are.

What did the storm look like in the data?
Rain started around 1am Monday and was heaviest on Tuesday. Averaged over the seven airport rain gauges in and around the city, 3.42 inches fell before the rain ended early Wednesday. Van Nuys got 4.98 inches.
The 311 reports followed the rain, with a delay. The heaviest hour of rain was 11am Tuesday, and flooding reports peaked two hours later, at 1pm, with 89 in one hour. Tuesday had 460 flooding reports, the most of any day since the city moved to its current 311 system in March 2025. On Wednesday the rain had stopped, but 183 more reports of fallen trees came in as people went outside and found them.
Over the whole window, people made 1,356 reports: 680 about flooding, 632 about fallen or blocking trees and 44 about mudslides. That count includes the normal background. On a typical day before the storm, the city got about 83 reports of these four types.
Where does the data come from?
Every feed is public and free, and none needs an API key.
Feed
What it gives us
Source
311 reports
Time, type and location of each report
MyLA311 Cases 2026, City of Los Angeles open data (Socrata API)
City boundary
The 15 council districts, merged into one outline
LA Council Districts, same portal
Weather radar
NEXRAD base reflectivity composite as map tiles, every 5 minutes
Iowa Environmental Mesonet tile service
Rain
Hourly rain at airport weather stations (ASOS)
Flash flood warnings
The polygon and time window of each NWS warning
The Iowa Environmental Mesonet (IEM), run by Iowa State University, does a lot of the work here. It keeps an archive of the national radar picture as map tiles, the hourly reports from airport weather stations, and every warning the National Weather Service has drawn on a map.
How to make a weather radar map in Python
The radar comes as map tiles: small square images that a web map loads as you pan and zoom, the same way Google Maps loads its streets. Plotly's maps (the Scattermap trace, built on MapLibre) can draw any tile service as a raster layer, as the map layers documentation shows. You give the layer a URL with {z}, {x} and {y} in it, and the map fills in the tiles it needs.
import plotly.graph_objects as go# The NEXRAD radar composite at 11am Pacific on Dec 1, 2026 (19:00 UTC), as map tiles from Iowa Statetiles = ("https://mesonet.agron.iastate.edu/cache/tile.py/1.0.0/""ridge::USCOMP-N0Q-202612011900/{z}/{x}/{y}.png")fig = go.Figure(go.Scattermap())fig.update_layout(map=dict(style="carto-darkmatter", center=dict(lat=34.0, lon=-118.45), zoom=6.9,layers=[dict(sourcetype="raster", source=[tiles], below="traces", opacity=0.62)]),margin=dict(l=0, r=0, t=0, b=0),)fig.show()
The timestamp in the URL picks the radar picture. IEM keeps one every 5 minutes, in UTC, so to show 11am in Los Angeles in December you ask for 19:00. The basemap, carto-darkmatter, is a dark street map that lets the bright radar colors stand out.
The warnings and the city outline are GeoJSON shapes, so they go in as line layers on the same map: dict(sourcetype="geojson", source=shape, type="line", color="white"). For the dashed warning lines, add line=dict(width=2, dash=[2, 1.5]). The city publishes its boundary as 15 council districts, so we merged them into one outline with Shapely, the geometry library underneath GeoPandas.
How to map 311 reports in Python
Los Angeles publishes its 311 data on Socrata, which takes SQL-like queries in the URL. This pulls every flooding report from the storm, about 680 rows, and puts them on a map:
from urllib.parse import urlencodefrom urllib.request import urlopenimport plotly.express as pximport polars as pl# Every 311 flooding report in Los Angeles during the storm, from the city's open data portalquery = urlencode({"$select": "createddate, geolocation__latitude__s AS lat, geolocation__longitude__s AS lon","$where": "type = 'Flooding' AND createddate BETWEEN '2026-11-30T00:00:00' AND '2026-12-02T18:00:00'","$limit": 50000,})reports = pl.read_csv(urlopen(f"https://data.lacity.org/resource/2cy6-i7zn.csv?{query}").read())fig = px.scatter_map(reports, lat="lat", lon="lon", hover_data=["createddate"],map_style="carto-darkmatter", center=dict(lat=34.06, lon=-118.40), zoom=9)fig.update_traces(marker=dict(size=7, color="#7FE4FF"))fig.show()
Many US cities publish 311 data the same way (New York, Chicago and San Francisco all use Socrata), so the same approach works for other cities with a different dataset ID and request types.
How do you combine data feeds that run on different clocks?
Getting each feed was the easy part. Lining them up took most of the time, because each one keeps time differently:
- The radar archive is in UTC. 11am in Los Angeles in December is 19:00 UTC.
- The 311 timestamps are in Pacific time, with no time zone attached.
- The rain gauges report once an hour, a few minutes before the hour, and each report is the rain since the last one.
- The warnings have a start and an end, so at any moment some are in force and some aren't.
We picked one clock for everything: Pacific time, in steps of 30 minutes, from 12am Monday to 6pm Wednesday. That's 133 frames. For each frame the app works out the radar picture to show, which reports had come in, how much rain had fallen and which warnings were in force. We used Polars for this (it's one of the tutorials in our Python packages for data series), with a join on time (join_asof) to match each frame with the rain total that was known at that moment.
How to turn it into a Dash app with a slider
The app is one Python file of about 180 lines, plus a data file that downloads and caches the feeds. A dcc.Slider picks the frame, and one callback redraws both maps, the chart and the numbers:
@app.callback(Output("radar", "figure"), Output("reports", "figure"), Output("chart", "figure"),Output("clock", "children"), Input("t", "value"))def show(i):return radar_fig(i), reports_fig(i), chart_fig(i), label(FRAMES[i])

Because the storm is over, the app downloads each feed once and saves it as a Parquet file, so it starts in a few seconds after the first run. We run it privately on Plotly Cloud, but it works the same on a laptop or on Dash Enterprise.
Playing the storm with a WebSocket instead of dcc.Interval
The usual way to animate a Dash app is a dcc.Interval: the browser sends a request every 0.4 seconds, and a callback moves the slider forward one step. That works, but it's the browser polling the server, and when a frame takes longer to draw than the interval, the requests start to stall or queue up.
Dash's WebSocket callbacks turn this around. The app runs on the FastAPI backend with websocket_callbacks=True, and a persistent callback runs on the server for as long as the page is open. While Play is on, it moves the slider forward one frame, and the slider's callback redraws the maps over the same connection:
app = Dash(__name__, backend="fastapi", websocket_callbacks=True)@app.callback(persistent=True)async def player():ws = ctx.websocketwhile not ws.is_shutdown:if await ws.get_prop("playing", "data"):i = await ws.get_prop("t", "value")if i >= len(FRAMES) - 1:set_props("playing", {"data": False})set_props("play", {"children": "Play"})else:set_props("t", {"value": i + 1})await asyncio.sleep(0.4)else:await asyncio.sleep(0.2)
ws.get_prop reads a value from the browser in the middle of the loop, and set_props pushes an update straight away. The Play button only flips the playing flag, so Pause takes effect at the loop's next check. When we tested it, every callback in the app went over the one WebSocket, with no HTTP callback requests at all, and each frame waits for the one before it instead of piling up. WebSocket callbacks need the FastAPI or Quart backend (pip install "dash[fastapi]" "uvicorn[standard]"); Flask, Dash's default, still uses HTTP.
How to record a Dash app as a video
To make the video, we didn't screen-record the app in real time, because the map tiles take a moment to load and some frames came out half-drawn. Instead a short script opens the app in a headless browser with Playwright, moves the slider one step at a time with the arrow key, waits until both maps have every tile loaded, and takes a screenshot. ffmpeg turns the 133 screenshots into an MP4 at 1080 by 1350 pixels (the 4:5 shape that fills the most of a phone screen on LinkedIn), and the same screenshots make the 12-frame board earlier in this post.
The wait is the important part. Waiting for the network to go quiet wasn't enough, so the script asks MapLibre directly:
pg.wait_for_function("""() => ['radar', 'reports'].every(id => {const m = document.querySelector('#' + id + ' .js-plotly-plot')._fullLayout.map._subplot.map;return m.isStyleLoaded() && m.areTilesLoaded();})""")
The prompt
We built this with Claude Code over a few rounds of back and forth. This prompt puts what we ended up asking for in one place, and you can swap in your own city, storm and dates:
Make a Dash app that shows the Los Angeles storm from 12am Nov 30 to 6pm Dec 2, 2026 (Pacific time) as two maps and a chart on one dark 1080 by 1350 board, with a slider that steps through the storm in 30-minute frames. Use the FastAPI backend with WebSocket callbacks, and make the Play button a persistent WebSocket callback that moves the slider forward every 0.4 seconds, rather than a dcc.Interval. The top map shows the NEXRAD radar composite from the Iowa Environmental Mesonet tile service as a raster layer on a dark basemap, zoomed out to Southern California, with the City of Los Angeles outline (merge the council districts from data.lacity.org) and the NWS flash flood warnings in force at that time (from IEM's warning archive) as line layers. The bottom map shows every MyLA311 report of Flooding, Tree Emergency, Tree Obstruction and Land/Mud Slide made so far, zoomed in on the city, with the last three hours larger. Next to it, show the count so far by type and a stacked cumulative chart with hourly rain from the city's airport gauges (IEM ASOS archive) as gray bars. Use Polars, cache each feed to Parquet, and keep every time in Pacific time. Then write a script that steps the slider with Playwright, waits for the map tiles to load, takes a screenshot of each frame and makes an MP4 with ffmpeg.
What we learned
- Weather radar and satellite are different. Satellite images show clouds. Radar shows where rain is actually falling and how hard, which is what you want next to flooding reports. The green, yellow and red colors are the standard radar scale, so people who follow the weather read them right away.
- Pick one clock first. Most of the bugs were time bugs: a server running on UTC drew the radar eight hours in the future. The rain needs care too: an hour's rain is only known when the hour ends, so the app adds it to the total at the end of that hour.
- Check every sensor. Four of the airport stations near LA (Mount Wilson, El Monte, La Verne and Whiteman) reported no rain at all while the stations around them recorded inches, which means their rain sensors weren't reporting. Averaging them in would have cut the rain totals.
- 311 data follows people, not just the weather. Reports dip overnight even when it's pouring, peak in the middle of the day, and keep coming after the rain stops. The city also publishes them an hour or two after they're made, so during a storm the newest hour is always incomplete.
- Give each layer its own map. With the reports on top of the radar, the dots got lost in the colors. Two maps on the same clock are easier to read than one busy one.
- Use archives, not live feeds, for anything you want to rebuild later. The NWS alerts API only keeps recent alerts, so we switched to IEM's archive of warnings. IEM also limits how often you can query it, so the app saves each download and retries when the server is busy.
- Label what you count. The 1,356 reports include the usual daily background, so the app says "flooding, tree and mudslide reports" rather than "storm damage."
Summary
A storm leaves a trail in public data: radar pictures, rain gauge readings, weather warnings and calls to the city. Each one is easy to get on its own. Putting them on one clock and one screen is what makes them useful, and Plotly's maps can hold all of them, from radar tiles and GeoJSON outlines to thousands of points. A Dash slider turns that into something you can step through, and a short Playwright script turns the app into a video.