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 570b47b..7d26812 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) glm.ts (NB/Poisson GLM, splines) · catchModel.ts (joint catch model) src/lib/server/astro.ts sunset/twilight/moon (local formulas) · tides.ts (extrema, interpolation) src/lib/server/holidays.ts French Polynesia public holidays (Easter-based too) + festive window @@ -87,6 +88,12 @@ samples/fixture/ synthetic workbooks for tests/CI (committed) - ERA5 `cloud_evening` covers every set; the crew's 1–4 `cloud_cover` score exists only in 2020–22 and tracks ERA5 (score 1 ≈ 43%, 4 ≈ 94%). `moonlight()` in `analytics/cloud.ts` = illumination × sin(moon altitude) × clear-sky fraction. - Cloud vs water temperature must be compared within the same month: the cloudy wet season is also the warmest, so raw correlations are ~0 while within-month ones are strongly negative. +### Cyclones and heavy rain (#24) + +- `fetch-external.mjs --only=cyclones` downloads the IBTrACS South Pacific CSV (~36 MB) and keeps track points within 750 km of Moorea since 2013 (`external/cyclones.csv`, `cyclone_points` table). Analyses use 500 km. +- Heavy-rain day = top 1% of ERA5 daily precipitation (the grid cell under-reads mountain rain). +- After-event catches are compared with other sets in the same season and month (observed / expected, bootstrap interval), never with all sets: storms and downpours cluster in the wet season. + ### Catch model (#54) - `analytics/catchModel.ts`: negative-binomial counts per timed gillnet set, offset log(net-hours), natural-spline day of season (knots at the 0/25/50/75/100% quantiles), nursery and season as effect-coded fixed effects (each level vs the average; no random effects), and nine environment terms per +1 SD. Complete cases only; nurseries need ≥ 30 complete sets, and a species gets a nursery effect only where ≥ 10 of it were caught (otherwise the estimate runs off to zero or infinity). 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} + +