summaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
authorcr4y <cr4y@st33v.com>2026-08-27 11:06:02 +1000
committercr4y <cr4y@st33v.com>2026-08-27 11:06:02 +1000
commit793c3b857c783e57ab54afdbba893e1e50e69c04 (patch)
tree4e72e9606ce61ec896480a6dd1debf2b63a320d2 /doc
parentc4ce2cb63f563d3e0f23342163c7c85c7b7ba458 (diff)
Fix synoptic chart rasterization: switch to pdftoppmHEADmaster
BOM's IDY00030 chart-generator update on 2026-08-26 exposed an upstream Ghostscript bug where magick's PDF delegate silently drops all page content but isobars at production DPI. Poppler's pdftoppm renders the same PDFs correctly, so it now does the rasterization step and magick just resizes. Records the incident, remediation, and a separate unfixable BOM-side monochrome-fill defect in doc/rtfm.md.
Diffstat (limited to 'doc')
-rw-r--r--doc/rtfm.md16
1 files changed, 14 insertions, 2 deletions
diff --git a/doc/rtfm.md b/doc/rtfm.md
index beb1787..bea77da 100644
--- a/doc/rtfm.md
+++ b/doc/rtfm.md
@@ -13,7 +13,7 @@ Everything is fetched anonymously from BOM's public FTP (`ftp.bom.gov.au`), per
## Architecture
-- **`synopticChart.sh`** — fetches the latest `IDY00030` MSLP analysis PDF, renders to a 1920×1080 PNG (ImageMagick `magick -density 300` + Ghostscript), publishes it as `synopticLatest.png`, and archives both the raw PDF and rendered PNG. Deployed to `/opt/synoptic/synopticChart.sh`.
+- **`synopticChart.sh`** — fetches the latest `IDY00030` MSLP analysis PDF, rasterizes it to PNG via Poppler's `pdftoppm -r 300` (previously ImageMagick's Ghostscript delegate — see Current status, 2026-08-27), resizes to 1920×1080 with ImageMagick, publishes it as `synopticLatest.png`, and archives both the raw PDF and rendered PNG. Deployed to `/opt/synoptic/synopticChart.sh`.
- **`synopticMorph.sh`** — builds a rolling `WINDOW_DAYS`-day morph timelapse from the archived PNGs. Content-addressed pair cache (`<chartA>__<chartB>/p_NNNN.png`) under `WORK_ROOT` (`/mnt/enclave/synoptic`, deliberately off the cramped root volume — see Current status). Each run fills missing pairs, evicts anything outside the current window, assembles a sequence with linger/dwell holds, encodes via `ffmpeg`, and publishes `morph.mp4`. Triggered by `OnSuccess=` from `synoptic.service` (not its own timer). Deployed to `/opt/synoptic/synopticMorph.sh`.
- **`radarFetch.sh`** — per-city radar fetch (`RADAR_ID`, e.g. `IDR713` Sydney), pulls dynamic radar layers + static transparency overlays, alpha-composites, publishes the last `FRAME_COUNT` frames as an APNG loop. Deployed to `/opt/radar/radarFetch.sh`, one process serves all four cities via the `RADAR_ID` arg.
- **`index.html` / `morph.html` / `radar.*.html`** — static frontend, served directly by nginx from `/srv/www/pestrel/` and `/srv/www/radar/`.
@@ -30,7 +30,7 @@ Everything is fetched anonymously from BOM's public FTP (`ftp.bom.gov.au`), per
| Archive / working data | `/var/lib/synoptic`, `/var/lib/radar` |
| Morph pair-cache | `/mnt/enclave/synoptic` |
| Published web root | `/srv/www/pestrel/`, `/srv/www/radar/` |
-| Runtime deps | `curl`, `imagemagick`, `ghostscript`, `ffmpeg`, `nginx` |
+| Runtime deps | `curl`, `imagemagick`, `poppler` (`pdftoppm`), `ffmpeg`, `nginx` |
All app-owned paths (`/opt/synoptic`, `/opt/radar`, `/var/lib/synoptic`, `/var/lib/radar`, `/srv/www/pestrel`, `/srv/www/radar`, `/mnt/enclave/synoptic`) are `st33v`-owned — day-to-day script edits/deploys need no `sudo`. Only `setup.sh` itself (systemd unit installation, package install) needs root.
@@ -39,6 +39,18 @@ All app-owned paths (`/opt/synoptic`, `/opt/radar`, `/var/lib/synoptic`, `/var/l
- `synopticMorph.sh`: `WINDOW_DAYS` (default `3`), `MORPH_N` (23), `FPS` (12), `LINGER` (8), `DWELL` (36), `FADE_IN`/`FADE_OUT` (1/2s), `GLYPH_FONT` (DejaVu Sans), `GLYPH_SIZE` (84).
- `radarFetch.sh`: `RADAR_ID` (positional arg, default `IDR713`), `FRAME_COUNT` (6), `FRAME_DELAY` (50cs), `END_PAUSE` (150cs), `TRANSPARENCY_TTL_HOURS` (24).
+## Current status (2026-08-27)
+
+**Synoptic chart rendering only isobars over a black background, diagnosed and fixed (2026-08-27).** st33v noticed `synopticLatest.png` had lost everything except the grey pressure-contour lines — no coastlines, state borders, grid, fronts, H/L labels, wind-barb legend, or land/sea fill.
+
+Root cause: BOM upgraded the `IDY00030` chart-generating software on their end at **2026-08-26 00:00 UTC** (the PDF's `Producer` metadata dropped its version suffix, `...Recode Weather 7.3.7-aubom-r7` → `...Recode Weather`). The new-format PDF triggers an upstream Ghostscript defect — confirmed via isolated local reproduction, independent of the deployed host — where `gs` (invoked directly, or via ImageMagick's PDF delegate as `synopticChart.sh` did) silently drops almost all page content once rendered at roughly ≥250dpi, while still drawing isobars; the exact same file renders fully correct at ≤200dpi, and the pre-2026-08-26 PDF format renders fully correct at 300dpi. No errors or warnings are emitted either way — it just quietly renders less. Ruled out as causes: this repo's scripts (unchanged since March), and cremonde's ImageMagick/Ghostscript/Poppler package versions (`pacman.log` shows no changes anywhere near that date).
+
+Poppler's `pdftoppm` renders the new-format PDF completely and correctly at every tested resolution including 300dpi. Fix: `synopticChart.sh` now rasterizes via `pdftoppm -r 300`, then resizes the result with ImageMagick, rather than letting `magick -density 300` drive Ghostscript directly. `poppler` was already installed on cremonde (an existing transitive dependency), so no new packages were needed.
+
+Remediation on top of the code fix: the 4 charts fetched broken between 2026-08-26 00:00 UTC and 2026-08-26 18:00 UTC were regenerated from their retained raw PDFs (`archive/raw/`) with the fixed pipeline, `synopticLatest.png` was republished immediately, the 4 morph pair-cache directories that referenced those charts were evicted (their sentinel files existed but held morphs computed from the broken images), and `synopticMorph.sh` was re-run to recompute those pairs and republish `morph.mp4`.
+
+**Chart is now monochrome, not a regression — a separate BOM-side defect (2026-08-27).** After the above fix, st33v noticed the chart no longer has its familiar pale-blue ocean / cream-land fill, just black-on-white. Confirmed this is *not* caused by the `pdftoppm` switch: BOM's post-2026-08-26 PDF still contains the `0.945 0.945 0.863` (cream) fill operator at the same count as the old format (1086×), but is missing the ocean pale-blue and grid-grey fills, and — more tellingly — rendering it through two independent, unrelated engines (Ghostscript and Poppler) both produce the same result: 216 unique colors, every one a pure gray. The old-format PDF renders with 2345 colors including real blues/creams on both engines. Neither PDF embeds any raster images (`pdfimages -list` empty on both), so it's a pure-vector fill/path defect in BOM's new generator — the fill color is set but whatever path it's meant to paint isn't landing, almost certainly the same software regression that caused the isobars-only bug above. Nothing to fix on our end; there's no color data left to extract. Worth periodically eyeballing `synopticLatest.png` in case BOM ships another update that restores it.
+
## Current status (2026-07-31)
**Disk-full incident, diagnosed and resolved (2026-07-30).** Root (`/`, `/dev/root`, 9.7G ext4) hit 100% used / 0 available. Two independent causes, both on root: