Skip to content

FIX: Handle midnight wrap-around in the column plotting suite - #41

Merged
rcjackson merged 1 commit into
ARM-Development:mainfrom
rcjackson:midnight
Sep 10, 2026
Merged

FIX: Handle midnight wrap-around in the column plotting suite#41
rcjackson merged 1 commit into
ARM-Development:mainfrom
rcjackson:midnight

Conversation

@rcjackson

Copy link
Copy Markdown
Collaborator

This fixes a plotting issue where times were cut off if the radclss file begins before midnight.

A RadCLss file holds the radar volumes for a single processing day, but
the first volume of that day routinely starts a few minutes before
midnight, so time[0] falls on the previous calendar day. Both plotting
functions anchored their 24 hour window on time[0] floored to midnight,
which selected the wrong day entirely.

In create_radclss_columns the window is a .sel(time=slice(...)), so the
data was discarded rather than merely clipped: nsaradclssC1.c0.20260713
.235803.nc plotted 2 of its 1440 times. 5 of the 12 RadCLss files on
hand were affected, at both NSA and BNF. It went unnoticed because the
test fixture starts exactly at 00:00:00.

Replace the anchoring with _daily_time_window(), which takes the day
from the timestamp the bulk of the samples fall on and then widens the
window to keep the pre-midnight leader and any post-midnight tail, so
no data is dropped. The derived day agrees with the authoritative -b
processing day recorded in each file's command_line attribute for all
12 files tested.

Also give the reflectivity panel of the rainfall timeseries the same
xlim as the rain rate and accumulation panels, which previously had
none and so never aligned, and report the product day in its suptitle.

Adds six regression tests built on a synthetic wrap-around dataset that
mirrors the NSA file; the two end-to-end tests were confirmed to fail
against the pre-fix code.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@rcjackson
rcjackson merged commit 2fc72b0 into ARM-Development:main Sep 10, 2026
11 of 13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant