Skip to content

Environment: cyclones (IBTrACS) and heavy-rain days vs catches (#24) - #110

Merged
Luen merged 5 commits into
mainfrom
cyclones
Nov 3, 2026
Merged

Luen merged 5 commits into
mainfrom
cyclones

Conversation

@Luen

@Luen Luen commented Nov 3, 2026

Copy link
Copy Markdown
Collaborator

Closes #24.

Stacked on #109 (diet). Both branches add a Drizzle migration and bump IMPORTER_VERSION, so this one builds on top (0003, version 7) rather than racing it. Once #109 merges, GitHub retargets this PR to main.

Data

  • scripts/fetch-external.mjs gets a cyclones job. It downloads the IBTrACS v04r01 South Pacific CSV (~36 MB, NOAA, public) and keeps track points within 750 km of Mo'orea since 2013-08-01, written to external/cyclones.csv (82 rows). The weekly refresh workflow picks it up automatically.
  • New cyclone_points table (migration 0003); IMPORTER_VERSION → 7.

Analysis (analytics/events.ts)

  • Storms: closest approach per track, kept when within 500 km. Since 2013: Niko (Jan 2015, 156 km), Nat (Feb 2024, 198 km) and an unnamed storm (Dec 2025, 259 km).
  • Heavy-rain days: the wettest 1% of ERA5 days (≥ 58 mm in the grid cell; 49 days).
  • Catches after events: observed / expected sharks, where expected comes from the other sets in the same season and month. Storms and downpours cluster in the wet season, when catches change anyway. 95% intervals from a bootstrap over sets.
  • Result: every interval includes 1 (e.g. within two weeks of a cyclone ×1.02, 0.70–1.41). The page says so; the note text is chosen by the computed intervals.

Weather page

  • New Storms and downpours section: catch rate after downpours (0–3, 4–7, 8–14, 15–30 days) and after cyclones; heavy-rain days by month; a cyclone table (closest approach, distance, max wind, sets in the following two weeks).
  • Monthly rainfall chart marks each cyclone with a labelled dashed line, using a new markers prop on LineChart (same style as the histogram markers).
  • IBTrACS credited in the footer, About, README and the refresh workflow comment; AGENTS.md has a "Cyclones and heavy rain" note.

Checks

pnpm lint, pnpm check, pnpm test (70, incl. a test that Niko is found from the committed snapshot), pnpm build, pnpm test:e2e (29), real-data import and the Weather page checked in the browser.

🤖 Generated with Claude Code

Luen and others added 2 commits November 3, 2026 14:06
The importer now reads the lavage columns it used to skip: lavage done
(2016-17 'Lavage (y/n)', 2020-21 'Gastic lavage'), stomach fullness
(full / traces / empty) and free-text contents, into new capture
columns. /physiology gains a stomach-contents section: fullness by
season and species, foraging success by moon phase (Debaere et al.
2024), by umbilical scar and by time after sunset with chi-square
tests, body condition of fed vs empty pups, and the kinds of food named
in the samples. A live finding summarises it.

Adds chiSquare / chiSquareP to stats, synthetic lavage columns to the
fixture, and bumps IMPORTER_VERSION to 6.

Closes #40

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
fetch-external gains a cyclones job: IBTrACS South Pacific best tracks,
kept within 750 km of Moorea since 2013 (external/cyclones.csv, new
cyclone_points table). analytics/events.ts finds storms passing within
500 km and heavy-rain days (wettest 1% of ERA5 days), and compares
catches after them with other sets in the same season and month
(observed / expected, bootstrap interval).

Weather page: "Storms and downpours" section (catch rate after events,
heavy-rain days by month, cyclone table) and storm markers on the
monthly rainfall chart via a new LineChart `markers` prop. Sources
added to the footer, About, README and AGENTS.md. IMPORTER_VERSION 7.

Closes #24

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@Luen
Luen added this pull request to stack #111 November 3, 2026 04:17
Luen and others added 2 commits November 3, 2026 17:13
Both branches added blocks at the same spots in stats.ts (normalP vs
the chi-square helpers), findings.ts (catch-model vs lavage finding)
and AGENTS.md; kept both. Restores the normalP assertions in
stats.test.ts now that both helpers are on one branch.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
AGENTS.md: both sides added a repo-map line and a section before
"Adding a new season"; kept both.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Base automatically changed from diet to main November 3, 2026 07:17
main's squash of #109 is identical to the diet head this branch already
contains, so every conflict resolves to this branch's side; the tree is
unchanged from 9c66764.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@Luen
Luen merged commit 204276b into main Nov 3, 2026
@Luen
Luen deleted the cyclones branch November 3, 2026 07:19
@Luen Luen mentioned this pull request Nov 3, 2026
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.

Environment: cyclones (IBTrACS) and heavy-rain runoff events

1 participant