Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/refresh-external.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Weekly refresh of the public environmental snapshots in external/ (#22): weather, waves,
# SST, Coral Reef Watch heat stress, Papeete tides and ENSO indices. When anything changed,
# SST, Coral Reef Watch heat stress, Papeete tides, ENSO indices and IBTrACS cyclone tracks. When anything changed,
# commit it to main, cut a patch release and publish the image so servers pick up fresh data.
# No spreadsheet data is involved.

Expand Down
7 changes: 7 additions & 0 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ src/lib/server/analytics common.ts (CPUE, Fulton's K, recapture pairs…) · env
findings.ts (live findings) · insitu.ts (logger temperature summaries)
population.ts (Schnabel abundance, von Bertalanffy growth)
diet.ts (gastric lavage: fullness, prey groups)
events.ts (cyclones and heavy-rain days vs catches)
glm.ts (NB/Poisson GLM, splines) · catchModel.ts (joint catch model)
src/lib/server/astro.ts sunset/twilight/moon (local formulas) · tides.ts (extrema, interpolation)
src/lib/server/holidays.ts French Polynesia public holidays (Easter-based too) + festive window
Expand Down Expand Up @@ -87,6 +88,12 @@ samples/fixture/ synthetic workbooks for tests/CI (committed)
- ERA5 `cloud_evening` covers every set; the crew's 1–4 `cloud_cover` score exists only in 2020–22 and tracks ERA5 (score 1 ≈ 43%, 4 ≈ 94%). `moonlight()` in `analytics/cloud.ts` = illumination × sin(moon altitude) × clear-sky fraction.
- Cloud vs water temperature must be compared within the same month: the cloudy wet season is also the warmest, so raw correlations are ~0 while within-month ones are strongly negative.

### Cyclones and heavy rain (#24)

- `fetch-external.mjs --only=cyclones` downloads the IBTrACS South Pacific CSV (~36 MB) and keeps track points within 750 km of Moorea since 2013 (`external/cyclones.csv`, `cyclone_points` table). Analyses use 500 km.
- Heavy-rain day = top 1% of ERA5 daily precipitation (the grid cell under-reads mountain rain).
- After-event catches are compared with other sets in the same season and month (observed / expected, bootstrap interval), never with all sets: storms and downpours cluster in the wet season.

### Catch model (#54)

- `analytics/catchModel.ts`: negative-binomial counts per timed gillnet set, offset log(net-hours), natural-spline day of season (knots at the 0/25/50/75/100% quantiles), nursery and season as effect-coded fixed effects (each level vs the average; no random effects), and nine environment terms per +1 SD. Complete cases only; nurseries need ≥ 30 complete sets, and a species gets a nursery effect only where ≥ 10 of it were caught (otherwise the estimate runs off to zero or infinity).
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ More than 130 server-rendered SVG charts and maps (several repeat per season, nu
- Raw temperature logger exports (HOBO and EnvLogger `.csv` files) can sit anywhere under `data/`, e.g. `data/Temperature loggers/`. They are read the same way: never edited, never committed.
- The app imports them into a derived SQLite cache on startup and re-imports automatically (within a minute) whenever a workbook is added or changed. Drop in next season's `Physioshark_Shark Log 2026-2027.xlsx` and the site updates.
- Anything odd the importer notices (unit conversions, impossible measurements, out-of-season dates, tag conflicts, unknown sites) is listed on the **Data quality** page for the lab to fix in the source sheets.
- Environmental data are public and live in `external/` (Open-Meteo ERA5 weather and waves, NOAA OISST, NOAA Coral Reef Watch via PacIOOS, UHSLC Papeete tide gauge, NOAA CPC ENSO indices). `scripts/fetch-external.mjs` refreshes them; a weekly workflow commits updates and publishes a new image.
- Environmental data are public and live in `external/` (Open-Meteo ERA5 weather and waves, NOAA OISST, NOAA Coral Reef Watch via PacIOOS, UHSLC Papeete tide gauge, NOAA CPC ENSO indices, NOAA IBTrACS cyclone tracks). `scripts/fetch-external.mjs` refreshes them; a weekly workflow commits updates and publishes a new image.
- Tests, CI and the container smoke test use **synthetic** workbooks in `samples/fixture/` (`pnpm fixture` regenerates them).

## Run locally
Expand Down Expand Up @@ -87,4 +87,4 @@ Read [AGENTS.md](AGENTS.md) before changing the importer, charts or release proc

## Credits

Survey data © the Physioshark project. Environmental data: Open-Meteo (CC BY 4.0, ERA5 © Copernicus/ECMWF), NOAA OISST v2.1, NOAA Coral Reef Watch (via PacIOOS), University of Hawaii Sea Level Center, NOAA Climate Prediction Center. Coastline and street map tiles © OpenStreetMap contributors (ODbL). Satellite imagery © Esri, Maxar, Earthstar Geographics.
Survey data © the Physioshark project. Environmental data: Open-Meteo (CC BY 4.0, ERA5 © Copernicus/ECMWF), NOAA OISST v2.1, NOAA Coral Reef Watch (via PacIOOS), University of Hawaii Sea Level Center, NOAA Climate Prediction Center, NOAA IBTrACS. Coastline and street map tiles © OpenStreetMap contributors (ODbL). Satellite imagery © Esri, Maxar, Earthstar Geographics.
11 changes: 11 additions & 0 deletions drizzle/0003_careless_blue_blade.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
CREATE TABLE `cyclone_points` (
`id` integer PRIMARY KEY NOT NULL,
`sid` text NOT NULL,
`name` text NOT NULL,
`ts` text NOT NULL,
`lat` real NOT NULL,
`lon` real NOT NULL,
`wind_kt` real,
`pres_hpa` real,
`dist_km` real NOT NULL
);
Loading
Loading