From 9f58423ff8ad079eb17b7ae6819fb8d807b2bc51 Mon Sep 17 00:00:00 2001 From: luen Date: Tue, 3 Nov 2026 14:06:26 +1000 Subject: [PATCH 1/2] Diet: read gastric lavage columns and chart stomach contents (#40) 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 --- AGENTS.md | 2 + drizzle/0002_cloudy_red_wolf.sql | 3 + drizzle/meta/0002_snapshot.json | 3060 +++++++++++++++++ drizzle/meta/_journal.json | 7 + .../Physioshark_Shark Log 2021-2022.xlsx | Bin 14623 -> 15670 bytes scripts/make-fixture.mjs | 15 +- src/lib/server/analytics/diet.ts | 117 + src/lib/server/analytics/findings.ts | 16 + src/lib/server/db/schema.ts | 4 + src/lib/server/import/import.test.ts | 16 + src/lib/server/import/index.ts | 5 +- src/lib/server/import/logs.ts | 26 +- src/lib/server/import/normalize.test.ts | 15 + src/lib/server/import/normalize.ts | 21 + src/lib/stats.test.ts | 21 + src/lib/stats.ts | 60 + src/routes/physiology/+page.server.ts | 2 + src/routes/physiology/+page.svelte | 116 +- 18 files changed, 3499 insertions(+), 7 deletions(-) create mode 100644 drizzle/0002_cloudy_red_wolf.sql create mode 100644 drizzle/meta/0002_snapshot.json create mode 100644 src/lib/server/analytics/diet.ts diff --git a/AGENTS.md b/AGENTS.md index 0873f2e..857b0c3 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -43,6 +43,7 @@ src/lib/server/data.ts loads the whole dataset into memory per import; memo() src/lib/server/analytics common.ts (CPUE, Fulton's K, recapture pairs…) · env.ts (per-set variables) findings.ts (live findings) · insitu.ts (logger temperature summaries) population.ts (Schnabel abundance, von Bertalanffy growth) + diet.ts (gastric lavage: fullness, prey groups) 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 src/lib/stats.ts regression, Spearman, Welch, Wilson, binomial, histograms, box stats @@ -62,6 +63,7 @@ samples/fixture/ synthetic workbooks for tests/CI (committed) - 2013-14 `Shark log physioshark` / `Set Log physioshark` duplicate `Catch data` / `Set Log` and are skipped (#9). 2013-14 recaptures are grouped in its `Recaptures` sheet; 2014-15 `Recaptures` holds extra catches; 2015-16 stores recaptures as horizontal column blocks (`1st Recap Site`…). - 2016-17 `Shark Log` has a date _value_ as its date header; 2021-22 `Set Log` has a garbled date header (`16(`). Both are handled. - Species codes: `Cm` blacktip, `Na` sicklefin lemon, `Nf` tawny nurse shark. 2024-25 writes the nurse shark as `GF` / `Gf1` (`GF Log Juv`), probably from _Ginglymostoma_, the Atlantic nurse shark genus; it is read as `Nf` (confirmed by Jodie Rummer, #12). +- Diet (#40): `Lavage (y/n)` / `Gastic lavage` → `captures.lavage`; `Lavage (full/empty)` / `Stomach content` → `stomach` (full | traces | empty; "no sample" is null); `Lavage (contents)` / `Stomach sample type` / 2013-14 `State of Stomach` → `stomach_contents` free text. A fullness cell that isn't a fullness word (e.g. "worm found") becomes contents. Analyses in `analytics/diet.ts` (fed = full or traces). - Individuals: union-find over tags (PIT 15-digit, `COFA 12345`, re-tags) plus recapture groups. Conflicting sex/species/shrinking length is logged, not fixed. - Captures link to sets by season + set number (±1 day), then date + site, then a unique set that date. - CPUE = max(set-log count, linked captures) / net-hours. 2013-14 has no set times (no CPUE). diff --git a/drizzle/0002_cloudy_red_wolf.sql b/drizzle/0002_cloudy_red_wolf.sql new file mode 100644 index 0000000..4336b60 --- /dev/null +++ b/drizzle/0002_cloudy_red_wolf.sql @@ -0,0 +1,3 @@ +ALTER TABLE `captures` ADD `lavage` integer;--> statement-breakpoint +ALTER TABLE `captures` ADD `stomach` text;--> statement-breakpoint +ALTER TABLE `captures` ADD `stomach_contents` text; \ No newline at end of file diff --git a/drizzle/meta/0002_snapshot.json b/drizzle/meta/0002_snapshot.json new file mode 100644 index 0000000..c248552 --- /dev/null +++ b/drizzle/meta/0002_snapshot.json @@ -0,0 +1,3060 @@ +{ + "version": "6", + "dialect": "sqlite", + "id": "e07a85a5-9c17-4708-aec2-c253925ce71c", + "prevId": "cbc44ba9-81dd-4198-816c-0e17c202c1f1", + "tables": { + "adult_captures": { + "name": "adult_captures", + "columns": { + "id": { + "name": "id", + "type": "integer", + "primaryKey": true, + "notNull": true, + "autoincrement": false + }, + "shark_id": { + "name": "shark_id", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "date": { + "name": "date", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "name": { + "name": "name", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "hooked_min": { + "name": "hooked_min", + "type": "real", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "boat_min": { + "name": "boat_min", + "type": "real", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "released_min": { + "name": "released_min", + "type": "real", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "fight_min": { + "name": "fight_min", + "type": "real", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "handling_min": { + "name": "handling_min", + "type": "real", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "lat": { + "name": "lat", + "type": "real", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "lon": { + "name": "lon", + "type": "real", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "site": { + "name": "site", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "sex": { + "name": "sex", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "maturity": { + "name": "maturity", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "repro_code": { + "name": "repro_code", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "pcl_mm": { + "name": "pcl_mm", + "type": "real", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "fl_mm": { + "name": "fl_mm", + "type": "real", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "tl_mm": { + "name": "tl_mm", + "type": "real", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "pec_girth_mm": { + "name": "pec_girth_mm", + "type": "real", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "dors_girth_mm": { + "name": "dors_girth_mm", + "type": "real", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "caud_girth_mm": { + "name": "caud_girth_mm", + "type": "real", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "clasper_inner": { + "name": "clasper_inner", + "type": "real", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "clasper_outer": { + "name": "clasper_outer", + "type": "real", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "sperm": { + "name": "sperm", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "ultrasound": { + "name": "ultrasound", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "pregnant": { + "name": "pregnant", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "blood1_min": { + "name": "blood1_min", + "type": "real", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "lact1": { + "name": "lact1", + "type": "real", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "gluc1": { + "name": "gluc1", + "type": "real", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "bhb1": { + "name": "bhb1", + "type": "real", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "blood2_min": { + "name": "blood2_min", + "type": "real", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "lact2": { + "name": "lact2", + "type": "real", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "gluc2": { + "name": "gluc2", + "type": "real", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "bhb2": { + "name": "bhb2", + "type": "real", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "tagged": { + "name": "tagged", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "bait": { + "name": "bait", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "comments": { + "name": "comments", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "source_file": { + "name": "source_file", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "source_sheet": { + "name": "source_sheet", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "source_row": { + "name": "source_row", + "type": "integer", + "primaryKey": false, + "notNull": false, + "autoincrement": false + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "checkConstraints": {} + }, + "adult_effort": { + "name": "adult_effort", + "columns": { + "id": { + "name": "id", + "type": "integer", + "primaryKey": true, + "notNull": true, + "autoincrement": false + }, + "date": { + "name": "date", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "session": { + "name": "session", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "bait_in_min": { + "name": "bait_in_min", + "type": "real", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "bait_out_min": { + "name": "bait_out_min", + "type": "real", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "soak_min": { + "name": "soak_min", + "type": "real", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "shark_times": { + "name": "shark_times", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "n_sharks": { + "name": "n_sharks", + "type": "integer", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "comments": { + "name": "comments", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "checkConstraints": {} + }, + "adult_samples": { + "name": "adult_samples", + "columns": { + "id": { + "name": "id", + "type": "integer", + "primaryKey": true, + "notNull": true, + "autoincrement": false + }, + "sample": { + "name": "sample", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "size_cm": { + "name": "size_cm", + "type": "real", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "sex": { + "name": "sex", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "island": { + "name": "island", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "location": { + "name": "location", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "year": { + "name": "year", + "type": "integer", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "notes": { + "name": "notes", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "checkConstraints": {} + }, + "blood": { + "name": "blood", + "columns": { + "id": { + "name": "id", + "type": "integer", + "primaryKey": true, + "notNull": true, + "autoincrement": false + }, + "season": { + "name": "season", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "site_id": { + "name": "site_id", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "date": { + "name": "date", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "species": { + "name": "species", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "experiment": { + "name": "experiment", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "shark_no": { + "name": "shark_no", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "hct": { + "name": "hct", + "type": "real", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "hb": { + "name": "hb", + "type": "real", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "cholesterol": { + "name": "cholesterol", + "type": "real", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "ffa": { + "name": "ffa", + "type": "real", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "triglycerides": { + "name": "triglycerides", + "type": "real", + "primaryKey": false, + "notNull": false, + "autoincrement": false + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "checkConstraints": {} + }, + "captures": { + "name": "captures", + "columns": { + "id": { + "name": "id", + "type": "integer", + "primaryKey": true, + "notNull": true, + "autoincrement": false + }, + "season": { + "name": "season", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "species": { + "name": "species", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "site_id": { + "name": "site_id", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "site_raw": { + "name": "site_raw", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "set_id": { + "name": "set_id", + "type": "integer", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "set_no": { + "name": "set_no", + "type": "integer", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "date": { + "name": "date", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "shark_no": { + "name": "shark_no", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "capture_no": { + "name": "capture_no", + "type": "integer", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "kind": { + "name": "kind", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "tag": { + "name": "tag", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "tags": { + "name": "tags", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "individual_id": { + "name": "individual_id", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "sex": { + "name": "sex", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "age_class": { + "name": "age_class", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "umbilical": { + "name": "umbilical", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "uss": { + "name": "uss", + "type": "integer", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "pcl_mm": { + "name": "pcl_mm", + "type": "real", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "fl_mm": { + "name": "fl_mm", + "type": "real", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "tl_mm": { + "name": "tl_mm", + "type": "real", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "pec_girth_mm": { + "name": "pec_girth_mm", + "type": "real", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "dors_girth_mm": { + "name": "dors_girth_mm", + "type": "real", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "caud_girth_mm": { + "name": "caud_girth_mm", + "type": "real", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "mass_kg": { + "name": "mass_kg", + "type": "real", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "clasper_l": { + "name": "clasper_l", + "type": "real", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "clasper_r": { + "name": "clasper_r", + "type": "real", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "capture_min": { + "name": "capture_min", + "type": "real", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "landing_min": { + "name": "landing_min", + "type": "real", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "release_min": { + "name": "release_min", + "type": "real", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "workup_min": { + "name": "workup_min", + "type": "real", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "to_lab": { + "name": "to_lab", + "type": "integer", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "died": { + "name": "died", + "type": "integer", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "blood": { + "name": "blood", + "type": "integer", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "dna": { + "name": "dna", + "type": "integer", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "us_area": { + "name": "us_area", + "type": "real", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "us_perimeter": { + "name": "us_perimeter", + "type": "real", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "habitat": { + "name": "habitat", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "tide_raw": { + "name": "tide_raw", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "notes": { + "name": "notes", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "lavage": { + "name": "lavage", + "type": "integer", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "stomach": { + "name": "stomach", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "stomach_contents": { + "name": "stomach_contents", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "min_after_sunset": { + "name": "min_after_sunset", + "type": "real", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "min_after_net_in": { + "name": "min_after_net_in", + "type": "real", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "tide_mm": { + "name": "tide_mm", + "type": "real", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "tide_trend": { + "name": "tide_trend", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "moon_illum": { + "name": "moon_illum", + "type": "real", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "moon_phase": { + "name": "moon_phase", + "type": "real", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "sst": { + "name": "sst", + "type": "real", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "dhw": { + "name": "dhw", + "type": "real", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "source_file": { + "name": "source_file", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "source_sheet": { + "name": "source_sheet", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "source_row": { + "name": "source_row", + "type": "integer", + "primaryKey": false, + "notNull": false, + "autoincrement": false + } + }, + "indexes": { + "captures_season": { + "name": "captures_season", + "columns": [ + "season" + ], + "isUnique": false + }, + "captures_site": { + "name": "captures_site", + "columns": [ + "site_id" + ], + "isUnique": false + }, + "captures_individual": { + "name": "captures_individual", + "columns": [ + "individual_id" + ], + "isUnique": false + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "checkConstraints": {} + }, + "climate_monthly": { + "name": "climate_monthly", + "columns": { + "ym": { + "name": "ym", + "type": "text", + "primaryKey": true, + "notNull": true, + "autoincrement": false + }, + "oni": { + "name": "oni", + "type": "real", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "soi": { + "name": "soi", + "type": "real", + "primaryKey": false, + "notNull": false, + "autoincrement": false + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "checkConstraints": {} + }, + "data_issues": { + "name": "data_issues", + "columns": { + "id": { + "name": "id", + "type": "integer", + "primaryKey": true, + "notNull": true, + "autoincrement": false + }, + "severity": { + "name": "severity", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "category": { + "name": "category", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "message": { + "name": "message", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "file": { + "name": "file", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "sheet": { + "name": "sheet", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "row": { + "name": "row", + "type": "integer", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "column": { + "name": "column", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "value": { + "name": "value", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "checkConstraints": {} + }, + "field_notes": { + "name": "field_notes", + "columns": { + "id": { + "name": "id", + "type": "integer", + "primaryKey": true, + "notNull": true, + "autoincrement": false + }, + "season": { + "name": "season", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "date": { + "name": "date", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "site_id": { + "name": "site_id", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "kind": { + "name": "kind", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "ref_id": { + "name": "ref_id", + "type": "integer", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "species": { + "name": "species", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "text": { + "name": "text", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "checkConstraints": {} + }, + "field_wq": { + "name": "field_wq", + "columns": { + "id": { + "name": "id", + "type": "integer", + "primaryKey": true, + "notNull": true, + "autoincrement": false + }, + "season": { + "name": "season", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "date": { + "name": "date", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "site_id": { + "name": "site_id", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "time_min": { + "name": "time_min", + "type": "real", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "depth_cm": { + "name": "depth_cm", + "type": "real", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "salinity": { + "name": "salinity", + "type": "real", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "do_mg": { + "name": "do_mg", + "type": "real", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "do_pct": { + "name": "do_pct", + "type": "real", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "temp": { + "name": "temp", + "type": "real", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "ph": { + "name": "ph", + "type": "real", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "source": { + "name": "source", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "checkConstraints": {} + }, + "hobo": { + "name": "hobo", + "columns": { + "id": { + "name": "id", + "type": "integer", + "primaryKey": true, + "notNull": true, + "autoincrement": false + }, + "season": { + "name": "season", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "site_id": { + "name": "site_id", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "site_raw": { + "name": "site_raw", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "logger": { + "name": "logger", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "deployed": { + "name": "deployed", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "retrieved": { + "name": "retrieved", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "status": { + "name": "status", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "notes": { + "name": "notes", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "checkConstraints": {} + }, + "individuals": { + "name": "individuals", + "columns": { + "id": { + "name": "id", + "type": "text", + "primaryKey": true, + "notNull": true, + "autoincrement": false + }, + "species": { + "name": "species", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "sex": { + "name": "sex", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "first_date": { + "name": "first_date", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "last_date": { + "name": "last_date", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "n_captures": { + "name": "n_captures", + "type": "integer", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "n_seasons": { + "name": "n_seasons", + "type": "integer", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "sites": { + "name": "sites", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "first_tl_mm": { + "name": "first_tl_mm", + "type": "real", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "last_tl_mm": { + "name": "last_tl_mm", + "type": "real", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "tags": { + "name": "tags", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "conflict": { + "name": "conflict", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "checkConstraints": {} + }, + "lab_feeding": { + "name": "lab_feeding", + "columns": { + "id": { + "name": "id", + "type": "integer", + "primaryKey": true, + "notNull": true, + "autoincrement": false + }, + "season": { + "name": "season", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "date": { + "name": "date", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "tank": { + "name": "tank", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "shark": { + "name": "shark", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "tag": { + "name": "tag", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "food_g": { + "name": "food_g", + "type": "real", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "rejected_g": { + "name": "rejected_g", + "type": "real", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "pct": { + "name": "pct", + "type": "real", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "notes": { + "name": "notes", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "checkConstraints": {} + }, + "lab_sharks": { + "name": "lab_sharks", + "columns": { + "id": { + "name": "id", + "type": "integer", + "primaryKey": true, + "notNull": true, + "autoincrement": false + }, + "season": { + "name": "season", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "shark_no": { + "name": "shark_no", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "tag": { + "name": "tag", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "individual_id": { + "name": "individual_id", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "species": { + "name": "species", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "sex": { + "name": "sex", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "site_id": { + "name": "site_id", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "arrival_date": { + "name": "arrival_date", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "release_date": { + "name": "release_date", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "days": { + "name": "days", + "type": "real", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "arr_tl_mm": { + "name": "arr_tl_mm", + "type": "real", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "arr_fl_mm": { + "name": "arr_fl_mm", + "type": "real", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "arr_mass_kg": { + "name": "arr_mass_kg", + "type": "real", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "rel_tl_mm": { + "name": "rel_tl_mm", + "type": "real", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "rel_fl_mm": { + "name": "rel_fl_mm", + "type": "real", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "rel_mass_kg": { + "name": "rel_mass_kg", + "type": "real", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "tank": { + "name": "tank", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "project": { + "name": "project", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "died": { + "name": "died", + "type": "integer", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "notes": { + "name": "notes", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "source_file": { + "name": "source_file", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "source_sheet": { + "name": "source_sheet", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "source_row": { + "name": "source_row", + "type": "integer", + "primaryKey": false, + "notNull": false, + "autoincrement": false + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "checkConstraints": {} + }, + "lab_wq": { + "name": "lab_wq", + "columns": { + "id": { + "name": "id", + "type": "integer", + "primaryKey": true, + "notNull": true, + "autoincrement": false + }, + "season": { + "name": "season", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "date": { + "name": "date", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "time_min": { + "name": "time_min", + "type": "real", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "tank": { + "name": "tank", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "temp": { + "name": "temp", + "type": "real", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "ph": { + "name": "ph", + "type": "real", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "do_mg": { + "name": "do_mg", + "type": "real", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "do_pct": { + "name": "do_pct", + "type": "real", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "salinity": { + "name": "salinity", + "type": "real", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "recorder": { + "name": "recorder", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "notes": { + "name": "notes", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "checkConstraints": {} + }, + "logger_daily": { + "name": "logger_daily", + "columns": { + "id": { + "name": "id", + "type": "integer", + "primaryKey": true, + "notNull": true, + "autoincrement": false + }, + "site_id": { + "name": "site_id", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "date": { + "name": "date", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "mean": { + "name": "mean", + "type": "real", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "min": { + "name": "min", + "type": "real", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "max": { + "name": "max", + "type": "real", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "hours": { + "name": "hours", + "type": "integer", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "loggers": { + "name": "loggers", + "type": "integer", + "primaryKey": false, + "notNull": true, + "autoincrement": false + } + }, + "indexes": { + "logger_daily_site": { + "name": "logger_daily_site", + "columns": [ + "site_id" + ], + "isUnique": false + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "checkConstraints": {} + }, + "logger_diel": { + "name": "logger_diel", + "columns": { + "id": { + "name": "id", + "type": "integer", + "primaryKey": true, + "notNull": true, + "autoincrement": false + }, + "site_id": { + "name": "site_id", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "month": { + "name": "month", + "type": "integer", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "hour": { + "name": "hour", + "type": "integer", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "temp": { + "name": "temp", + "type": "real", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "n": { + "name": "n", + "type": "integer", + "primaryKey": false, + "notNull": true, + "autoincrement": false + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "checkConstraints": {} + }, + "logger_files": { + "name": "logger_files", + "columns": { + "id": { + "name": "id", + "type": "integer", + "primaryKey": true, + "notNull": true, + "autoincrement": false + }, + "file": { + "name": "file", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "system": { + "name": "system", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "logger": { + "name": "logger", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "serial": { + "name": "serial", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "site_id": { + "name": "site_id", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "site_basis": { + "name": "site_basis", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "start": { + "name": "start", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "end": { + "name": "end", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "samples": { + "name": "samples", + "type": "integer", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "kept": { + "name": "kept", + "type": "integer", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "lat": { + "name": "lat", + "type": "real", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "lon": { + "name": "lon", + "type": "real", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "excluded": { + "name": "excluded", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "checkConstraints": {} + }, + "meta": { + "name": "meta", + "columns": { + "key": { + "name": "key", + "type": "text", + "primaryKey": true, + "notNull": true, + "autoincrement": false + }, + "value": { + "name": "value", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "checkConstraints": {} + }, + "mouth": { + "name": "mouth", + "columns": { + "id": { + "name": "id", + "type": "integer", + "primaryKey": true, + "notNull": true, + "autoincrement": false + }, + "season": { + "name": "season", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "shark_no": { + "name": "shark_no", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "site_id": { + "name": "site_id", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "tag": { + "name": "tag", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "species": { + "name": "species", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "sex": { + "name": "sex", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "mol": { + "name": "mol", + "type": "real", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "mow": { + "name": "mow", + "type": "real", + "primaryKey": false, + "notNull": false, + "autoincrement": false + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "checkConstraints": {} + }, + "ocean_daily": { + "name": "ocean_daily", + "columns": { + "date": { + "name": "date", + "type": "text", + "primaryKey": true, + "notNull": true, + "autoincrement": false + }, + "oisst": { + "name": "oisst", + "type": "real", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "crw_sst": { + "name": "crw_sst", + "type": "real", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "crw_anom": { + "name": "crw_anom", + "type": "real", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "crw_hotspot": { + "name": "crw_hotspot", + "type": "real", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "crw_dhw": { + "name": "crw_dhw", + "type": "real", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "crw_baa": { + "name": "crw_baa", + "type": "real", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "wave_max": { + "name": "wave_max", + "type": "real", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "wave_period": { + "name": "wave_period", + "type": "real", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "wave_dir": { + "name": "wave_dir", + "type": "real", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "swell_max": { + "name": "swell_max", + "type": "real", + "primaryKey": false, + "notNull": false, + "autoincrement": false + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "checkConstraints": {} + }, + "prey": { + "name": "prey", + "columns": { + "id": { + "name": "id", + "type": "integer", + "primaryKey": true, + "notNull": true, + "autoincrement": false + }, + "season": { + "name": "season", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "date": { + "name": "date", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "location": { + "name": "location", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "name": { + "name": "name", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "size": { + "name": "size", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "notes": { + "name": "notes", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "checkConstraints": {} + }, + "set_crew": { + "name": "set_crew", + "columns": { + "id": { + "name": "id", + "type": "integer", + "primaryKey": true, + "notNull": true, + "autoincrement": false + }, + "set_id": { + "name": "set_id", + "type": "integer", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "person": { + "name": "person", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + } + }, + "indexes": { + "set_crew_set": { + "name": "set_crew_set", + "columns": [ + "set_id" + ], + "isUnique": false + }, + "set_crew_person": { + "name": "set_crew_person", + "columns": [ + "person" + ], + "isUnique": false + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "checkConstraints": {} + }, + "sets": { + "name": "sets", + "columns": { + "id": { + "name": "id", + "type": "integer", + "primaryKey": true, + "notNull": true, + "autoincrement": false + }, + "season": { + "name": "season", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "set_no": { + "name": "set_no", + "type": "integer", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "site_id": { + "name": "site_id", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "site_raw": { + "name": "site_raw", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "date": { + "name": "date", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "weekday": { + "name": "weekday", + "type": "integer", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "gear": { + "name": "gear", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "visit": { + "name": "visit", + "type": "integer", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "crew_raw": { + "name": "crew_raw", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "crew_size": { + "name": "crew_size", + "type": "integer", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "start_min": { + "name": "start_min", + "type": "real", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "end_min": { + "name": "end_min", + "type": "real", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "duration_min": { + "name": "duration_min", + "type": "real", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "n_cm": { + "name": "n_cm", + "type": "integer", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "n_na": { + "name": "n_na", + "type": "integer", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "n_nf": { + "name": "n_nf", + "type": "integer", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "n_total": { + "name": "n_total", + "type": "integer", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "n_linked": { + "name": "n_linked", + "type": "integer", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "cpue": { + "name": "cpue", + "type": "real", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "cpue_cm": { + "name": "cpue_cm", + "type": "real", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "cpue_na": { + "name": "cpue_na", + "type": "real", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "cpue_sheet": { + "name": "cpue_sheet", + "type": "real", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "tide_raw": { + "name": "tide_raw", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "moon_raw": { + "name": "moon_raw", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "weather_raw": { + "name": "weather_raw", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "cloud_cover": { + "name": "cloud_cover", + "type": "real", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "water_temp": { + "name": "water_temp", + "type": "real", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "ph": { + "name": "ph", + "type": "real", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "do_mg": { + "name": "do_mg", + "type": "real", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "do_pct": { + "name": "do_pct", + "type": "real", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "salinity": { + "name": "salinity", + "type": "real", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "depth_cm": { + "name": "depth_cm", + "type": "real", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "notes": { + "name": "notes", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "sunset_min": { + "name": "sunset_min", + "type": "real", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "civil_dusk_min": { + "name": "civil_dusk_min", + "type": "real", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "moon_phase": { + "name": "moon_phase", + "type": "real", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "moon_illum": { + "name": "moon_illum", + "type": "real", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "moon_alt_mid": { + "name": "moon_alt_mid", + "type": "real", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "tide_start_mm": { + "name": "tide_start_mm", + "type": "real", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "tide_mid_mm": { + "name": "tide_mid_mm", + "type": "real", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "tide_trend": { + "name": "tide_trend", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "tide_range_mm": { + "name": "tide_range_mm", + "type": "real", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "air_temp": { + "name": "air_temp", + "type": "real", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "wind_speed": { + "name": "wind_speed", + "type": "real", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "wind_dir": { + "name": "wind_dir", + "type": "real", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "gusts": { + "name": "gusts", + "type": "real", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "rain_24h": { + "name": "rain_24h", + "type": "real", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "rain_evening": { + "name": "rain_evening", + "type": "real", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "cloud_evening": { + "name": "cloud_evening", + "type": "real", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "pressure": { + "name": "pressure", + "type": "real", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "sst": { + "name": "sst", + "type": "real", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "sst_anom": { + "name": "sst_anom", + "type": "real", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "dhw": { + "name": "dhw", + "type": "real", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "wave_height": { + "name": "wave_height", + "type": "real", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "swell_height": { + "name": "swell_height", + "type": "real", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "oni": { + "name": "oni", + "type": "real", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "insitu_temp": { + "name": "insitu_temp", + "type": "real", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "source_file": { + "name": "source_file", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "source_sheet": { + "name": "source_sheet", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "source_row": { + "name": "source_row", + "type": "integer", + "primaryKey": false, + "notNull": false, + "autoincrement": false + } + }, + "indexes": { + "sets_season": { + "name": "sets_season", + "columns": [ + "season" + ], + "isUnique": false + }, + "sets_site": { + "name": "sets_site", + "columns": [ + "site_id" + ], + "isUnique": false + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "checkConstraints": {} + }, + "sites": { + "name": "sites", + "columns": { + "id": { + "name": "id", + "type": "text", + "primaryKey": true, + "notNull": true, + "autoincrement": false + }, + "name": { + "name": "name", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "code": { + "name": "code", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "island": { + "name": "island", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "kind": { + "name": "kind", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "lat": { + "name": "lat", + "type": "real", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "lon": { + "name": "lon", + "type": "real", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "coord_source": { + "name": "coord_source", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "retired": { + "name": "retired", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "fishing_effort": { + "name": "fishing_effort", + "type": "real", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "human_impact": { + "name": "human_impact", + "type": "real", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "artificialisation": { + "name": "artificialisation", + "type": "real", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "pressure_composite": { + "name": "pressure_composite", + "type": "real", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "pressure_tier": { + "name": "pressure_tier", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "directions": { + "name": "directions", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "habitat": { + "name": "habitat", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "aliases": { + "name": "aliases", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "checkConstraints": {} + }, + "tide_extrema": { + "name": "tide_extrema", + "columns": { + "ts": { + "name": "ts", + "type": "text", + "primaryKey": true, + "notNull": true, + "autoincrement": false + }, + "kind": { + "name": "kind", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "mm": { + "name": "mm", + "type": "real", + "primaryKey": false, + "notNull": true, + "autoincrement": false + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "checkConstraints": {} + }, + "tide_hourly": { + "name": "tide_hourly", + "columns": { + "ts": { + "name": "ts", + "type": "text", + "primaryKey": true, + "notNull": true, + "autoincrement": false + }, + "mm": { + "name": "mm", + "type": "real", + "primaryKey": false, + "notNull": true, + "autoincrement": false + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "checkConstraints": {} + }, + "weather_daily": { + "name": "weather_daily", + "columns": { + "date": { + "name": "date", + "type": "text", + "primaryKey": true, + "notNull": true, + "autoincrement": false + }, + "tmax": { + "name": "tmax", + "type": "real", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "tmin": { + "name": "tmin", + "type": "real", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "tmean": { + "name": "tmean", + "type": "real", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "precip": { + "name": "precip", + "type": "real", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "wind_max": { + "name": "wind_max", + "type": "real", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "gust_max": { + "name": "gust_max", + "type": "real", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "wind_dir": { + "name": "wind_dir", + "type": "real", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "radiation": { + "name": "radiation", + "type": "real", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "cloud": { + "name": "cloud", + "type": "real", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "pressure": { + "name": "pressure", + "type": "real", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "humidity": { + "name": "humidity", + "type": "real", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "sunshine_h": { + "name": "sunshine_h", + "type": "real", + "primaryKey": false, + "notNull": false, + "autoincrement": false + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "checkConstraints": {} + }, + "weather_hourly": { + "name": "weather_hourly", + "columns": { + "ts": { + "name": "ts", + "type": "text", + "primaryKey": true, + "notNull": true, + "autoincrement": false + }, + "temp": { + "name": "temp", + "type": "real", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "precip": { + "name": "precip", + "type": "real", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "cloud": { + "name": "cloud", + "type": "real", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "wind": { + "name": "wind", + "type": "real", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "wind_dir": { + "name": "wind_dir", + "type": "real", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "gust": { + "name": "gust", + "type": "real", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "pressure": { + "name": "pressure", + "type": "real", + "primaryKey": false, + "notNull": false, + "autoincrement": false + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "checkConstraints": {} + } + }, + "views": {}, + "enums": {}, + "_meta": { + "schemas": {}, + "tables": {}, + "columns": {} + }, + "internal": { + "indexes": {} + } +} \ No newline at end of file diff --git a/drizzle/meta/_journal.json b/drizzle/meta/_journal.json index a859206..cbd1e96 100644 --- a/drizzle/meta/_journal.json +++ b/drizzle/meta/_journal.json @@ -15,6 +15,13 @@ "when": 1793666235332, "tag": "0001_breezy_phantom_reporter", "breakpoints": true + }, + { + "idx": 2, + "version": "6", + "when": 1793678374777, + "tag": "0002_cloudy_red_wolf", + "breakpoints": true } ] } \ No newline at end of file diff --git a/samples/fixture/Physioshark_Shark Log 2021-2022.xlsx b/samples/fixture/Physioshark_Shark Log 2021-2022.xlsx index d775785a6c85fdf9af73113876bc38e1a57f1f84..203a1b8956c25e76bcb358e957250ebe7da188e9 100644 GIT binary patch delta 11075 zcmZX41yq#rw=GCYcXxM(qzDX1cjwRoQcA~1hXYd5r3lgu0@6d5sB||3XhyIGwxVPyIlJpzK~6U1a36f!`7$LF&xveYc9-;W2+B>eOC4zP04|YC9yXe;4Rr{t)vc?R=7LGstbg7hjbnuU7Y5 zZz`(e{`dCr&hEqh(b37>VvE=A&En+4_4x1@?pR)jf1{DcgZI(Fj@yFN-&X$s-zDJk zApU-JaT$;fy1L)opYBe(fAAr`%fnr6yY-N4e>lIt?JnZIEn56^e)0{#$+R$E%Ju3$ z>Tu0lrZr!_Xvx!1*N8uqn4Z4B)M$zN?M?eU+orK){a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psLl%Ov)WTy3is8Jqp8&nucuF|f~o!(_uP3X zVetO-LKGE)Qe!ObCQeJx?`GDAeBXGUG8##Qk`vwi##^7IGxtE~*MYMp|2y=M^*zzr zDHYT^-5!{bV+jfMtI{>(_}v=({yN5QSB_xkykN< zA)ru~`ndGd-J<(Qfn!zEZ`?83PB>9~LFQSGh9XNg>EyO9djx8twNeYODTs_3+d-xI zz8b`h5U-^fn=X6VqnG6&`qzkl5yewxyT$E)TBY@V&5-9MU`!OHqt=HEYr=}s7pQ?` z7nkV)Li}5J@Y1jEuPE;bOzI94dfyj#`D>t16jSl#AX~|oO&q2gJFyyYPghC*Bm=FjV1cDHT@!fuvW&wMAyQaa!Z`T>v)7zC*LhN=ml8`6< q{~xPC5M>gg%r|@gOY0B_HTWIe|Ngo0Bko~SAm}71a4sL;Z2u2SqJZ!K diff --git a/scripts/make-fixture.mjs b/scripts/make-fixture.mjs index bde8986..7bb837b 100644 --- a/scripts/make-fixture.mjs +++ b/scripts/make-fixture.mjs @@ -111,7 +111,10 @@ const cm = [ 'Release Time', 'US', 'Photo ', - 'Notes' + 'Notes', + 'Gastic lavage', + 'Stomach content ', + 'Stomach sample type ' ] ]; const na = [cm[0].slice()]; @@ -160,7 +163,15 @@ for (let i = 0; i < 40; i++) { T(start + 30 + k * 25), open ? 'Open' : 'Closed', 'Yes', - k === 0 && i % 7 === 0 ? 'Synthetic note: ray swimming along the net' : null + k === 0 && i % 7 === 0 ? 'Synthetic note: ray swimming along the net' : null, + // Gastric lavage on every other blacktip (deterministic, so other values don't shift). + ...(species === 'Cm' && shark.Cm % 2 === 0 + ? [ + 'yes', + ['empty', 'traces of food', 'full'][shark.Cm % 3], + shark.Cm % 3 === 2 ? 'small fish' : 'na' + ] + : ['no', 'no sample', 'na']) ]; (species === 'Cm' ? cm : na).push(row); if (species === 'Cm') nCm++; diff --git a/src/lib/server/analytics/diet.ts b/src/lib/server/analytics/diet.ts new file mode 100644 index 0000000..687e230 --- /dev/null +++ b/src/lib/server/analytics/diet.ts @@ -0,0 +1,117 @@ +/** + * Stomach contents from gastric lavage (#40): 2016-17 (full/empty + contents) and 2020-21 + * (empty / traces / full). "Fed" = anything in the stomach (full or traces). Exploratory: a + * lavage only sees the last few hours of feeding. + */ +import { boxStats, chiSquare, welch, wilson } from '#lib/stats'; +import type { Capture, Dataset } from '../data'; +import { fieldCaptures, fulton, round } from './common'; + +export const PREY_GROUPS = [ + { key: 'fish', label: 'Fish', re: /fish|bone|vertebra|lens|scale|surgeon|tuna|goby|mullet/ }, + { key: 'crustacean', label: 'Crustaceans', re: /shrimp|crab|crustac|prawn|isopod|amphipod/ }, + { key: 'other', label: 'Worms and molluscs', re: /worm|squid|octopus|mollus|snail|polych/ }, + { key: 'plastic', label: 'Plastic', re: /plastic/ }, + { key: 'unknown', label: 'Unidentified', re: /goo|unident|chunk|meat|muscle|piece|mush/ } +] as const; + +const fed = (c: Capture) => c.stomach === 'full' || c.stomach === 'traces'; + +function share(caps: Capture[]) { + const k = caps.filter(fed).length; + const ci = wilson(k, caps.length); + return { + n: caps.length, + fed: k, + rate: caps.length ? round(k / caps.length, 3) : null, + lo: round(ci?.lo, 3), + hi: round(ci?.hi, 3) + }; +} + +/** Chi-square across groups of fed / not fed. */ +const test = (groups: Capture[][]) => + chiSquare(groups.map((g) => [g.filter(fed).length, g.filter((c) => !fed(c)).length])); + +const MOON = [ + { label: 'New moon', test: (p: number) => p < 0.125 || p >= 0.875 }, + { label: 'First quarter', test: (p: number) => p >= 0.125 && p < 0.375 }, + { label: 'Full moon', test: (p: number) => p >= 0.375 && p < 0.625 }, + { label: 'Last quarter', test: (p: number) => p >= 0.625 && p < 0.875 } +]; + +const AFTER_SUNSET = [ + { label: 'Before sunset', lo: -Infinity, hi: 0 }, + { label: '0–1 h after', lo: 0, hi: 60 }, + { label: '1 h or more after', lo: 60, hi: Infinity } +]; + +const SCAR = [ + { key: 'open', label: 'Open scar (newborn)' }, + { key: 'semi', label: 'Healing scar' }, + { key: 'closed', label: 'Healed scar' } +] as const; + +export function diet(d: Dataset) { + const checked = fieldCaptures(d).filter((c) => c.stomach != null); + const cm = checked.filter((c) => c.species === 'Cm'); + if (!checked.length) return null; + + const bySeason = [...new Set(checked.map((c) => `${c.season}|${c.species}`))] + .sort() + .map((k) => { + const [season, species] = k.split('|'); + const g = checked.filter((c) => c.season === season && c.species === species); + return { + season, + species, + n: g.length, + full: g.filter((c) => c.stomach === 'full').length, + traces: g.filter((c) => c.stomach === 'traces').length, + empty: g.filter((c) => c.stomach === 'empty').length + }; + }) + .filter((r) => r.n >= 10); + + const scarGroups = SCAR.map((s) => cm.filter((c) => c.umbilical === s.key)); + const moonGroups = MOON.map((m) => cm.filter((c) => c.moonPhase != null && m.test(c.moonPhase))); + const sunsetGroups = AFTER_SUNSET.map((b) => + cm.filter( + (c) => c.minAfterSunset != null && c.minAfterSunset >= b.lo && c.minAfterSunset < b.hi + ) + ); + + // Body condition of fed vs empty blacktips (Fulton's K). + const kFed = cm.filter(fed).map(fulton); + const kEmpty = cm.filter((c) => !fed(c)).map(fulton); + const kTest = welch(kFed, kEmpty); + + // Prey groups named in the free-text contents (any species). + const withContents = checked.filter((c) => c.stomachContents); + const prey = PREY_GROUPS.map((g) => ({ + key: g.key, + label: g.label, + n: withContents.filter((c) => g.re.test(c.stomachContents!.toLowerCase())).length + })).filter((g) => g.n > 0); + + return { + n: checked.length, + nCm: cm.length, + seasons: [...new Set(checked.map((c) => c.season))].sort(), + bySeason, + cmFed: share(cm), + scar: SCAR.map((s, i) => ({ label: s.label, ...share(scarGroups[i]) })), + scarTest: test(scarGroups), + moon: MOON.map((m, i) => ({ label: m.label, ...share(moonGroups[i]) })), + moonTest: test(moonGroups), + sunset: AFTER_SUNSET.map((b, i) => ({ label: b.label, ...share(sunsetGroups[i]) })), + sunsetTest: test(sunsetGroups), + condition: [ + { name: 'Food in stomach', stats: boxStats(kFed) }, + { name: 'Empty', stats: boxStats(kEmpty) } + ].filter((b) => b.stats && b.stats.n >= 5), + conditionP: kTest?.p ?? null, + withContents: withContents.length, + prey + }; +} diff --git a/src/lib/server/analytics/findings.ts b/src/lib/server/analytics/findings.ts index 495b8d3..b4ab1a7 100644 --- a/src/lib/server/analytics/findings.ts +++ b/src/lib/server/analytics/findings.ts @@ -19,6 +19,7 @@ import { siteName } from './common'; import { cloudWater } from './cloud'; +import { diet } from './diet'; import { dailyMaxBySite, versusSst } from './insitu'; export interface Finding { @@ -391,6 +392,21 @@ function compute(d: Dataset): Finding[] { href: '/drivers' }); + // Stomach contents (#40) + const dt = diet(d); + if (dt && dt.nCm >= 30 && dt.cmFed.rate != null) { + const items = [...dt.prey].filter((p) => p.key !== 'unknown').sort((a, b) => b.n - a.n); + const plastic = dt.prey.find((p) => p.key === 'plastic')?.n ?? 0; + out.push({ + id: 'lavage', + kind: 'pattern', + title: dt.cmFed.rate < 0.5 ? 'Most pups have an empty stomach' : 'Most pups had eaten', + value: `${pct(dt.cmFed.rate)} fed`, + text: `Of ${num(dt.nCm)} blacktips checked by gastric lavage, ${num(dt.cmFed.fed)} had food in the stomach.${items.length ? ` ${items[0].label} turn up most often in the samples (${items[0].n})${items[1] ? `, then ${items[1].label.toLowerCase()} (${items[1].n})` : ''}.` : ''}${plastic ? ` ${plastic === 1 ? 'One sample' : `${plastic} samples`} contained plastic.` : ''}`, + href: '/physiology' + }); + } + // Fun totals const totalTl = caps.reduce((a, c) => a + (c.tlMm ?? 0), 0) / 1e6; const totalKg = caps.reduce((a, c) => a + (c.massKg ?? 0), 0); diff --git a/src/lib/server/db/schema.ts b/src/lib/server/db/schema.ts index f8ce78d..4bc6d50 100644 --- a/src/lib/server/db/schema.ts +++ b/src/lib/server/db/schema.ts @@ -160,6 +160,10 @@ export const captures = sqliteTable( habitat: text('habitat'), tideRaw: text('tide_raw'), notes: text('notes'), + // Gastric lavage (#40): done?, fullness (full | traces | empty), free-text contents. + lavage: integer('lavage'), + stomach: text('stomach'), + stomachContents: text('stomach_contents'), // Environment joined at import time. minAfterSunset: real('min_after_sunset'), minAfterNetIn: real('min_after_net_in'), diff --git a/src/lib/server/import/import.test.ts b/src/lib/server/import/import.test.ts index 2eb9c2b..09998b4 100644 --- a/src/lib/server/import/import.test.ts +++ b/src/lib/server/import/import.test.ts @@ -1,5 +1,6 @@ import { describe, expect, it } from 'vitest'; import { dataset } from '../data'; +import { diet } from '../analytics/diet'; import { topFindings } from '../analytics/findings'; import { seasonRewind } from '../analytics/rewind'; @@ -53,6 +54,21 @@ describe('import of the synthetic fixture', () => { expect(d.notes.some((n) => n.text.includes('ray swimming'))).toBe(true); }); + it('reads gastric lavage columns (#40)', () => { + const checked = d.captures.filter((c) => c.stomach != null); + expect(checked.length).toBeGreaterThan(5); + expect(checked.every((c) => c.species === 'Cm' && c.lavage === 1)).toBe(true); + expect(new Set(checked.map((c) => c.stomach))).toEqual(new Set(['empty', 'traces', 'full'])); + // "no sample" and "na" are not contents; only the full stomachs name food. + const named = d.captures.filter((c) => c.stomachContents); + expect(named.every((c) => c.stomach === 'full' && c.stomachContents === 'small fish')).toBe( + true + ); + const r = diet(d)!; + expect(r.nCm).toBe(checked.length); + expect(r.prey.map((p) => p.key)).toEqual(['fish']); + }); + it('computes findings without throwing', () => { expect(topFindings(d).length).toBeGreaterThan(3); }); diff --git a/src/lib/server/import/index.ts b/src/lib/server/import/index.ts index 42723c6..a3e90ce 100644 --- a/src/lib/server/import/index.ts +++ b/src/lib/server/import/index.ts @@ -73,7 +73,7 @@ import { SITE_DEFS } from './sites'; import { readWorkbook } from './xlsx'; /** Bump when import logic changes so existing caches rebuild on the next start. */ -export const IMPORTER_VERSION = '5'; +export const IMPORTER_VERSION = '6'; const MIGRATIONS = import.meta.glob('/drizzle/*.sql', { query: '?raw', @@ -743,6 +743,9 @@ export function runImport( habitat: c.habitat, tideRaw: c.tideRaw, notes: c.notes, + lavage: c.lavage, + stomach: c.stomach, + stomachContents: c.stomachContents, ...env, sourceFile: c.ref.file, sourceSheet: c.ref.sheet, diff --git a/src/lib/server/import/logs.ts b/src/lib/server/import/logs.ts index a8d108e..e3b14f4 100644 --- a/src/lib/server/import/logs.ts +++ b/src/lib/server/import/logs.ts @@ -7,6 +7,7 @@ import { parseCrew } from './crew'; import type { IssueLog, SourceRef } from './issues'; import { ageClassOf, + contentsOf, dateOf, durationOf, fixSeasonYear, @@ -15,6 +16,7 @@ import { num, sexOf, speciesOf, + stomachOf, str, tagsOf, text, @@ -24,7 +26,8 @@ import { umbilicalOf, yesNo, type AgeClass, - type SpeciesCode + type SpeciesCode, + type StomachState } from './normalize'; import { resolveSite } from './sites'; import type { CellValue, Sheet } from './xlsx'; @@ -66,6 +69,10 @@ export interface RawCapture { habitat: string | null; tideRaw: string | null; notes: string | null; + /** Gastric lavage done (#40). */ + lavage: number | null; + stomach: StomachState | null; + stomachContents: string | null; /** Grouping key from a "Recaptures" sheet (2013-15) used to link untagged captures. */ group?: string; ref: SourceRef; @@ -142,7 +149,9 @@ const CAPTURE_SPEC = { tide: [eq('tide')], notes: [eq('notes', 'notes s', 'comments', 'comment')], recapPrev: [/^recap from previous year/], - stomach: [/^stomach content/, /^lavage contents/] + lavage: [eq('lavage y n', 'gastic lavage', 'gastric lavage', 'eversion lavage')], + stomach: [eq('lavage full empty', 'stomach content', 'stomach contents')], + contents: [eq('lavage contents', 'stomach sample type', 'state of stomach')] } satisfies Record; /** Does this sheet hold shark captures (and not lab/set/HOBO/PIT logs)? */ @@ -355,6 +364,13 @@ export function parseCaptureSheet( ) kind = 'hook'; const notesLower = (notes ?? '').toLowerCase(); + // Fullness and contents share columns across seasons; whatever isn't a fullness word is content. + const stomachCell = cell(row, c.stomach); + const stomach = stomachOf(stomachCell); + const stomachContents = + [contentsOf(cell(row, c.contents)), stomach ? null : contentsOf(stomachCell)] + .filter(Boolean) + .join('; ') || null; const rec: RawCapture = { season, species, @@ -395,6 +411,9 @@ export function parseCaptureSheet( habitat, tideRaw: text(cell(row, c.tide)), notes, + lavage: yesNo(cell(row, c.lavage)) ?? (stomach || stomachContents ? 1 : null), + stomach, + stomachContents, ref }; if (!rec.sex && !isBlank(cell(row, c.sex)) && cell(row, c.sex) != null) @@ -567,6 +586,9 @@ export function parseRecaptures2014( habitat: null, tideRaw: null, notes, + lavage: null, + stomach: null, + stomachContents: null, ref }); } diff --git a/src/lib/server/import/normalize.test.ts b/src/lib/server/import/normalize.test.ts index 7174b85..b80929d 100644 --- a/src/lib/server/import/normalize.test.ts +++ b/src/lib/server/import/normalize.test.ts @@ -2,6 +2,7 @@ import { describe, expect, it } from 'vitest'; import { parseCrew } from './crew'; import { ageClassOf, + contentsOf, dateOf, dmsToDecimal, fixSeasonYear, @@ -10,6 +11,7 @@ import { seasonOf, sexOf, speciesOf, + stomachOf, tagsOf, timeOf, umbilicalFromNotes, @@ -19,6 +21,19 @@ import { resolveSite } from './sites'; import { ExcelDate } from './xlsx'; describe('cell parsers', () => { + it('reads stomach fullness and contents (#40)', () => { + expect(stomachOf('Full')).toBe('full'); + expect(stomachOf('empty')).toBe('empty'); + expect(stomachOf('almost empty')).toBe('traces'); + expect(stomachOf('traces of food')).toBe('traces'); + expect(stomachOf('no sample')).toBeNull(); + expect(stomachOf('n/a')).toBeNull(); + expect(stomachOf('worm found')).toBeNull(); + expect(contentsOf('small fish, shrimp')).toBe('small fish, shrimp'); + for (const v of ['na', 'no food', 'traces of food (too small for sample)', 'no sample']) + expect(contentsOf(v)).toBeNull(); + }); + it('parses numbers and rejects NA spellings', () => { expect(num('1,2')).toBe(1.2); expect(num('45 mm')).toBe(45); diff --git a/src/lib/server/import/normalize.ts b/src/lib/server/import/normalize.ts index 7654d74..cd974fe 100644 --- a/src/lib/server/import/normalize.ts +++ b/src/lib/server/import/normalize.ts @@ -45,6 +45,27 @@ export function text(v: CellValue | undefined): string | null { return /^(#n\/a|na|n\/a|-|\?)$/i.test(s) ? null : s; } +export type StomachState = 'full' | 'traces' | 'empty'; + +/** Lavage / stomach fullness (#40): "full", "empty", "almost empty", "traces of food"… */ +export function stomachOf(v: CellValue | undefined): StomachState | null { + const s = text(v)?.toLowerCase(); + if (!s || /no sample/.test(s)) return null; + if (/almost empty|trace/.test(s)) return 'traces'; + if (/^(empty|no food)\b/.test(s)) return 'empty'; + if (/^full\b/.test(s)) return 'full'; + return null; +} + +/** Free-text stomach contents, without the cells that only restate fullness or "no sample". */ +export function contentsOf(v: CellValue | undefined): string | null { + const s = text(v); + if (!s) return null; + return /^(no sample|no food|none|empty|full|almost empty|traces? of food\b.*)$/i.test(s.trim()) + ? null + : s; +} + /** Numbers, including strings like "1,2", "~45", "45 mm", "0.9kg". */ export function num(v: CellValue | undefined): number | null { if (v == null || typeof v === 'boolean') return null; diff --git a/src/lib/stats.test.ts b/src/lib/stats.test.ts index 1752790..be222c5 100644 --- a/src/lib/stats.test.ts +++ b/src/lib/stats.test.ts @@ -2,6 +2,8 @@ import { describe, expect, it } from 'vitest'; import { binomTestHalf, boxStats, + chiSquare, + chiSquareP, histogram, linearFit, median, @@ -56,3 +58,22 @@ describe('stats', () => { expect(b.hi).toBe(4); }); }); + +describe('chi-square', () => { + it('matches textbook critical values', () => { + expect(chiSquareP(3.841, 1)).toBeCloseTo(0.05, 3); + expect(chiSquareP(5.991, 2)).toBeCloseTo(0.05, 3); + expect(chiSquareP(18.307, 10)).toBeCloseTo(0.05, 3); + expect(chiSquareP(0, 3)).toBe(1); + }); + it('tests independence in a table of counts', () => { + const r = chiSquare([ + [10, 20], + [20, 10] + ])!; + expect(r.df).toBe(1); + expect(r.stat).toBeCloseTo(6.667, 3); + expect(r.p).toBeCloseTo(0.00982, 4); + expect(chiSquare([[5, 5]])).toBeNull(); + }); +}); diff --git a/src/lib/stats.ts b/src/lib/stats.ts index 188a8eb..c15d993 100644 --- a/src/lib/stats.ts +++ b/src/lib/stats.ts @@ -119,6 +119,66 @@ export function incompleteBeta(x: number, a: number, b: number): number { : 1 - (bt * betacf(b, a, 1 - x)) / b; } +/** Upper regularised incomplete gamma Q(a, x) (Numerical Recipes series / continued fraction). */ +function gammaQ(a: number, x: number): number { + if (x <= 0) return 1; + const front = Math.exp(-x + a * Math.log(x) - logGamma(a)); + if (x < a + 1) { + let ap = a; + let del = 1 / a; + let sum = del; + for (let n = 0; n < 500; n++) { + ap++; + del *= x / ap; + sum += del; + if (Math.abs(del) < Math.abs(sum) * 1e-14) break; + } + return Math.max(0, 1 - sum * front); + } + const tiny = 1e-300; + let b = x + 1 - a; + let c = 1 / tiny; + let d = 1 / b; + let h = d; + for (let i = 1; i < 500; i++) { + const an = -i * (i - a); + b += 2; + d = an * d + b; + if (Math.abs(d) < tiny) d = tiny; + c = b + an / c; + if (Math.abs(c) < tiny) c = tiny; + d = 1 / d; + const del = d * c; + h *= del; + if (Math.abs(del - 1) < 1e-14) break; + } + return front * h; +} + +/** Upper-tail p-value of a chi-square statistic. */ +export const chiSquareP = (stat: number, df: number) => gammaQ(df / 2, stat / 2); + +/** Pearson chi-square test of independence for a table of counts (rows × columns). */ +export function chiSquare(table: number[][]): { stat: number; df: number; p: number } | null { + const rows = table.filter((r) => r.some((v) => v > 0)); + const cols = rows[0]?.map((_, j) => rows.reduce((a, r) => a + r[j], 0)) ?? []; + const keep = cols.map((c) => c > 0); + const t = rows.map((r) => r.filter((_, j) => keep[j])); + const colSums = cols.filter((c) => c > 0); + const n = colSums.reduce((a, b) => a + b, 0); + if (t.length < 2 || colSums.length < 2 || !n) return null; + let stat = 0; + for (const r of t) { + const rs = r.reduce((a, b) => a + b, 0); + r.forEach((v, j) => { + const e = (rs * colSums[j]) / n; + stat += (v - e) ** 2 / e; + }); + } + const df = (t.length - 1) * (colSums.length - 1); + return { stat, df, p: chiSquareP(stat, df) }; +} + /** Two-sided p-value for a t statistic with `df` degrees of freedom. */ export function tTestP(t: number, df: number): number { if (!Number.isFinite(t) || df <= 0) return NaN; diff --git a/src/routes/physiology/+page.server.ts b/src/routes/physiology/+page.server.ts index efe4234..cf0c84b 100644 --- a/src/routes/physiology/+page.server.ts +++ b/src/routes/physiology/+page.server.ts @@ -1,4 +1,5 @@ import { memo } from '#lib/server/data'; +import { diet } from '#lib/server/analytics/diet'; import { boxOf, fulton, round, seasonDay, siteName } from '#lib/server/analytics/common'; import { countBy, histogram, linearFit, mean, pairs } from '#lib/stats'; import type { PageServerLoad } from './$types'; @@ -80,6 +81,7 @@ export const load: PageServerLoad = () => .filter((s) => s.points.length > 5); return { + diet: diet(d), nBlood: blood.length, hct: metric('hct'), chol: metric('cholesterol'), diff --git a/src/routes/physiology/+page.svelte b/src/routes/physiology/+page.svelte index f3e93cd..550a5a1 100644 --- a/src/routes/physiology/+page.svelte +++ b/src/routes/physiology/+page.svelte @@ -6,8 +6,8 @@ import Histogram from '#lib/components/charts/Histogram.svelte'; import LineChart from '#lib/components/charts/LineChart.svelte'; import Scatter from '#lib/components/charts/Scatter.svelte'; - import { date, num, pValue, season } from '#lib/format'; - import { SERIES } from '#lib/species'; + import { date, num, pct, pValue, season } from '#lib/format'; + import { SERIES, speciesName } from '#lib/species'; import type { PageProps } from './$types'; let { data }: PageProps = $props(); @@ -15,6 +15,25 @@ const d = new Date(Date.UTC(2001, 7, 1) + day * 86_400_000); return `${d.getUTCDate()} ${['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'][d.getUTCMonth()]}`; }; + const dt = $derived(data.diet); + type Share = { + label: string; + n: number; + rate: number | null; + lo: number | null; + hi: number | null; + }; + const shareBars = (rows: Share[]) => ({ + categories: rows.map((r) => `${r.label} (${r.n})`), + series: [ + { name: 'Food in stomach', color: 'var(--series-3)', values: rows.map((r) => r.rate) } + ], + errors: rows.map((r) => + r.lo != null && r.hi != null ? ([r.lo, r.hi] as [number, number]) : null + ) + }); + const testNote = (t: { stat: number; df: number; p: number } | null) => + t ? `χ² = ${num(t.stat, 1)}, df = ${t.df}, ${pValue(t.p)}` : ''; const maxMass = $derived(Math.max(1.5, ...data.massPairs.flatMap((p) => [p.x, p.y]))); @@ -156,7 +175,100 @@

Diet

+ {#if dt} +

+ Gastric lavage gently flushes a pup's stomach so its last meals can be seen. The logs record + {num(dt.n)} lavaged pups ({dt.seasons.map((x) => season(x)).join(' and ')}); {pct( + dt.cmFed.rate + )} + of {num(dt.nCm)} blacktips had food in the stomach. A lavage only shows the last few hours of + feeding, so an empty stomach is common. +

+ {/if}
+ {#if dt} + + `${season(r.season)} ${speciesName(r.species).toLowerCase()} (${r.n})` + )} + series={[ + { name: 'Full', color: 'var(--seq-6)', values: dt.bySeason.map((r) => r.full / r.n) }, + { + name: 'Traces of food', + color: 'var(--seq-4)', + values: dt.bySeason.map((r) => r.traces / r.n) + }, + { + name: 'Empty', + color: 'var(--seq-2)', + values: dt.bySeason.map((r) => r.empty / r.n) + } + ]} + valueFormat={(v) => pct(v)} + /> + + = 0.05 ? 'No difference between phases, in line with the published analysis of these lavages.' : 'The phases differ more than chance would suggest.'}` + : ''} + > + pct(v)} labels /> + + = 0.05 ? 'The groups overlap: with these numbers the difference could be chance.' : 'The share differs between scar stages.'}` + : ''} + > + pct(v)} labels /> + + = 0.05 ? 'No clear change through the evening.' : 'The share changes through the evening.'}` + : ''} + > + pct(v)} labels /> + + {#if dt.condition.length === 2} + = 0.05 ? 'pups with food in the stomach are no plumper than those without' : 'the two groups differ'}.` + : ''} + > + num(v, 2)} /> + + {/if} + {#if dt.prey.length} + + p.label)} + series={[ + { name: 'Samples', color: 'var(--series-6)', values: dt.prey.map((p) => p.n) } + ]} + labels + /> + + {/if} + {/if} {#if data.preyTop.length} Date: Tue, 3 Nov 2026 14:14:29 +1000 Subject: [PATCH 2/2] Environment: cyclones (IBTrACS) and heavy-rain days vs catches (#24) 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 --- .github/workflows/refresh-external.yml | 2 +- AGENTS.md | 7 + README.md | 4 +- drizzle/0003_careless_blue_blade.sql | 11 + drizzle/meta/0003_snapshot.json | 3133 ++++++++++++++++++++ drizzle/meta/_journal.json | 7 + external/cyclones.csv | 83 + scripts/fetch-external.mjs | 64 +- src/lib/components/charts/LineChart.svelte | 23 +- src/lib/server/analytics/events.ts | 153 + src/lib/server/data.ts | 2 + src/lib/server/db/schema.ts | 13 + src/lib/server/import/external.ts | 3 +- src/lib/server/import/import.test.ts | 13 + src/lib/server/import/index.ts | 18 +- src/routes/+layout.svelte | 4 +- src/routes/about/+page.svelte | 4 + src/routes/weather/+page.server.ts | 4 + src/routes/weather/+page.svelte | 109 +- 19 files changed, 3646 insertions(+), 11 deletions(-) create mode 100644 drizzle/0003_careless_blue_blade.sql create mode 100644 drizzle/meta/0003_snapshot.json create mode 100644 external/cyclones.csv create mode 100644 src/lib/server/analytics/events.ts diff --git a/.github/workflows/refresh-external.yml b/.github/workflows/refresh-external.yml index a5c4d78..775daec 100644 --- a/.github/workflows/refresh-external.yml +++ b/.github/workflows/refresh-external.yml @@ -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. diff --git a/AGENTS.md b/AGENTS.md index 857b0c3..7a81870 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -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) 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 src/lib/stats.ts regression, Spearman, Welch, Wilson, binomial, histograms, box stats @@ -85,6 +86,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. + ### Adding a new season Drop the workbook in `data/` named like `Physioshark_Shark Log 2026-2027.xlsx` (the `YYYY-YYYY` in the file name sets the season). Check the Data quality page for unknown sites, unmatched headers ("Sheet not imported") and unit warnings, and extend aliases if needed. Never rename columns in the workbook to make the importer happy. diff --git a/README.md b/README.md index e4f6052..092f5c6 100644 --- a/README.md +++ b/README.md @@ -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 @@ -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. diff --git a/drizzle/0003_careless_blue_blade.sql b/drizzle/0003_careless_blue_blade.sql new file mode 100644 index 0000000..cb9bd01 --- /dev/null +++ b/drizzle/0003_careless_blue_blade.sql @@ -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 +); diff --git a/drizzle/meta/0003_snapshot.json b/drizzle/meta/0003_snapshot.json new file mode 100644 index 0000000..13b70db --- /dev/null +++ b/drizzle/meta/0003_snapshot.json @@ -0,0 +1,3133 @@ +{ + "version": "6", + "dialect": "sqlite", + "id": "306371d0-6bba-4eec-87f4-04d5f5c9d46f", + "prevId": "e07a85a5-9c17-4708-aec2-c253925ce71c", + "tables": { + "adult_captures": { + "name": "adult_captures", + "columns": { + "id": { + "name": "id", + "type": "integer", + "primaryKey": true, + "notNull": true, + "autoincrement": false + }, + "shark_id": { + "name": "shark_id", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "date": { + "name": "date", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "name": { + "name": "name", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "hooked_min": { + "name": "hooked_min", + "type": "real", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "boat_min": { + "name": "boat_min", + "type": "real", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "released_min": { + "name": "released_min", + "type": "real", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "fight_min": { + "name": "fight_min", + "type": "real", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "handling_min": { + "name": "handling_min", + "type": "real", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "lat": { + "name": "lat", + "type": "real", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "lon": { + "name": "lon", + "type": "real", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "site": { + "name": "site", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "sex": { + "name": "sex", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "maturity": { + "name": "maturity", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "repro_code": { + "name": "repro_code", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "pcl_mm": { + "name": "pcl_mm", + "type": "real", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "fl_mm": { + "name": "fl_mm", + "type": "real", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "tl_mm": { + "name": "tl_mm", + "type": "real", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "pec_girth_mm": { + "name": "pec_girth_mm", + "type": "real", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "dors_girth_mm": { + "name": "dors_girth_mm", + "type": "real", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "caud_girth_mm": { + "name": "caud_girth_mm", + "type": "real", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "clasper_inner": { + "name": "clasper_inner", + "type": "real", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "clasper_outer": { + "name": "clasper_outer", + "type": "real", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "sperm": { + "name": "sperm", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "ultrasound": { + "name": "ultrasound", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "pregnant": { + "name": "pregnant", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "blood1_min": { + "name": "blood1_min", + "type": "real", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "lact1": { + "name": "lact1", + "type": "real", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "gluc1": { + "name": "gluc1", + "type": "real", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "bhb1": { + "name": "bhb1", + "type": "real", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "blood2_min": { + "name": "blood2_min", + "type": "real", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "lact2": { + "name": "lact2", + "type": "real", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "gluc2": { + "name": "gluc2", + "type": "real", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "bhb2": { + "name": "bhb2", + "type": "real", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "tagged": { + "name": "tagged", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "bait": { + "name": "bait", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "comments": { + "name": "comments", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "source_file": { + "name": "source_file", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "source_sheet": { + "name": "source_sheet", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "source_row": { + "name": "source_row", + "type": "integer", + "primaryKey": false, + "notNull": false, + "autoincrement": false + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "checkConstraints": {} + }, + "adult_effort": { + "name": "adult_effort", + "columns": { + "id": { + "name": "id", + "type": "integer", + "primaryKey": true, + "notNull": true, + "autoincrement": false + }, + "date": { + "name": "date", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "session": { + "name": "session", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "bait_in_min": { + "name": "bait_in_min", + "type": "real", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "bait_out_min": { + "name": "bait_out_min", + "type": "real", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "soak_min": { + "name": "soak_min", + "type": "real", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "shark_times": { + "name": "shark_times", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "n_sharks": { + "name": "n_sharks", + "type": "integer", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "comments": { + "name": "comments", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "checkConstraints": {} + }, + "adult_samples": { + "name": "adult_samples", + "columns": { + "id": { + "name": "id", + "type": "integer", + "primaryKey": true, + "notNull": true, + "autoincrement": false + }, + "sample": { + "name": "sample", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "size_cm": { + "name": "size_cm", + "type": "real", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "sex": { + "name": "sex", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "island": { + "name": "island", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "location": { + "name": "location", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "year": { + "name": "year", + "type": "integer", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "notes": { + "name": "notes", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "checkConstraints": {} + }, + "blood": { + "name": "blood", + "columns": { + "id": { + "name": "id", + "type": "integer", + "primaryKey": true, + "notNull": true, + "autoincrement": false + }, + "season": { + "name": "season", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "site_id": { + "name": "site_id", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "date": { + "name": "date", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "species": { + "name": "species", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "experiment": { + "name": "experiment", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "shark_no": { + "name": "shark_no", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "hct": { + "name": "hct", + "type": "real", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "hb": { + "name": "hb", + "type": "real", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "cholesterol": { + "name": "cholesterol", + "type": "real", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "ffa": { + "name": "ffa", + "type": "real", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "triglycerides": { + "name": "triglycerides", + "type": "real", + "primaryKey": false, + "notNull": false, + "autoincrement": false + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "checkConstraints": {} + }, + "captures": { + "name": "captures", + "columns": { + "id": { + "name": "id", + "type": "integer", + "primaryKey": true, + "notNull": true, + "autoincrement": false + }, + "season": { + "name": "season", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "species": { + "name": "species", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "site_id": { + "name": "site_id", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "site_raw": { + "name": "site_raw", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "set_id": { + "name": "set_id", + "type": "integer", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "set_no": { + "name": "set_no", + "type": "integer", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "date": { + "name": "date", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "shark_no": { + "name": "shark_no", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "capture_no": { + "name": "capture_no", + "type": "integer", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "kind": { + "name": "kind", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "tag": { + "name": "tag", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "tags": { + "name": "tags", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "individual_id": { + "name": "individual_id", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "sex": { + "name": "sex", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "age_class": { + "name": "age_class", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "umbilical": { + "name": "umbilical", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "uss": { + "name": "uss", + "type": "integer", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "pcl_mm": { + "name": "pcl_mm", + "type": "real", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "fl_mm": { + "name": "fl_mm", + "type": "real", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "tl_mm": { + "name": "tl_mm", + "type": "real", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "pec_girth_mm": { + "name": "pec_girth_mm", + "type": "real", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "dors_girth_mm": { + "name": "dors_girth_mm", + "type": "real", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "caud_girth_mm": { + "name": "caud_girth_mm", + "type": "real", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "mass_kg": { + "name": "mass_kg", + "type": "real", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "clasper_l": { + "name": "clasper_l", + "type": "real", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "clasper_r": { + "name": "clasper_r", + "type": "real", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "capture_min": { + "name": "capture_min", + "type": "real", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "landing_min": { + "name": "landing_min", + "type": "real", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "release_min": { + "name": "release_min", + "type": "real", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "workup_min": { + "name": "workup_min", + "type": "real", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "to_lab": { + "name": "to_lab", + "type": "integer", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "died": { + "name": "died", + "type": "integer", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "blood": { + "name": "blood", + "type": "integer", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "dna": { + "name": "dna", + "type": "integer", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "us_area": { + "name": "us_area", + "type": "real", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "us_perimeter": { + "name": "us_perimeter", + "type": "real", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "habitat": { + "name": "habitat", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "tide_raw": { + "name": "tide_raw", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "notes": { + "name": "notes", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "lavage": { + "name": "lavage", + "type": "integer", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "stomach": { + "name": "stomach", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "stomach_contents": { + "name": "stomach_contents", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "min_after_sunset": { + "name": "min_after_sunset", + "type": "real", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "min_after_net_in": { + "name": "min_after_net_in", + "type": "real", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "tide_mm": { + "name": "tide_mm", + "type": "real", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "tide_trend": { + "name": "tide_trend", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "moon_illum": { + "name": "moon_illum", + "type": "real", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "moon_phase": { + "name": "moon_phase", + "type": "real", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "sst": { + "name": "sst", + "type": "real", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "dhw": { + "name": "dhw", + "type": "real", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "source_file": { + "name": "source_file", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "source_sheet": { + "name": "source_sheet", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "source_row": { + "name": "source_row", + "type": "integer", + "primaryKey": false, + "notNull": false, + "autoincrement": false + } + }, + "indexes": { + "captures_season": { + "name": "captures_season", + "columns": [ + "season" + ], + "isUnique": false + }, + "captures_site": { + "name": "captures_site", + "columns": [ + "site_id" + ], + "isUnique": false + }, + "captures_individual": { + "name": "captures_individual", + "columns": [ + "individual_id" + ], + "isUnique": false + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "checkConstraints": {} + }, + "climate_monthly": { + "name": "climate_monthly", + "columns": { + "ym": { + "name": "ym", + "type": "text", + "primaryKey": true, + "notNull": true, + "autoincrement": false + }, + "oni": { + "name": "oni", + "type": "real", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "soi": { + "name": "soi", + "type": "real", + "primaryKey": false, + "notNull": false, + "autoincrement": false + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "checkConstraints": {} + }, + "cyclone_points": { + "name": "cyclone_points", + "columns": { + "id": { + "name": "id", + "type": "integer", + "primaryKey": true, + "notNull": true, + "autoincrement": false + }, + "sid": { + "name": "sid", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "name": { + "name": "name", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "ts": { + "name": "ts", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "lat": { + "name": "lat", + "type": "real", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "lon": { + "name": "lon", + "type": "real", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "wind_kt": { + "name": "wind_kt", + "type": "real", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "pres_hpa": { + "name": "pres_hpa", + "type": "real", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "dist_km": { + "name": "dist_km", + "type": "real", + "primaryKey": false, + "notNull": true, + "autoincrement": false + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "checkConstraints": {} + }, + "data_issues": { + "name": "data_issues", + "columns": { + "id": { + "name": "id", + "type": "integer", + "primaryKey": true, + "notNull": true, + "autoincrement": false + }, + "severity": { + "name": "severity", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "category": { + "name": "category", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "message": { + "name": "message", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "file": { + "name": "file", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "sheet": { + "name": "sheet", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "row": { + "name": "row", + "type": "integer", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "column": { + "name": "column", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "value": { + "name": "value", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "checkConstraints": {} + }, + "field_notes": { + "name": "field_notes", + "columns": { + "id": { + "name": "id", + "type": "integer", + "primaryKey": true, + "notNull": true, + "autoincrement": false + }, + "season": { + "name": "season", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "date": { + "name": "date", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "site_id": { + "name": "site_id", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "kind": { + "name": "kind", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "ref_id": { + "name": "ref_id", + "type": "integer", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "species": { + "name": "species", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "text": { + "name": "text", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "checkConstraints": {} + }, + "field_wq": { + "name": "field_wq", + "columns": { + "id": { + "name": "id", + "type": "integer", + "primaryKey": true, + "notNull": true, + "autoincrement": false + }, + "season": { + "name": "season", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "date": { + "name": "date", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "site_id": { + "name": "site_id", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "time_min": { + "name": "time_min", + "type": "real", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "depth_cm": { + "name": "depth_cm", + "type": "real", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "salinity": { + "name": "salinity", + "type": "real", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "do_mg": { + "name": "do_mg", + "type": "real", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "do_pct": { + "name": "do_pct", + "type": "real", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "temp": { + "name": "temp", + "type": "real", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "ph": { + "name": "ph", + "type": "real", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "source": { + "name": "source", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "checkConstraints": {} + }, + "hobo": { + "name": "hobo", + "columns": { + "id": { + "name": "id", + "type": "integer", + "primaryKey": true, + "notNull": true, + "autoincrement": false + }, + "season": { + "name": "season", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "site_id": { + "name": "site_id", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "site_raw": { + "name": "site_raw", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "logger": { + "name": "logger", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "deployed": { + "name": "deployed", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "retrieved": { + "name": "retrieved", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "status": { + "name": "status", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "notes": { + "name": "notes", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "checkConstraints": {} + }, + "individuals": { + "name": "individuals", + "columns": { + "id": { + "name": "id", + "type": "text", + "primaryKey": true, + "notNull": true, + "autoincrement": false + }, + "species": { + "name": "species", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "sex": { + "name": "sex", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "first_date": { + "name": "first_date", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "last_date": { + "name": "last_date", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "n_captures": { + "name": "n_captures", + "type": "integer", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "n_seasons": { + "name": "n_seasons", + "type": "integer", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "sites": { + "name": "sites", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "first_tl_mm": { + "name": "first_tl_mm", + "type": "real", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "last_tl_mm": { + "name": "last_tl_mm", + "type": "real", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "tags": { + "name": "tags", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "conflict": { + "name": "conflict", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "checkConstraints": {} + }, + "lab_feeding": { + "name": "lab_feeding", + "columns": { + "id": { + "name": "id", + "type": "integer", + "primaryKey": true, + "notNull": true, + "autoincrement": false + }, + "season": { + "name": "season", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "date": { + "name": "date", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "tank": { + "name": "tank", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "shark": { + "name": "shark", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "tag": { + "name": "tag", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "food_g": { + "name": "food_g", + "type": "real", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "rejected_g": { + "name": "rejected_g", + "type": "real", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "pct": { + "name": "pct", + "type": "real", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "notes": { + "name": "notes", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "checkConstraints": {} + }, + "lab_sharks": { + "name": "lab_sharks", + "columns": { + "id": { + "name": "id", + "type": "integer", + "primaryKey": true, + "notNull": true, + "autoincrement": false + }, + "season": { + "name": "season", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "shark_no": { + "name": "shark_no", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "tag": { + "name": "tag", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "individual_id": { + "name": "individual_id", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "species": { + "name": "species", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "sex": { + "name": "sex", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "site_id": { + "name": "site_id", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "arrival_date": { + "name": "arrival_date", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "release_date": { + "name": "release_date", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "days": { + "name": "days", + "type": "real", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "arr_tl_mm": { + "name": "arr_tl_mm", + "type": "real", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "arr_fl_mm": { + "name": "arr_fl_mm", + "type": "real", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "arr_mass_kg": { + "name": "arr_mass_kg", + "type": "real", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "rel_tl_mm": { + "name": "rel_tl_mm", + "type": "real", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "rel_fl_mm": { + "name": "rel_fl_mm", + "type": "real", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "rel_mass_kg": { + "name": "rel_mass_kg", + "type": "real", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "tank": { + "name": "tank", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "project": { + "name": "project", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "died": { + "name": "died", + "type": "integer", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "notes": { + "name": "notes", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "source_file": { + "name": "source_file", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "source_sheet": { + "name": "source_sheet", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "source_row": { + "name": "source_row", + "type": "integer", + "primaryKey": false, + "notNull": false, + "autoincrement": false + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "checkConstraints": {} + }, + "lab_wq": { + "name": "lab_wq", + "columns": { + "id": { + "name": "id", + "type": "integer", + "primaryKey": true, + "notNull": true, + "autoincrement": false + }, + "season": { + "name": "season", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "date": { + "name": "date", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "time_min": { + "name": "time_min", + "type": "real", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "tank": { + "name": "tank", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "temp": { + "name": "temp", + "type": "real", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "ph": { + "name": "ph", + "type": "real", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "do_mg": { + "name": "do_mg", + "type": "real", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "do_pct": { + "name": "do_pct", + "type": "real", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "salinity": { + "name": "salinity", + "type": "real", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "recorder": { + "name": "recorder", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "notes": { + "name": "notes", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "checkConstraints": {} + }, + "logger_daily": { + "name": "logger_daily", + "columns": { + "id": { + "name": "id", + "type": "integer", + "primaryKey": true, + "notNull": true, + "autoincrement": false + }, + "site_id": { + "name": "site_id", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "date": { + "name": "date", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "mean": { + "name": "mean", + "type": "real", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "min": { + "name": "min", + "type": "real", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "max": { + "name": "max", + "type": "real", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "hours": { + "name": "hours", + "type": "integer", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "loggers": { + "name": "loggers", + "type": "integer", + "primaryKey": false, + "notNull": true, + "autoincrement": false + } + }, + "indexes": { + "logger_daily_site": { + "name": "logger_daily_site", + "columns": [ + "site_id" + ], + "isUnique": false + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "checkConstraints": {} + }, + "logger_diel": { + "name": "logger_diel", + "columns": { + "id": { + "name": "id", + "type": "integer", + "primaryKey": true, + "notNull": true, + "autoincrement": false + }, + "site_id": { + "name": "site_id", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "month": { + "name": "month", + "type": "integer", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "hour": { + "name": "hour", + "type": "integer", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "temp": { + "name": "temp", + "type": "real", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "n": { + "name": "n", + "type": "integer", + "primaryKey": false, + "notNull": true, + "autoincrement": false + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "checkConstraints": {} + }, + "logger_files": { + "name": "logger_files", + "columns": { + "id": { + "name": "id", + "type": "integer", + "primaryKey": true, + "notNull": true, + "autoincrement": false + }, + "file": { + "name": "file", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "system": { + "name": "system", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "logger": { + "name": "logger", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "serial": { + "name": "serial", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "site_id": { + "name": "site_id", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "site_basis": { + "name": "site_basis", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "start": { + "name": "start", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "end": { + "name": "end", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "samples": { + "name": "samples", + "type": "integer", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "kept": { + "name": "kept", + "type": "integer", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "lat": { + "name": "lat", + "type": "real", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "lon": { + "name": "lon", + "type": "real", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "excluded": { + "name": "excluded", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "checkConstraints": {} + }, + "meta": { + "name": "meta", + "columns": { + "key": { + "name": "key", + "type": "text", + "primaryKey": true, + "notNull": true, + "autoincrement": false + }, + "value": { + "name": "value", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "checkConstraints": {} + }, + "mouth": { + "name": "mouth", + "columns": { + "id": { + "name": "id", + "type": "integer", + "primaryKey": true, + "notNull": true, + "autoincrement": false + }, + "season": { + "name": "season", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "shark_no": { + "name": "shark_no", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "site_id": { + "name": "site_id", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "tag": { + "name": "tag", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "species": { + "name": "species", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "sex": { + "name": "sex", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "mol": { + "name": "mol", + "type": "real", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "mow": { + "name": "mow", + "type": "real", + "primaryKey": false, + "notNull": false, + "autoincrement": false + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "checkConstraints": {} + }, + "ocean_daily": { + "name": "ocean_daily", + "columns": { + "date": { + "name": "date", + "type": "text", + "primaryKey": true, + "notNull": true, + "autoincrement": false + }, + "oisst": { + "name": "oisst", + "type": "real", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "crw_sst": { + "name": "crw_sst", + "type": "real", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "crw_anom": { + "name": "crw_anom", + "type": "real", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "crw_hotspot": { + "name": "crw_hotspot", + "type": "real", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "crw_dhw": { + "name": "crw_dhw", + "type": "real", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "crw_baa": { + "name": "crw_baa", + "type": "real", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "wave_max": { + "name": "wave_max", + "type": "real", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "wave_period": { + "name": "wave_period", + "type": "real", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "wave_dir": { + "name": "wave_dir", + "type": "real", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "swell_max": { + "name": "swell_max", + "type": "real", + "primaryKey": false, + "notNull": false, + "autoincrement": false + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "checkConstraints": {} + }, + "prey": { + "name": "prey", + "columns": { + "id": { + "name": "id", + "type": "integer", + "primaryKey": true, + "notNull": true, + "autoincrement": false + }, + "season": { + "name": "season", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "date": { + "name": "date", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "location": { + "name": "location", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "name": { + "name": "name", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "size": { + "name": "size", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "notes": { + "name": "notes", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "checkConstraints": {} + }, + "set_crew": { + "name": "set_crew", + "columns": { + "id": { + "name": "id", + "type": "integer", + "primaryKey": true, + "notNull": true, + "autoincrement": false + }, + "set_id": { + "name": "set_id", + "type": "integer", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "person": { + "name": "person", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + } + }, + "indexes": { + "set_crew_set": { + "name": "set_crew_set", + "columns": [ + "set_id" + ], + "isUnique": false + }, + "set_crew_person": { + "name": "set_crew_person", + "columns": [ + "person" + ], + "isUnique": false + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "checkConstraints": {} + }, + "sets": { + "name": "sets", + "columns": { + "id": { + "name": "id", + "type": "integer", + "primaryKey": true, + "notNull": true, + "autoincrement": false + }, + "season": { + "name": "season", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "set_no": { + "name": "set_no", + "type": "integer", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "site_id": { + "name": "site_id", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "site_raw": { + "name": "site_raw", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "date": { + "name": "date", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "weekday": { + "name": "weekday", + "type": "integer", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "gear": { + "name": "gear", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "visit": { + "name": "visit", + "type": "integer", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "crew_raw": { + "name": "crew_raw", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "crew_size": { + "name": "crew_size", + "type": "integer", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "start_min": { + "name": "start_min", + "type": "real", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "end_min": { + "name": "end_min", + "type": "real", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "duration_min": { + "name": "duration_min", + "type": "real", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "n_cm": { + "name": "n_cm", + "type": "integer", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "n_na": { + "name": "n_na", + "type": "integer", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "n_nf": { + "name": "n_nf", + "type": "integer", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "n_total": { + "name": "n_total", + "type": "integer", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "n_linked": { + "name": "n_linked", + "type": "integer", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "cpue": { + "name": "cpue", + "type": "real", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "cpue_cm": { + "name": "cpue_cm", + "type": "real", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "cpue_na": { + "name": "cpue_na", + "type": "real", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "cpue_sheet": { + "name": "cpue_sheet", + "type": "real", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "tide_raw": { + "name": "tide_raw", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "moon_raw": { + "name": "moon_raw", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "weather_raw": { + "name": "weather_raw", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "cloud_cover": { + "name": "cloud_cover", + "type": "real", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "water_temp": { + "name": "water_temp", + "type": "real", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "ph": { + "name": "ph", + "type": "real", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "do_mg": { + "name": "do_mg", + "type": "real", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "do_pct": { + "name": "do_pct", + "type": "real", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "salinity": { + "name": "salinity", + "type": "real", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "depth_cm": { + "name": "depth_cm", + "type": "real", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "notes": { + "name": "notes", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "sunset_min": { + "name": "sunset_min", + "type": "real", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "civil_dusk_min": { + "name": "civil_dusk_min", + "type": "real", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "moon_phase": { + "name": "moon_phase", + "type": "real", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "moon_illum": { + "name": "moon_illum", + "type": "real", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "moon_alt_mid": { + "name": "moon_alt_mid", + "type": "real", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "tide_start_mm": { + "name": "tide_start_mm", + "type": "real", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "tide_mid_mm": { + "name": "tide_mid_mm", + "type": "real", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "tide_trend": { + "name": "tide_trend", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "tide_range_mm": { + "name": "tide_range_mm", + "type": "real", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "air_temp": { + "name": "air_temp", + "type": "real", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "wind_speed": { + "name": "wind_speed", + "type": "real", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "wind_dir": { + "name": "wind_dir", + "type": "real", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "gusts": { + "name": "gusts", + "type": "real", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "rain_24h": { + "name": "rain_24h", + "type": "real", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "rain_evening": { + "name": "rain_evening", + "type": "real", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "cloud_evening": { + "name": "cloud_evening", + "type": "real", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "pressure": { + "name": "pressure", + "type": "real", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "sst": { + "name": "sst", + "type": "real", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "sst_anom": { + "name": "sst_anom", + "type": "real", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "dhw": { + "name": "dhw", + "type": "real", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "wave_height": { + "name": "wave_height", + "type": "real", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "swell_height": { + "name": "swell_height", + "type": "real", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "oni": { + "name": "oni", + "type": "real", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "insitu_temp": { + "name": "insitu_temp", + "type": "real", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "source_file": { + "name": "source_file", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "source_sheet": { + "name": "source_sheet", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "source_row": { + "name": "source_row", + "type": "integer", + "primaryKey": false, + "notNull": false, + "autoincrement": false + } + }, + "indexes": { + "sets_season": { + "name": "sets_season", + "columns": [ + "season" + ], + "isUnique": false + }, + "sets_site": { + "name": "sets_site", + "columns": [ + "site_id" + ], + "isUnique": false + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "checkConstraints": {} + }, + "sites": { + "name": "sites", + "columns": { + "id": { + "name": "id", + "type": "text", + "primaryKey": true, + "notNull": true, + "autoincrement": false + }, + "name": { + "name": "name", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "code": { + "name": "code", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "island": { + "name": "island", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "kind": { + "name": "kind", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "lat": { + "name": "lat", + "type": "real", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "lon": { + "name": "lon", + "type": "real", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "coord_source": { + "name": "coord_source", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "retired": { + "name": "retired", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "fishing_effort": { + "name": "fishing_effort", + "type": "real", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "human_impact": { + "name": "human_impact", + "type": "real", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "artificialisation": { + "name": "artificialisation", + "type": "real", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "pressure_composite": { + "name": "pressure_composite", + "type": "real", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "pressure_tier": { + "name": "pressure_tier", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "directions": { + "name": "directions", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "habitat": { + "name": "habitat", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "aliases": { + "name": "aliases", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "checkConstraints": {} + }, + "tide_extrema": { + "name": "tide_extrema", + "columns": { + "ts": { + "name": "ts", + "type": "text", + "primaryKey": true, + "notNull": true, + "autoincrement": false + }, + "kind": { + "name": "kind", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "mm": { + "name": "mm", + "type": "real", + "primaryKey": false, + "notNull": true, + "autoincrement": false + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "checkConstraints": {} + }, + "tide_hourly": { + "name": "tide_hourly", + "columns": { + "ts": { + "name": "ts", + "type": "text", + "primaryKey": true, + "notNull": true, + "autoincrement": false + }, + "mm": { + "name": "mm", + "type": "real", + "primaryKey": false, + "notNull": true, + "autoincrement": false + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "checkConstraints": {} + }, + "weather_daily": { + "name": "weather_daily", + "columns": { + "date": { + "name": "date", + "type": "text", + "primaryKey": true, + "notNull": true, + "autoincrement": false + }, + "tmax": { + "name": "tmax", + "type": "real", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "tmin": { + "name": "tmin", + "type": "real", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "tmean": { + "name": "tmean", + "type": "real", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "precip": { + "name": "precip", + "type": "real", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "wind_max": { + "name": "wind_max", + "type": "real", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "gust_max": { + "name": "gust_max", + "type": "real", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "wind_dir": { + "name": "wind_dir", + "type": "real", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "radiation": { + "name": "radiation", + "type": "real", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "cloud": { + "name": "cloud", + "type": "real", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "pressure": { + "name": "pressure", + "type": "real", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "humidity": { + "name": "humidity", + "type": "real", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "sunshine_h": { + "name": "sunshine_h", + "type": "real", + "primaryKey": false, + "notNull": false, + "autoincrement": false + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "checkConstraints": {} + }, + "weather_hourly": { + "name": "weather_hourly", + "columns": { + "ts": { + "name": "ts", + "type": "text", + "primaryKey": true, + "notNull": true, + "autoincrement": false + }, + "temp": { + "name": "temp", + "type": "real", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "precip": { + "name": "precip", + "type": "real", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "cloud": { + "name": "cloud", + "type": "real", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "wind": { + "name": "wind", + "type": "real", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "wind_dir": { + "name": "wind_dir", + "type": "real", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "gust": { + "name": "gust", + "type": "real", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "pressure": { + "name": "pressure", + "type": "real", + "primaryKey": false, + "notNull": false, + "autoincrement": false + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "checkConstraints": {} + } + }, + "views": {}, + "enums": {}, + "_meta": { + "schemas": {}, + "tables": {}, + "columns": {} + }, + "internal": { + "indexes": {} + } +} \ No newline at end of file diff --git a/drizzle/meta/_journal.json b/drizzle/meta/_journal.json index cbd1e96..65fa05f 100644 --- a/drizzle/meta/_journal.json +++ b/drizzle/meta/_journal.json @@ -22,6 +22,13 @@ "when": 1793678374777, "tag": "0002_cloudy_red_wolf", "breakpoints": true + }, + { + "idx": 3, + "version": "6", + "when": 1793678941733, + "tag": "0003_careless_blue_blade", + "breakpoints": true } ] } \ No newline at end of file diff --git a/external/cyclones.csv b/external/cyclones.csv new file mode 100644 index 0000000..be7f3a4 --- /dev/null +++ b/external/cyclones.csv @@ -0,0 +1,83 @@ +sid,name,time,lat,lon,wind_kt,pres_hpa,dist_km +2015020S12208,NIKO,2015-01-20T00:00:00Z,-12.2,-151.6,30,,622 +2015020S12208,NIKO,2015-01-20T03:00:00Z,-12.4,-151.4,35,,595 +2015020S12208,NIKO,2015-01-20T06:00:00Z,-12.6,-151.2,40,,568 +2015020S12208,NIKO,2015-01-20T09:00:00Z,-12.9,-151.1,40,,533 +2015020S12208,NIKO,2015-01-20T12:00:00Z,-13.2,-151,40,,498 +2015020S12208,NIKO,2015-01-20T15:00:00Z,-13.4,-150.8,40,,471 +2015020S12208,NIKO,2015-01-20T18:00:00Z,-13.7,-150.6,30,998,434 +2015020S12208,NIKO,2015-01-20T21:00:00Z,-14,-150.4,35,995,397 +2015020S12208,NIKO,2015-01-21T00:00:00Z,-14.4,-150.1,35,998,349 +2015020S12208,NIKO,2015-01-21T03:00:00Z,-14.7,-150,45,,315 +2015020S12208,NIKO,2015-01-21T06:00:00Z,-15,-149.8,40,993,281 +2015020S12208,NIKO,2015-01-21T09:00:00Z,-15.3,-149.5,45,,250 +2015020S12208,NIKO,2015-01-21T12:00:00Z,-15.6,-149.3,40,993,222 +2015020S12208,NIKO,2015-01-21T15:00:00Z,-15.9,-149,45,,202 +2015020S12208,NIKO,2015-01-21T18:00:00Z,-16.3,-148.8,40,995,175 +2015020S12208,NIKO,2015-01-21T21:00:00Z,-16.7,-148.6,48,,160 +2015020S12208,NIKO,2015-01-22T00:00:00Z,-17.2,-148.4,45,991,156 +2015020S12208,NIKO,2015-01-22T03:00:00Z,-17.7,-147.9,50,,205 +2015020S12208,NIKO,2015-01-22T06:00:00Z,-18.2,-147.4,45,992,268 +2015020S12208,NIKO,2015-01-22T09:00:00Z,-18.7,-147,50,,326 +2015020S12208,NIKO,2015-01-22T12:00:00Z,-19.3,-146.6,45,992,394 +2015020S12208,NIKO,2015-01-22T15:00:00Z,-20,-146.3,53,,462 +2015020S12208,NIKO,2015-01-22T18:00:00Z,-20.6,-146.2,50,987,512 +2015020S12208,NIKO,2015-01-22T21:00:00Z,-21.1,-145.9,55,,572 +2015020S12208,NIKO,2015-01-23T00:00:00Z,-21.7,-145.8,55,982,627 +2015020S12208,NIKO,2015-01-23T03:00:00Z,-22.2,-145.8,53,,669 +2015020S12208,NIKO,2015-01-23T06:00:00Z,-22.8,-145.8,45,992,721 +2016055S15202,YALO,2016-02-24T06:00:00Z,-16.7,-156.4,30,,704 +2016055S15202,YALO,2016-02-24T09:00:00Z,-17.1,-156.1,30,,667 +2016055S15202,YALO,2016-02-24T12:00:00Z,-17.4,-156.1,25,1000,665 +2016055S15202,YALO,2016-02-24T15:00:00Z,-17.6,-155.9,25,,644 +2016055S15202,YALO,2016-02-24T18:00:00Z,-18,-155.8,25,1000,634 +2016055S15202,YALO,2016-02-24T21:00:00Z,-18.3,-155.7,33,,627 +2016055S15202,YALO,2016-02-25T00:00:00Z,-18.7,-155.7,30,998,634 +2016055S15202,YALO,2016-02-25T03:00:00Z,-19,-155.5,40,,621 +2016055S15202,YALO,2016-02-25T06:00:00Z,-19.5,-155.3,35,995,617 +2016055S15202,YALO,2016-02-25T09:00:00Z,-19.8,-155.1,48,,610 +2016055S15202,YALO,2016-02-25T12:00:00Z,-20.1,-154.8,40,993,596 +2016055S15202,YALO,2016-02-25T15:00:00Z,-20.4,-154.5,53,,586 +2016055S15202,YALO,2016-02-25T18:00:00Z,-20.9,-154,40,993,576 +2016055S15202,YALO,2016-02-25T20:00:00Z,-21.3,-153.5,40,993,569 +2016055S15202,YALO,2016-02-25T21:00:00Z,-21.5,-153.3,53,,572 +2016055S15202,YALO,2016-02-26T00:00:00Z,-21.8,-152.9,40,995,573 +2016055S15202,YALO,2016-02-26T03:00:00Z,-22.1,-152.4,35,994,575 +2016055S15202,YALO,2016-02-26T06:00:00Z,-22.5,-151.9,35,995,593 +2016055S15202,YALO,2016-02-26T09:00:00Z,-23.1,-151.2,35,996,636 +2016055S15202,YALO,2016-02-26T12:00:00Z,-23.6,-150.6,30,998,680 +2016055S15202,YALO,2016-02-26T15:00:00Z,-24.2,-149.9,33,,742 +2024035S16188,NAT,2024-02-06T12:00:00Z,-17,-156.8,50,985,742 +2024035S16188,NAT,2024-02-06T15:00:00Z,-17.4,-156.1,50,,665 +2024035S16188,NAT,2024-02-06T18:00:00Z,-17.7,-155.4,50,985,591 +2024035S16188,NAT,2024-02-06T21:00:00Z,-18,-154.7,43,,518 +2024035S16188,NAT,2024-02-07T00:00:00Z,-18.3,-154.1,40,990,460 +2024035S16188,NAT,2024-02-07T03:00:00Z,-18.6,-153.4,40,,396 +2024035S16188,NAT,2024-02-07T06:00:00Z,-18.8,-152.8,35,995,344 +2024035S16188,NAT,2024-02-07T09:00:00Z,-19,-152.3,40,,308 +2024035S16188,NAT,2024-02-07T12:00:00Z,-19.1,-151.9,35,995,280 +2024035S16188,NAT,2024-02-07T15:00:00Z,-19.2,-151.7,43,,271 +2024035S16188,NAT,2024-02-07T18:00:00Z,-19.3,-151.6,35,995,271 +2024035S16188,NAT,2024-02-07T21:00:00Z,-19.3,-151.3,43,,251 +2024035S16188,NAT,2024-02-08T00:00:00Z,-19.3,-151,30,998,232 +2024035S16188,NAT,2024-02-08T03:00:00Z,-19.3,-150.6,38,,213 +2024035S16188,NAT,2024-02-08T06:00:00Z,-19.3,-150,35,,198 +2024035S16188,NAT,2024-02-08T09:00:00Z,-19.3,-149.3,35,,205 +2024035S16188,NAT,2024-02-08T12:00:00Z,-19.3,-148.6,35,,236 +2024035S16188,NAT,2024-02-08T15:00:00Z,-19.3,-147.8,40,,291 +2024035S16188,NAT,2024-02-08T18:00:00Z,-19.4,-147,45,,364 +2024035S16188,NAT,2024-02-08T21:00:00Z,-19.5,-146.1,48,,450 +2024035S16188,NAT,2024-02-09T00:00:00Z,-19.6,-145.2,50,,540 +2024035S16188,NAT,2024-02-09T03:00:00Z,-19.7,-144.3,48,,631 +2024035S16188,NAT,2024-02-09T06:00:00Z,-19.9,-143.3,45,,736 +2025339S14210,UNNAMED,2025-12-05T00:00:00Z,-13.9,-149.7,35,,404 +2025339S14210,UNNAMED,2025-12-05T03:00:00Z,-14.5,-149.2,37,,344 +2025339S14210,UNNAMED,2025-12-05T06:00:00Z,-15,-148.8,39,,302 +2025339S14210,UNNAMED,2025-12-05T09:00:00Z,-15.5,-148.4,39,,272 +2025339S14210,UNNAMED,2025-12-05T12:00:00Z,-16,-148,39,,259 +2025339S14210,UNNAMED,2025-12-05T15:00:00Z,-16.7,-147.5,39,,264 +2025339S14210,UNNAMED,2025-12-05T18:00:00Z,-17.4,-147.1,39,,290 +2025339S14210,UNNAMED,2025-12-05T21:00:00Z,-18,-147,37,,304 +2025339S14210,UNNAMED,2025-12-06T00:00:00Z,-18.7,-147,35,,326 +2025339S14210,UNNAMED,2025-12-06T03:00:00Z,-19.4,-146.8,35,,381 +2025339S14210,UNNAMED,2025-12-06T06:00:00Z,-20.2,-146.5,35,,459 diff --git a/scripts/fetch-external.mjs b/scripts/fetch-external.mjs index 7957c1e..cc32627 100644 --- a/scripts/fetch-external.mjs +++ b/scripts/fetch-external.mjs @@ -12,6 +12,7 @@ * - NOAA Coral Reef Watch 5 km daily heat stress via PacIOOS ERDDAP * - UHSLC fast-delivery hourly sea level, Papeete (station 015) * - NOAA CPC Oceanic Niño Index and Southern Oscillation Index + * - NOAA IBTrACS v04r01 South Pacific best tracks (cyclone positions near Moorea, #24) * * Output files are small CSVs (hourly series gzipped) committed to the repo, so the app and CI * never need network access. No spreadsheet data is read or sent anywhere. @@ -333,7 +334,68 @@ async function climate() { ); } -const jobs = { weather, ocean, tide, climate }; +/** Great-circle distance in km. */ +function km(lat1, lon1, lat2, lon2) { + const r = Math.PI / 180; + const a = + Math.sin(((lat2 - lat1) * r) / 2) ** 2 + + Math.cos(lat1 * r) * Math.cos(lat2 * r) * Math.sin(((lon2 - lon1) * r) / 2) ** 2; + return 6371 * 2 * Math.asin(Math.sqrt(a)); +} + +/** Tropical cyclone track points within 750 km of Moorea since START (IBTrACS, 3-hourly, UTC). */ +async function cyclones() { + console.log('[external] cyclones (IBTrACS South Pacific)'); + const text = await get( + 'https://www.ncei.noaa.gov/data/international-best-track-archive-for-climate-stewardship-ibtracs/v04r01/access/csv/ibtracs.SP.list.v04r01.csv' + ); + const lines = text.split(/\r?\n/); + const head = lines[0].split(','); + const col = (name) => head.indexOf(name); + const [iSid, iName, iTime, iLat, iLon, iWmo, iUsa, iPres] = [ + 'SID', + 'NAME', + 'ISO_TIME', + 'LAT', + 'LON', + 'WMO_WIND', + 'USA_WIND', + 'WMO_PRES' + ].map(col); + const num = (s) => (s == null || s.trim() === '' ? null : Number(s)); + const rows = []; + // Line 1 is units; data start on line 2. + for (const line of lines.slice(2)) { + if (!line) continue; + const c = line.split(','); + const time = c[iTime]; + if (!time || time.slice(0, 10) < START) continue; + const lat = num(c[iLat]); + const lon = num(c[iLon]); + if (lat == null || lon == null) continue; + const d = km(LAT, LON, lat, lon); + if (d > 750) continue; + const wind = num(c[iWmo]) ?? num(c[iUsa]); + rows.push([ + c[iSid], + (c[iName] || 'UNNAMED').replace(/,/g, ' '), + time.replace(' ', 'T') + 'Z', + fmt(lat, 2), + fmt(lon, 2), + fmt(wind, 0), + fmt(num(c[iPres]), 0), + fmt(d, 0) + ]); + } + writeCsv( + 'cyclones.csv', + ['sid', 'name', 'time', 'lat', 'lon', 'wind_kt', 'pres_hpa', 'dist_km'], + rows + ); + console.log(`[external] cyclones: ${rows.length} track points`); +} + +const jobs = { weather, ocean, tide, climate, cyclones }; for (const [name, job] of Object.entries(jobs)) { if (!want(name)) continue; try { diff --git a/src/lib/components/charts/LineChart.svelte b/src/lib/components/charts/LineChart.svelte index d654be6..59f3bd7 100644 --- a/src/lib/components/charts/LineChart.svelte +++ b/src/lib/components/charts/LineChart.svelte @@ -27,6 +27,7 @@ xFormat, bands = [], refs = [], + markers = [], yDomain }: { series: LineSeries[]; @@ -39,6 +40,8 @@ xFormat?: (v: number) => string; bands?: { x0: number; x1: number; label?: string }[]; refs?: { y: number; label: string }[]; + /** Labelled vertical lines at single x values (events). */ + markers?: { x: number; label: string }[]; yDomain?: [number, number]; } = $props(); @@ -60,7 +63,12 @@ })); let width = $state(640); - const m = $derived({ top: 12, right: 16, bottom: xLabel ? 44 : 30, left: 52 }); + const m = $derived({ + top: markers.length ? 20 : 12, + right: 16, + bottom: xLabel ? 44 : 30, + left: 52 + }); const fx = $derived( xFormat ?? (xType === 'date' ? (v: number) => fromDay(Math.round(v)) : compact) ); @@ -153,6 +161,19 @@ fill="var(--surface-2)" /> {/each} + {#each markers as mk (mk.label)} + + {mk.label} + {/each} {#each yt as t (t)} Math.round(Date.parse(`${iso.slice(0, 10)}T00:00:00Z`) / 86_400_000); +/** UTC timestamp → Moorea local date (UTC−10). */ +const localDate = (ts: string) => + new Date(Date.parse(ts) - 10 * 3_600_000).toISOString().slice(0, 10); +const cell = (s: SetRow) => `${s.season}|${s.date!.slice(5, 7)}`; +const hours = (s: SetRow) => s.durationMin! / 60; +const count = (s: SetRow) => Math.round((s.cpue ?? 0) * hours(s)); + +/** + * Observed / expected sharks for a group of sets, where expected uses the catch rate of the + * other sets in the same season and month. 95% interval from a bootstrap over the group's sets + * (the reference rates are held fixed). + */ +function standardised(sets: SetRow[], inGroup: (s: SetRow) => boolean) { + const ref = new Map(); + for (const s of sets) { + if (inGroup(s)) continue; + const r = ref.get(cell(s)) ?? { n: 0, h: 0 }; + r.n += count(s); + r.h += hours(s); + ref.set(cell(s), r); + } + const group = sets + .filter((s) => inGroup(s) && (ref.get(cell(s))?.h ?? 0) > 0) + .map((s) => { + const r = ref.get(cell(s))!; + return { o: count(s), e: (r.n / r.h) * hours(s) }; + }); + const ratio = (g: { o: number; e: number }[]) => { + const e = g.reduce((a, x) => a + x.e, 0); + return e > 0 ? g.reduce((a, x) => a + x.o, 0) / e : null; + }; + const est = ratio(group); + if (est == null || group.length < 3) return { n: group.length, ratio: null, lo: null, hi: null }; + let seed = 7; + const rand = () => (seed = (seed * 16807) % 2147483647) / 2147483647; + const boots: number[] = []; + for (let b = 0; b < 1000; b++) { + const r = ratio(group.map(() => group[Math.floor(rand() * group.length)])); + if (r != null) boots.push(r); + } + boots.sort((a, b) => a - b); + return { + n: group.length, + ratio: round(est, 3), + lo: round(boots[Math.floor(0.025 * boots.length)], 3), + hi: round(boots[Math.ceil(0.975 * boots.length) - 1], 3) + }; +} + +/** Days from the most recent event on or before each set's date (null if none in 60 days). */ +function sinceLast(sets: SetRow[], events: number[]) { + const sorted = [...events].sort((a, b) => a - b); + return new Map( + sets.map((s) => { + const day = dayNo(s.date!); + let best: number | null = null; + for (const e of sorted) if (e <= day) best = day - e; + return [s.id, best != null && best <= 60 ? best : null]; + }) + ); +} + +const BINS = [ + { label: 'Same day to 3 days after', lo: 0, hi: 3 }, + { label: '4–7 days after', lo: 4, hi: 7 }, + { label: '8–14 days after', lo: 8, hi: 14 }, + { label: '15–30 days after', lo: 15, hi: 30 } +]; + +export function weatherEvents(d: Dataset) { + const sets = effortSets(d).filter((s) => s.date && s.cpue != null); + + // Storms: closest approach of each track. + const bySid = new Map(); + for (const p of d.cyclones) bySid.set(p.sid, [...(bySid.get(p.sid) ?? []), p]); + const storms = [...bySid.values()] + .map((pts) => { + const near = pts.reduce((a, b) => (b.distKm < a.distKm ? b : a)); + const close = pts.filter((p) => p.distKm <= CYCLONE_KM); + const date = localDate(near.ts); + const after = sets.filter((s) => { + const k = dayNo(s.date!) - dayNo(date); + return k >= 0 && k <= 14; + }); + return { + sid: near.sid, + name: near.name === 'UNNAMED' ? 'Unnamed' : near.name[0] + near.name.slice(1).toLowerCase(), + date, + distKm: Math.round(near.distKm), + windKt: Math.max(0, ...close.map((p) => p.windKt ?? 0)) || null, + setsAfter: after.length + }; + }) + .filter((s) => s.distKm <= CYCLONE_KM) + .sort((a, b) => a.date.localeCompare(b.date)); + const stormDays = storms.map((s) => dayNo(s.date)); + const stormSince = sinceLast(sets, stormDays); + const afterStorm = standardised(sets, (s) => { + const k = stormSince.get(s.id); + return k != null && k <= 14; + }); + + // Heavy-rain days from the ERA5 daily series. + const rain = d.weather.filter((w) => w.precip != null); + const threshold = quantile( + rain.map((w) => w.precip), + RAIN_Q + ); + if (threshold == null) return null; + const heavy = rain.filter((w) => w.precip! >= threshold); + const byMonth = Array.from( + { length: 12 }, + (_, m) => heavy.filter((w) => Number(w.date.slice(5, 7)) === m + 1).length + ); + const rainSince = sinceLast( + sets, + heavy.map((w) => dayNo(w.date)) + ); + const afterRain = BINS.map((b) => ({ + label: b.label, + ...standardised(sets, (s) => { + const k = rainSince.get(s.id); + return k != null && k >= b.lo && k <= b.hi; + }) + })); + const wettest = [...heavy].sort((a, b) => b.precip! - a.precip!)[0]; + + return { + years: rain.length ? [rain[0].date.slice(0, 4), rain[rain.length - 1].date.slice(0, 4)] : [], + storms, + afterStorm, + threshold: round(threshold, 0)!, + heavyDays: heavy.length, + byMonth, + afterRain, + wettest: wettest ? { date: wettest.date, mm: round(wettest.precip, 0) } : null + }; +} diff --git a/src/lib/server/data.ts b/src/lib/server/data.ts index ed1e0c1..2d638b0 100644 --- a/src/lib/server/data.ts +++ b/src/lib/server/data.ts @@ -45,6 +45,7 @@ export interface Dataset { weather: WeatherDay[]; ocean: OceanDay[]; climate: (typeof schema.climateMonthly.$inferSelect)[]; + cyclones: (typeof schema.cyclonePoints.$inferSelect)[]; issues: DataIssue[]; seasons: string[]; } @@ -96,6 +97,7 @@ export function dataset(): Dataset { weather: db.select().from(schema.weatherDaily).orderBy(asc(schema.weatherDaily.date)).all(), ocean: db.select().from(schema.oceanDaily).orderBy(asc(schema.oceanDaily.date)).all(), climate: db.select().from(schema.climateMonthly).orderBy(asc(schema.climateMonthly.ym)).all(), + cyclones: db.select().from(schema.cyclonePoints).orderBy(asc(schema.cyclonePoints.ts)).all(), issues: db.select().from(schema.dataIssues).all(), seasons }; diff --git a/src/lib/server/db/schema.ts b/src/lib/server/db/schema.ts index 4bc6d50..337caf4 100644 --- a/src/lib/server/db/schema.ts +++ b/src/lib/server/db/schema.ts @@ -485,6 +485,19 @@ export const tideExtrema = sqliteTable('tide_extrema', { mm: real('mm').notNull() }); +/** Tropical cyclone track points within 750 km of Moorea (IBTrACS, UTC, #24). */ +export const cyclonePoints = sqliteTable('cyclone_points', { + id: integer('id').primaryKey(), + sid: text('sid').notNull(), + name: text('name').notNull(), + ts: text('ts').notNull(), // ISO UTC + lat: real('lat').notNull(), + lon: real('lon').notNull(), + windKt: real('wind_kt'), + presHpa: real('pres_hpa'), + distKm: real('dist_km').notNull() +}); + export const climateMonthly = sqliteTable('climate_monthly', { ym: text('ym').primaryKey(), // YYYY-MM oni: real('oni'), diff --git a/src/lib/server/import/external.ts b/src/lib/server/import/external.ts index dbb97ca..360e906 100644 --- a/src/lib/server/import/external.ts +++ b/src/lib/server/import/external.ts @@ -33,5 +33,6 @@ export const EXTERNAL_FILES = [ 'weather-hourly.csv.gz', 'ocean-daily.csv', 'tide-papeete-hourly.csv.gz', - 'climate-monthly.csv' + 'climate-monthly.csv', + 'cyclones.csv' ]; diff --git a/src/lib/server/import/import.test.ts b/src/lib/server/import/import.test.ts index 09998b4..c6480c8 100644 --- a/src/lib/server/import/import.test.ts +++ b/src/lib/server/import/import.test.ts @@ -1,6 +1,7 @@ import { describe, expect, it } from 'vitest'; import { dataset } from '../data'; import { diet } from '../analytics/diet'; +import { weatherEvents } from '../analytics/events'; import { topFindings } from '../analytics/findings'; import { seasonRewind } from '../analytics/rewind'; @@ -69,6 +70,18 @@ describe('import of the synthetic fixture', () => { expect(r.prey.map((p) => p.key)).toEqual(['fish']); }); + it('loads cyclone tracks and heavy-rain days (#24)', () => { + // external/ is the committed public snapshot, not synthetic data. + expect(d.cyclones.length).toBeGreaterThan(10); + const ev = weatherEvents(d)!; + const niko = ev.storms.find((s) => s.name === 'Niko'); + expect(niko?.date).toBe('2015-01-21'); + expect(niko!.distKm).toBeLessThan(200); + expect(ev.byMonth).toHaveLength(12); + expect(ev.heavyDays).toBe(ev.byMonth.reduce((a, b) => a + b, 0)); + expect(ev.threshold).toBeGreaterThan(20); + }); + it('computes findings without throwing', () => { expect(topFindings(d).length).toBeGreaterThan(3); }); diff --git a/src/lib/server/import/index.ts b/src/lib/server/import/index.ts index a3e90ce..0ebbf54 100644 --- a/src/lib/server/import/index.ts +++ b/src/lib/server/import/index.ts @@ -73,7 +73,7 @@ import { SITE_DEFS } from './sites'; import { readWorkbook } from './xlsx'; /** Bump when import logic changes so existing caches rebuild on the next start. */ -export const IMPORTER_VERSION = '6'; +export const IMPORTER_VERSION = '7'; const MIGRATIONS = import.meta.glob('/drizzle/*.sql', { query: '?raw', @@ -530,6 +530,7 @@ export function runImport( const wHourly = new Map(readCsv(opts.externalDir, 'weather-hourly.csv').map((r) => [r.ts, r])); const ocean = new Map(readCsv(opts.externalDir, 'ocean-daily.csv').map((r) => [r.date, r])); const climate = new Map(readCsv(opts.externalDir, 'climate-monthly.csv').map((r) => [r.ym, r])); + const cyclones = readCsv(opts.externalDir, 'cyclones.csv'); const tidePts: HourlyPoint[] = readCsv(opts.externalDir, 'tide-papeete-hourly.csv') .map((r) => ({ t: tsToHour(r.ts), mm: Number(r.mm) })) .filter((x) => Number.isFinite(x.mm)) @@ -1020,6 +1021,21 @@ export function runImport( schema.climateMonthly, [...climate.values()].map((r) => ({ ym: r.ym, oni: val(r.oni), soi: val(r.soi) })) ); + insert( + schema.cyclonePoints, + cyclones + .filter((r) => r.sid && r.time && val(r.lat) != null && val(r.dist_km) != null) + .map((r) => ({ + sid: r.sid, + name: r.name || 'UNNAMED', + ts: r.time, + lat: val(r.lat)!, + lon: val(r.lon)!, + windKt: val(r.wind_kt), + presHpa: val(r.pres_hpa), + distKm: val(r.dist_km)! + })) + ); insert(schema.dataIssues, log.items); const metaRows = { hash, diff --git a/src/routes/+layout.svelte b/src/routes/+layout.svelte index 51c7a1b..650b5ce 100644 --- a/src/routes/+layout.svelte +++ b/src/routes/+layout.svelte @@ -205,8 +205,8 @@

Environmental data

Weather & waves: Open-Meteo (ERA5, CC BY 4.0). SST: NOAA OISST v2.1. Heat stress: NOAA - Coral Reef Watch via PacIOOS. Tides: UHSLC Papeete gauge. ENSO: NOAA CPC. Coastline © - OpenStreetMap contributors. + Coral Reef Watch via PacIOOS. Tides: UHSLC Papeete gauge. ENSO: NOAA CPC. Cyclones: NOAA + IBTrACS. Coastline © OpenStreetMap contributors.

diff --git a/src/routes/about/+page.svelte b/src/routes/about/+page.svelte index 4f611ff..38b5469 100644 --- a/src/routes/about/+page.svelte +++ b/src/routes/about/+page.svelte @@ -56,6 +56,10 @@
  • El Niño: NOAA Climate Prediction Center Oceanic Niño Index and Southern Oscillation Index.
  • +
  • + Cyclones: NOAA IBTrACS v04r01 South Pacific best tracks, positions within 750 km of Mo'orea. + A heavy-rain day is one of the wettest 1% of days in the ERA5 daily series. +
  • Sun and moon: computed for Mo'orea (17.53° S, 149.83° W, UTC−10) from standard astronomical formulas. diff --git a/src/routes/weather/+page.server.ts b/src/routes/weather/+page.server.ts index c225ed8..fdcf42e 100644 --- a/src/routes/weather/+page.server.ts +++ b/src/routes/weather/+page.server.ts @@ -1,6 +1,7 @@ import { memo } from '#lib/server/data'; import { binnedMean, cpueOf, effortSets, round } from '#lib/server/analytics/common'; import { crewVsEra5 } from '#lib/server/analytics/cloud'; +import { weatherEvents } from '#lib/server/analytics/events'; import { mean, sum } from '#lib/stats'; import type { PageServerLoad } from './$types'; @@ -50,7 +51,10 @@ export const load: PageServerLoad = () => (u: string, dp = 0) => (a: number, b: number) => `${round(a, dp)}–${round(b, dp)}${u}`; + const events = weatherEvents(d); return { + events, + stormMarkers: (events?.storms ?? []).map((s) => ({ x: toDay(s.date), label: s.name })), crewCloud: crewVsEra5(d), byMonth, rainMonthly: [...monthly.entries()] diff --git a/src/routes/weather/+page.svelte b/src/routes/weather/+page.svelte index d89e82f..6b1433e 100644 --- a/src/routes/weather/+page.svelte +++ b/src/routes/weather/+page.svelte @@ -3,6 +3,7 @@ import BarChart from '#lib/components/charts/BarChart.svelte'; import LineChart from '#lib/components/charts/LineChart.svelte'; import Polar from '#lib/components/charts/Polar.svelte'; + import DataTable from '#lib/components/DataTable.svelte'; import { date, MONTH_NAMES, num } from '#lib/format'; import type { PageProps } from './$types'; @@ -76,9 +77,15 @@ valueFormat={(v) => `${num(v)} mm`} /> - + `${num(v)} mm`} @@ -163,8 +170,106 @@
  • + {#if data.events} + {@const ev = data.events} + {@const rows = [ + ...ev.afterRain, + ...(ev.afterStorm.ratio != null + ? [{ label: 'Within 2 weeks after a cyclone', ...ev.afterStorm }] + : []) + ]} + {@const shown = rows.filter((r) => r.ratio != null)} + {@const clear = shown.filter((r) => r.lo! > 1 || r.hi! < 1)} +
    +

    Storms and downpours

    +

    + A heavy-rain day here is one of the wettest 1% of days in the ERA5 record ({num( + ev.threshold + )} mm or more in the grid cell; {num(ev.heavyDays)} days since {ev.years[0]}). Cyclone + tracks come from NOAA IBTrACS. Catches after each kind of event are compared with the usual + rate for the same season and month, because both storms and downpours cluster in the wet + season, when catches change anyway. +

    +
    + r.label.toLowerCase()).join(', ')}.` + : 'Every interval includes 1: no sign that a downpour or a passing cyclone changes catches in the weeks after.' + : ''} + table={{ + columns: [ + { key: 'label', label: 'When' }, + { key: 'n', label: 'Sets', num: true }, + { key: 'r', label: 'vs usual' } + ], + rows: rows.map((r) => ({ + ...r, + r: r.ratio != null ? `×${num(r.ratio, 2)} (${num(r.lo, 2)}–${num(r.hi, 2)})` : '–' + })) + }} + > + `${r.label} (${r.n})`)} + series={[ + { + name: 'Catch rate vs usual', + color: 'var(--series-1)', + values: shown.map((r) => r.ratio) + } + ]} + errors={shown.map((r) => [r.lo!, r.hi!] as [number, number])} + valueFormat={(v) => `×${num(v, 2)}`} + labels + /> + + + + +
    +

    Cyclones within 500 km since {ev.years[0]}

    + {#if ev.storms.length} + ({ ...s, dateL: date(s.date) }))} + /> +

    + Date and distance of the storm centre's closest approach. Wind is the strongest + reported while within 500 km; 1 kt ≈ 1.85 km/h. +

    + {:else} +

    No cyclone track passed within 500 km in this period.

    + {/if} +
    +
    +
    + {/if} + {#if data.lastDate}

    Weather data to {date(data.lastDate)}. Source: Open-Meteo Historical Weather API (ERA5, CC BY - 4.0). + 4.0). Cyclones: NOAA IBTrACS v04r01.

    {/if} + +