diff --git a/AGENTS.md b/AGENTS.md index ace5450..a086ea7 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -97,6 +97,12 @@ samples/fixture/ synthetic workbooks for tests/CI (committed) - 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. +### Chlorophyll-a (#23) + +- `fetch-external.mjs --only=chlorophyll` reads NOAA S-NPP VIIRS science-quality weekly chlorophyll (`noaacwNPPVIIRSSQchlaWeekly` on coastwatch.noaa.gov ERDDAP; the pfeg copy only redirects there) for a box around Moorea and writes one median per week (`external/chlorophyll-weekly.csv`, `chlorophyll_weekly` table, `sets.chl` for the week holding the set date). +- The median covers an offshore ring: pixels within 30 km of Moorea's centre and ≥ 10 km from any pixel with no value in more than half the weeks (land and coast, Tahiti's included). Coastal pixels read tens of times the open ocean (land in the pixel, lagoon floor, haze), and some get a value often enough that "never valid" misses them. The job throws if the ring shrinks below 40 pixels. +- Science-quality weeks lag by about six weeks. It is the ocean around the island, not lagoon water; don't describe it as conditions in the nurseries. + ### 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/drizzle/0005_melted_fat_cobra.sql b/drizzle/0005_melted_fat_cobra.sql new file mode 100644 index 0000000..37a0b1c --- /dev/null +++ b/drizzle/0005_melted_fat_cobra.sql @@ -0,0 +1,7 @@ +CREATE TABLE `chlorophyll_weekly` ( + `date` text PRIMARY KEY NOT NULL, + `chl` real, + `pixels` integer NOT NULL +); +--> statement-breakpoint +ALTER TABLE `sets` ADD `chl` real; \ No newline at end of file diff --git a/drizzle/meta/0005_snapshot.json b/drizzle/meta/0005_snapshot.json new file mode 100644 index 0000000..23ea15b --- /dev/null +++ b/drizzle/meta/0005_snapshot.json @@ -0,0 +1,3223 @@ +{ + "version": "6", + "dialect": "sqlite", + "id": "6ad99c8e-03ff-43bd-8102-508420761a19", + "prevId": "fbbd43b9-606f-4d85-8dbd-9b4986f548a7", + "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": {} + }, + "chlorophyll_weekly": { + "name": "chlorophyll_weekly", + "columns": { + "date": { + "name": "date", + "type": "text", + "primaryKey": true, + "notNull": true, + "autoincrement": false + }, + "chl": { + "name": "chl", + "type": "real", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "pixels": { + "name": "pixels", + "type": "integer", + "primaryKey": false, + "notNull": true, + "autoincrement": false + } + }, + "indexes": {}, + "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": {} + }, + "school_holidays": { + "name": "school_holidays", + "columns": { + "id": { + "name": "id", + "type": "integer", + "primaryKey": true, + "notNull": true, + "autoincrement": false + }, + "school_year": { + "name": "school_year", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "name": { + "name": "name", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "start": { + "name": "start", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "end": { + "name": "end", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "source": { + "name": "source", + "type": "text", + "primaryKey": false, + "notNull": true, + "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 + }, + "chl": { + "name": "chl", + "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 cc2a586..8836709 100644 --- a/drizzle/meta/_journal.json +++ b/drizzle/meta/_journal.json @@ -36,6 +36,13 @@ "when": 1793692150045, "tag": "0004_numerous_corsair", "breakpoints": true + }, + { + "idx": 5, + "version": "6", + "when": 1793749487724, + "tag": "0005_melted_fat_cobra", + "breakpoints": true } ] } \ No newline at end of file diff --git a/external/chlorophyll-weekly.csv b/external/chlorophyll-weekly.csv new file mode 100644 index 0000000..42d26b7 --- /dev/null +++ b/external/chlorophyll-weekly.csv @@ -0,0 +1,672 @@ +date,chl,pixels +2013-07-30,0.0868,105 +2013-08-06,0.0747,107 +2013-08-13,0.0639,107 +2013-08-20,0.0608,107 +2013-08-27,0.0618,107 +2013-09-03,0.0624,107 +2013-09-10,0.065,107 +2013-09-17,0.0613,81 +2013-09-24,0.0486,107 +2013-10-01,0.0559,107 +2013-10-08,0.0578,107 +2013-10-15,0.0653,101 +2013-10-22,0.0554,107 +2013-10-29,0.0528,97 +2013-11-05,0.0645,53 +2013-11-12,0.0554,84 +2013-11-19,0.0549,83 +2013-11-26,0.0623,82 +2013-12-03,0.0552,107 +2013-12-10,0.0463,94 +2013-12-17,0.0631,63 +2013-12-24,0.0535,107 +2014-01-01,0.0551,107 +2014-01-08,0.0581,101 +2014-01-15,0.0521,107 +2014-01-22,0.0722,15 +2014-01-29,0.0572,96 +2014-02-05,0.0631,40 +2014-02-12,0.057,107 +2014-02-19,0.0632,41 +2014-02-26,0.0602,88 +2014-03-05,0.0599,96 +2014-03-12,,0 +2014-03-19,0.0682,105 +2014-03-26,0.0617,106 +2014-04-02,0.0672,97 +2014-04-09,0.0529,107 +2014-04-16,0.0554,105 +2014-04-23,0.0614,86 +2014-04-30,0.0658,20 +2014-05-07,0.0619,107 +2014-05-14,0.053,107 +2014-05-21,0.0511,107 +2014-05-28,0.0511,107 +2014-06-04,0.0587,106 +2014-06-11,0.0603,107 +2014-06-18,0.0615,107 +2014-06-25,0.0545,107 +2014-07-02,0.0425,107 +2014-07-09,0.0511,107 +2014-07-16,0.0476,107 +2014-07-23,0.047,107 +2014-07-30,0.055,107 +2014-08-06,0.0654,107 +2014-08-13,0.066,107 +2014-08-20,0.0589,107 +2014-08-27,0.0767,100 +2014-09-03,0.0712,106 +2014-09-10,0.0666,55 +2014-09-17,0.049,105 +2014-09-24,0.0546,95 +2014-10-01,0.0511,105 +2014-10-08,0.0446,106 +2014-10-15,0.0455,107 +2014-10-22,0.0625,94 +2014-10-29,0.0617,36 +2014-11-05,0.0376,107 +2014-11-12,0.0394,101 +2014-11-19,0.0523,79 +2014-11-26,0.0517,81 +2014-12-03,0.0621,50 +2014-12-10,0.0485,45 +2014-12-17,0.0355,75 +2014-12-24,0.0531,36 +2015-01-01,0.0435,89 +2015-01-08,0.0486,96 +2015-01-15,0.0731,15 +2015-01-22,,5 +2015-01-29,0.0528,99 +2015-02-05,0.0581,49 +2015-02-12,0.0687,66 +2015-02-19,0.063,103 +2015-02-26,0.0541,79 +2015-03-05,0.0627,107 +2015-03-12,0.0505,107 +2015-03-19,0.055,107 +2015-03-26,0.0649,87 +2015-04-02,0.0691,106 +2015-04-09,0.0651,107 +2015-04-16,0.0654,107 +2015-04-23,0.0661,107 +2015-04-30,0.07,107 +2015-05-07,0.0617,107 +2015-05-14,0.0634,107 +2015-05-21,0.0658,107 +2015-05-28,0.0716,107 +2015-06-04,0.0552,107 +2015-06-11,0.0627,106 +2015-06-18,0.0607,107 +2015-06-25,0.052,107 +2015-07-02,0.063,97 +2015-07-09,0.0691,107 +2015-07-16,0.0666,107 +2015-07-23,0.0657,105 +2015-07-30,0.0736,107 +2015-08-06,0.0891,107 +2015-08-13,0.0847,73 +2015-08-20,0.081,106 +2015-08-27,0.0768,107 +2015-09-03,0.0748,107 +2015-09-10,0.0744,57 +2015-09-17,0.0714,86 +2015-09-24,0.0536,107 +2015-10-01,0.06,107 +2015-10-08,0.0549,97 +2015-10-15,0.0685,84 +2015-10-22,0.0568,97 +2015-10-29,0.0642,76 +2015-11-05,0.058,65 +2015-11-12,0.0502,99 +2015-11-19,0.0466,107 +2015-11-26,0.054,59 +2015-12-03,0.0532,95 +2015-12-10,0.062,84 +2015-12-17,0.054,58 +2015-12-24,0.072,64 +2016-01-01,,6 +2016-01-08,0.0582,31 +2016-01-15,0.0412,95 +2016-01-22,0.0569,105 +2016-01-29,0.0551,68 +2016-02-05,0.0542,107 +2016-02-12,0.0586,39 +2016-02-19,0.0674,61 +2016-02-26,,0 +2016-03-04,0.0814,79 +2016-03-11,0.0652,99 +2016-03-18,0.066,98 +2016-03-25,0.0625,107 +2016-04-01,0.0834,104 +2016-04-08,0.0745,100 +2016-04-15,0.077,68 +2016-04-22,0.0797,94 +2016-04-29,0.0894,76 +2016-05-06,0.0937,29 +2016-05-13,0.0648,107 +2016-05-20,0.0705,107 +2016-05-27,0.0628,107 +2016-06-03,0.071,105 +2016-06-10,0.0729,107 +2016-06-17,0.0627,87 +2016-06-24,0.0726,107 +2016-07-01,0.0732,105 +2016-07-08,0.0611,107 +2016-07-15,0.0568,107 +2016-07-22,0.058,107 +2016-07-29,0.0622,107 +2016-08-05,0.0527,107 +2016-08-12,0.0508,107 +2016-08-19,0.0623,63 +2016-08-26,0.0533,107 +2016-09-02,0.0565,107 +2016-09-09,0.0456,107 +2016-09-16,0.0434,106 +2016-09-23,0.0505,107 +2016-09-30,0.0473,105 +2016-10-07,0.0438,100 +2016-10-14,0.0304,107 +2016-10-21,0.0414,104 +2016-10-28,0.0325,107 +2016-11-04,0.0383,106 +2016-11-11,,1 +2016-11-18,0.0376,107 +2016-11-25,0.0344,107 +2016-12-02,0.0428,99 +2016-12-09,0.046,99 +2016-12-16,0.0404,21 +2016-12-23,,4 +2017-01-01,0.0503,107 +2017-01-08,0.0609,29 +2017-01-15,,0 +2017-01-22,0.0574,53 +2017-01-29,0.0568,87 +2017-02-05,0.0656,21 +2017-02-12,0.06,94 +2017-02-19,0.069,106 +2017-02-26,0.0554,107 +2017-03-05,0.0504,103 +2017-03-12,0.0571,107 +2017-03-19,0.0633,105 +2017-03-26,0.0681,32 +2017-04-02,0.0732,78 +2017-04-09,0.0751,100 +2017-04-16,0.0632,107 +2017-04-23,0.0603,107 +2017-04-30,0.054,107 +2017-05-07,0.0504,107 +2017-05-14,0.0746,73 +2017-05-21,0.0574,107 +2017-05-28,0.0548,107 +2017-06-04,0.0553,106 +2017-06-11,0.0478,107 +2017-06-18,0.0647,102 +2017-06-25,0.0563,107 +2017-07-02,0.0479,106 +2017-07-09,0.054,107 +2017-07-16,0.0601,107 +2017-07-23,0.0521,107 +2017-07-30,0.0457,107 +2017-08-06,0.0605,106 +2017-08-13,0.0705,105 +2017-08-20,0.055,107 +2017-08-27,0.064,71 +2017-09-03,0.0556,107 +2017-09-10,0.0474,107 +2017-09-17,0.0403,107 +2017-09-24,0.0582,68 +2017-10-01,0.0413,81 +2017-10-08,,2 +2017-10-15,0.0576,24 +2017-10-22,0.0402,105 +2017-10-29,0.0408,39 +2017-11-05,,2 +2017-11-12,0.0507,93 +2017-11-19,0.0555,21 +2017-11-26,0.0471,104 +2017-12-03,0.0378,79 +2017-12-10,0.0458,58 +2017-12-17,0.0508,54 +2017-12-24,0.0415,104 +2018-01-01,,6 +2018-01-08,0.0433,92 +2018-01-15,0.0458,106 +2018-01-22,0.0492,104 +2018-01-29,0.0514,50 +2018-02-05,,0 +2018-02-12,0.0603,67 +2018-02-19,0.0878,103 +2018-02-26,0.0503,104 +2018-03-05,0.0579,100 +2018-03-12,0.0632,11 +2018-03-19,0.0482,107 +2018-03-26,0.0452,107 +2018-04-02,0.0538,105 +2018-04-09,0.075,94 +2018-04-16,0.0892,62 +2018-04-23,0.0699,103 +2018-04-30,0.0565,107 +2018-05-07,0.0654,99 +2018-05-14,0.0498,103 +2018-05-21,0.0484,107 +2018-05-28,0.0379,107 +2018-06-04,0.0461,107 +2018-06-11,0.0514,107 +2018-06-18,0.0516,107 +2018-06-25,0.0478,107 +2018-07-02,0.0409,105 +2018-07-09,0.0426,107 +2018-07-16,0.0522,107 +2018-07-23,0.0474,107 +2018-07-30,0.0412,105 +2018-08-06,0.0522,95 +2018-08-13,0.0467,106 +2018-08-20,0.0392,104 +2018-08-27,0.0354,102 +2018-09-03,0.0395,107 +2018-09-10,0.0402,107 +2018-09-17,0.049,96 +2018-09-24,0.0452,107 +2018-10-01,0.0566,63 +2018-10-08,0.0427,105 +2018-10-15,0.0455,107 +2018-10-22,0.0432,42 +2018-10-29,0.0445,47 +2018-11-05,0.047,107 +2018-11-12,0.0567,59 +2018-11-19,0.0397,103 +2018-11-26,0.0418,103 +2018-12-03,,4 +2018-12-10,0.0442,78 +2018-12-17,0.0388,107 +2018-12-24,0.0417,95 +2019-01-01,0.0372,106 +2019-01-08,,0 +2019-01-15,0.0463,105 +2019-01-22,0.028,16 +2019-01-29,0.0447,68 +2019-02-05,0.0354,26 +2019-02-12,0.0237,39 +2019-02-19,0.0294,15 +2019-02-26,0.0364,107 +2019-03-05,0.0373,107 +2019-03-12,0.0464,103 +2019-03-19,0.0504,106 +2019-03-26,0.0828,92 +2019-04-02,0.1255,95 +2019-04-09,0.0912,97 +2019-04-16,0.0637,106 +2019-04-23,0.1181,107 +2019-04-30,0.0596,107 +2019-05-07,0.0523,107 +2019-05-14,0.0397,107 +2019-05-21,0.0399,103 +2019-05-28,0.0418,107 +2019-06-04,0.0385,107 +2019-06-11,0.0389,107 +2019-06-18,0.0714,88 +2019-06-25,0.0611,96 +2019-07-02,0.057,64 +2019-07-09,0.0777,107 +2019-07-16,0.0817,107 +2019-07-23,0.0631,107 +2019-07-30,0.0689,107 +2019-08-06,0.0544,107 +2019-08-13,0.0417,107 +2019-08-20,0.0417,107 +2019-08-27,0.0307,94 +2019-09-03,0.0484,107 +2019-09-10,0.0438,107 +2019-09-17,0.0424,101 +2019-09-24,0.0386,107 +2019-10-01,0.0368,103 +2019-10-08,0.032,98 +2019-10-15,0.039,89 +2019-10-22,0.0341,107 +2019-10-29,0.0436,12 +2019-11-05,0.0439,49 +2019-11-12,0.0309,84 +2019-11-19,0.053,73 +2019-11-26,0.0365,105 +2019-12-03,0.0489,11 +2019-12-10,,0 +2019-12-17,,0 +2019-12-24,0.0551,25 +2020-01-01,0.0371,99 +2020-01-08,,7 +2020-01-15,0.0415,96 +2020-01-22,0.0442,99 +2020-01-29,0.054,30 +2020-02-05,0.0336,82 +2020-02-12,0.0319,107 +2020-02-19,0.04,106 +2020-02-26,,0 +2020-03-04,0.0559,106 +2020-03-11,0.038,107 +2020-03-18,0.0385,107 +2020-03-25,0.0399,98 +2020-04-01,0.0457,107 +2020-04-08,0.0461,106 +2020-04-15,0.0604,98 +2020-04-22,0.0628,107 +2020-04-29,0.0593,107 +2020-05-06,0.0542,107 +2020-05-13,0.0362,70 +2020-05-20,0.0466,102 +2020-05-27,0.0509,107 +2020-06-03,0.0558,107 +2020-06-10,0.0448,106 +2020-06-17,0.0447,82 +2020-06-24,0.054,107 +2020-07-01,0.0571,107 +2020-07-08,0.0584,107 +2020-07-15,0.0639,105 +2020-07-22,0.0599,103 +2020-07-29,0.0566,107 +2020-08-05,0.0528,107 +2020-08-12,0.0525,107 +2020-08-19,0.0586,92 +2020-08-26,0.0559,107 +2020-09-02,0.052,104 +2020-09-09,0.0453,107 +2020-09-16,0.0465,107 +2020-09-23,0.0397,107 +2020-09-30,0.0476,97 +2020-10-07,0.045,105 +2020-10-14,0.042,96 +2020-10-21,0.0238,13 +2020-10-28,0.0376,106 +2020-11-04,,8 +2020-11-11,0.0338,103 +2020-11-18,0.0276,82 +2020-11-25,0.028,91 +2020-12-02,0.0226,16 +2020-12-09,0.0494,86 +2020-12-16,0.0374,37 +2020-12-23,0.0314,58 +2021-01-01,0.0359,106 +2021-01-08,0.0369,105 +2021-01-15,0.0426,107 +2021-01-22,0.0475,105 +2021-01-29,0.0455,107 +2021-02-05,0.0528,107 +2021-02-12,0.0523,104 +2021-02-19,0.049,85 +2021-02-26,0.0474,106 +2021-03-05,0.0446,77 +2021-03-12,0.0487,107 +2021-03-19,0.0454,105 +2021-03-26,0.0437,107 +2021-04-02,0.0472,107 +2021-04-09,0.04,100 +2021-04-16,0.0442,107 +2021-04-23,0.0431,105 +2021-04-30,0.0463,107 +2021-05-07,0.0532,103 +2021-05-14,0.067,105 +2021-05-21,0.0651,107 +2021-05-28,0.0628,107 +2021-06-04,0.0536,101 +2021-06-11,0.0599,104 +2021-06-18,0.0611,106 +2021-06-25,0.0572,107 +2021-07-02,0.057,103 +2021-07-09,0.0575,106 +2021-07-16,0.0726,104 +2021-07-23,0.0757,107 +2021-07-30,0.0712,107 +2021-08-06,0.0523,107 +2021-08-13,0.0542,106 +2021-08-20,0.0681,106 +2021-08-27,0.059,103 +2021-09-03,0.0528,107 +2021-09-10,0.0531,107 +2021-09-17,0.0494,103 +2021-09-24,0.0379,98 +2021-10-01,0.0441,107 +2021-10-08,0.0417,104 +2021-10-15,0.038,89 +2021-10-22,0.0445,34 +2021-10-29,0.0419,63 +2021-11-05,0.0495,91 +2021-11-12,0.0399,106 +2021-11-19,0.0419,105 +2021-11-26,0.0294,12 +2021-12-03,0.0493,97 +2021-12-10,0.0431,107 +2021-12-17,0.0331,93 +2021-12-24,0.0385,101 +2022-01-03,0.0404,77 +2022-01-08,0.0394,88 +2022-01-15,,7 +2022-01-22,0.0472,53 +2022-01-29,0.045,68 +2022-02-05,0.0521,49 +2022-02-12,0.0422,87 +2022-02-19,0.0472,99 +2022-02-26,0.0495,105 +2022-03-05,0.0478,107 +2022-03-12,0.0506,107 +2022-03-19,0.0521,62 +2022-03-26,0.0492,106 +2022-04-02,0.0536,102 +2022-04-09,0.0498,105 +2022-04-16,0.0565,107 +2022-04-23,0.0573,104 +2022-04-30,0.0553,91 +2022-05-07,0.0586,107 +2022-05-14,0.0603,105 +2022-05-21,0.0537,107 +2022-05-28,0.0547,104 +2022-06-04,0.0575,107 +2022-06-11,0.0539,107 +2022-06-18,0.0639,102 +2022-06-25,0.0661,106 +2022-07-02,0.0737,107 +2022-07-09,0.0819,105 +2022-07-16,0.0859,107 +2022-07-23,0.073,66 +2022-08-10,0.0893,94 +2022-08-13,0.082,100 +2022-08-20,0.0722,56 +2022-08-27,0.0648,107 +2022-09-03,0.0547,106 +2022-09-10,0.0727,99 +2022-09-17,0.0734,104 +2022-09-24,0.0651,102 +2022-10-01,0.0632,104 +2022-10-08,0.0578,84 +2022-10-15,0.051,101 +2022-10-22,0.0418,50 +2022-10-29,0.0383,20 +2022-11-05,0.0507,36 +2022-11-12,0.0579,85 +2022-11-19,0.0431,91 +2022-11-26,0.0382,94 +2022-12-03,0.0426,78 +2022-12-10,0.0687,16 +2022-12-17,0.0486,71 +2022-12-24,0.0497,101 +2023-01-01,0.0449,66 +2023-01-08,,7 +2023-01-15,0.0391,28 +2023-01-22,0.0607,80 +2023-01-29,0.0468,90 +2023-02-05,0.0479,107 +2023-02-12,0.0391,68 +2023-02-19,0.0437,95 +2023-02-26,0.0417,67 +2023-03-05,0.0603,101 +2023-03-12,0.0576,107 +2023-03-19,0.0509,107 +2023-03-26,0.0513,106 +2023-04-02,0.0527,92 +2023-04-09,0.0521,90 +2023-04-16,0.0568,90 +2023-04-23,0.0549,105 +2023-04-30,0.0549,102 +2023-05-07,0.0533,106 +2023-05-14,0.0606,107 +2023-05-21,0.0554,107 +2023-05-28,0.0589,107 +2023-06-04,0.0579,107 +2023-06-11,0.0584,102 +2023-06-18,0.062,107 +2023-06-25,0.0566,107 +2023-07-09,0.0606,107 +2023-07-16,0.0617,107 +2023-07-23,0.0394,75 +2023-07-30,0.0679,107 +2023-08-01,0.0649,107 +2023-08-06,0.0558,107 +2023-08-13,0.055,93 +2023-08-27,0.0749,98 +2023-09-03,0.0726,104 +2023-10-22,0.0477,90 +2023-10-29,0.0531,29 +2023-11-05,0.0503,98 +2023-11-12,0.0459,98 +2023-11-19,0.0778,105 +2023-11-26,0.0523,107 +2023-12-03,0.0431,17 +2023-12-10,0.0642,92 +2023-12-17,,1 +2023-12-24,0.0555,101 +2024-01-01,0.0419,23 +2024-01-08,0.0467,31 +2024-01-15,0.0474,99 +2024-01-22,0.0483,82 +2024-01-29,0.0509,107 +2024-02-05,,0 +2024-02-12,0.0498,70 +2024-02-19,0.052,106 +2024-02-26,0.0458,96 +2024-03-04,0.0471,83 +2024-03-11,0.0508,106 +2024-03-18,0.0493,107 +2024-03-25,0.0469,107 +2024-04-01,0.0577,107 +2024-04-08,0.0536,106 +2024-04-15,0.0577,103 +2024-04-22,0.0602,107 +2024-04-29,0.0595,107 +2024-05-06,0.0606,107 +2024-05-13,0.0632,107 +2024-05-20,0.0588,107 +2024-05-27,0.0612,107 +2024-06-03,0.0754,96 +2024-06-10,0.0821,107 +2024-06-17,0.0835,106 +2024-06-24,0.0963,107 +2024-07-01,0.0748,102 +2024-07-08,,0 +2024-07-15,0.0737,107 +2024-07-22,0.0803,107 +2024-07-29,0.0803,102 +2024-08-05,0.0568,104 +2024-08-12,0.0555,102 +2024-08-19,0.0721,107 +2024-08-26,0.0759,107 +2024-09-02,0.0829,107 +2024-09-09,0.0685,106 +2024-09-16,0.0586,107 +2024-09-23,0.047,105 +2024-09-30,0.0514,45 +2024-10-07,0.0551,101 +2024-10-14,0.0421,106 +2024-10-21,0.0569,98 +2024-10-30,0.0537,99 +2024-11-04,0.0423,64 +2024-11-11,0.0472,97 +2024-11-18,0.0505,97 +2024-11-25,0.0443,107 +2024-12-02,0.0421,102 +2024-12-09,,0 +2024-12-19,0.0382,58 +2024-12-23,0.0385,97 +2024-12-30,,7 +2025-01-01,0.0317,65 +2025-01-08,,0 +2025-01-15,0.0467,97 +2025-01-22,0.0377,106 +2025-01-29,0.0326,107 +2025-02-05,0.0265,107 +2025-02-12,0.0299,103 +2025-02-19,0.0377,107 +2025-02-26,0.0375,107 +2025-03-05,0.0459,84 +2025-03-12,0.0342,88 +2025-03-19,0.0464,107 +2025-03-26,0.0351,107 +2025-04-02,0.0345,107 +2025-04-09,0.045,105 +2025-04-16,,3 +2025-04-23,0.0662,62 +2025-04-30,0.0576,107 +2025-05-07,0.0513,106 +2025-05-14,0.0443,107 +2025-06-25,0.0766,106 +2025-07-02,0.056,96 +2025-07-09,0.065,97 +2025-07-16,0.0658,107 +2025-07-23,0.0547,107 +2025-07-30,0.0642,106 +2025-08-06,0.0617,107 +2025-08-13,0.0664,106 +2025-08-20,0.0614,107 +2025-08-27,0.0639,104 +2025-09-03,0.0659,103 +2025-09-10,0.0611,107 +2025-09-17,0.0655,107 +2025-09-24,0.0534,18 +2025-10-01,0.0753,104 +2025-10-08,0.0637,57 +2025-10-15,0.0348,18 +2025-10-22,0.0611,82 +2025-10-29,0.0532,107 +2025-11-05,0.051,89 +2025-11-12,0.0583,24 +2025-11-19,0.0965,44 +2025-11-26,,1 +2025-12-03,0.0525,85 +2025-12-10,0.065,31 +2025-12-17,0.0584,72 +2025-12-24,,2 +2025-12-31,0.0623,72 +2026-01-01,0.0592,104 +2026-01-08,0.0661,106 +2026-01-15,,7 +2026-01-29,0.0621,102 +2026-02-05,0.0548,104 +2026-02-12,0.0554,107 +2026-02-19,0.0621,107 +2026-02-26,0.0546,107 +2026-03-05,0.0653,104 +2026-03-12,0.0588,107 +2026-03-19,0.0665,107 +2026-03-26,0.0507,96 +2026-04-02,0.0526,107 +2026-04-10,0.0477,67 +2026-04-16,0.0602,107 +2026-04-23,0.0612,107 +2026-04-30,0.0723,107 +2026-05-07,0.0705,73 +2026-05-14,0.0947,107 +2026-05-21,0.0734,107 +2026-05-28,0.0742,107 +2026-06-04,0.0804,107 +2026-06-11,0.0866,101 +2026-06-18,0.0772,107 +2026-06-25,0.0808,107 +2026-07-02,0.0768,107 +2026-07-09,0.0879,104 +2026-07-16,0.1017,107 +2026-07-23,0.0743,107 +2026-07-30,0.1041,107 +2026-08-06,0.0849,107 +2026-08-14,0.0775,107 +2026-08-20,0.0875,107 +2026-08-27,0.0991,107 +2026-09-03,0.0691,98 +2026-09-24,0.0571,107 diff --git a/scripts/fetch-external.mjs b/scripts/fetch-external.mjs index de8cda2..a31925f 100644 --- a/scripts/fetch-external.mjs +++ b/scripts/fetch-external.mjs @@ -10,6 +10,7 @@ * - Open-Meteo Marine API with `models=era5_ocean` (waves, swell) * - NOAA OISST v2.1 daily SST via NOAA CoastWatch ERDDAP * - NOAA Coral Reef Watch 5 km daily heat stress via PacIOOS ERDDAP + * - NOAA S-NPP VIIRS weekly chlorophyll-a (NOAA STAR / CoastWatch ERDDAP), offshore ring (#23) * - 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) @@ -346,6 +347,79 @@ function km(lat1, lon1, lat2, lon2) { return 6371 * 2 * Math.asin(Math.sqrt(a)); } +/** + * Chlorophyll-a offshore of Moorea (#23): NOAA S-NPP VIIRS science-quality weekly composites + * (4 km, NOAA STAR and CoastWatch), a productivity proxy. Pixels beside small islands are + * unreliable (land in the pixel, the lagoon floor showing through, haze off the land), so each + * week is the median of an offshore ring: ocean pixels within 30 km of Moorea's centre and at + * least 10 km from any land or coast pixel, Tahiti's included. A land or coast pixel is one with + * no value in more than half of the weeks (coastal pixels get a value now and then, open ocean + * in about four weeks out of five). Weeks with fewer than 10 cloud-free ring pixels are blank. + */ +async function chlorophyll() { + const base = 'https://coastwatch.noaa.gov/erddap/griddap/noaacwNPPVIIRSSQchlaWeekly.csv'; + const [cLat, cLon] = [-17.535, -149.835]; + const box = '%5B(0.0)%5D%5B(-17.20):1:(-17.85)%5D%5B(-150.15):1:(-149.50)%5D'; + const cells = new Map(); // "lat|lon" → [lat, lon] + const weeks = new Map(); // date → Map("lat|lon" → mg m⁻³) + const all = chunks('2013-07-28', daysAgo(0)); + for (const [s, e] of all) { + // Science-quality weeks lag by a month or more, so the last chunk ends at `last`, and in + // January it may have no weeks yet. Any other failure keeps the old file. + const final = e === all[all.length - 1][1]; + let text; + try { + text = await get( + `${base}?chlor_a%5B(${s}T00:00:00Z):1:(${final ? 'last' : `${e}T23:59:59Z`})%5D${box}` + ); + } catch (err) { + if (!final) throw err; + console.warn(`[external] chlorophyll ${s}…: ${err.message}`); + continue; + } + for (const line of text.trim().split('\n').slice(2)) { + const [time, , lat, lon, chl] = line.split(','); + const key = `${lat}|${lon}`; + cells.set(key, [Number(lat), Number(lon)]); + const week = weeks.get(time.slice(0, 10)) ?? new Map(); + const v = Number(chl); + if (Number.isFinite(v) && v > 0) week.set(key, v); + weeks.set(time.slice(0, 10), week); + } + await sleep(1000); + } + const valid = new Map(); + for (const w of weeks.values()) for (const k of w.keys()) valid.set(k, (valid.get(k) ?? 0) + 1); + const isLand = (k) => (valid.get(k) ?? 0) < weeks.size / 2; + const land = [...cells].filter(([k]) => isLand(k)).map(([, c]) => c); + const ring = new Set( + [...cells] + .filter( + ([k, [lat, lon]]) => + !isLand(k) && + km(lat, lon, cLat, cLon) <= 30 && + land.every(([a, b]) => km(lat, lon, a, b) >= 10) + ) + .map(([k]) => k) + ); + // The grid or the land mask changing upstream would quietly move the ring: fail instead. + if (ring.size < 40 || land.length < 5) + throw new Error(`chlorophyll: ring of ${ring.size} pixels, ${land.length} land pixels`); + console.log(`[external] chlorophyll ring: ${ring.size} pixels (${land.length} land pixels)`); + const median = (xs) => { + const s = [...xs].sort((a, b) => a - b); + const m = s.length >> 1; + return s.length % 2 ? s[m] : (s[m - 1] + s[m]) / 2; + }; + const rows = [...weeks.entries()] + .sort(([a], [b]) => a.localeCompare(b)) + .map(([date, w]) => { + const vals = [...w].filter(([k]) => ring.has(k)).map(([, v]) => v); + return [date, vals.length >= 10 ? fmt(median(vals), 4) : '', String(vals.length)]; + }); + writeCsv('chlorophyll-weekly.csv', ['date', 'chl', 'pixels'], rows); +} + /** 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)'); @@ -510,7 +584,7 @@ async function school() { writeCsv('school-holidays.csv', ['school_year', 'name', 'start', 'end', 'source'], rows); } -const jobs = { weather, ocean, tide, climate, cyclones, school }; +const jobs = { weather, ocean, chlorophyll, tide, climate, cyclones, school }; for (const [name, job] of Object.entries(jobs)) { if (!want(name)) continue; try { diff --git a/src/lib/server/analytics/env.ts b/src/lib/server/analytics/env.ts index d19c651..f6c4bfc 100644 --- a/src/lib/server/analytics/env.ts +++ b/src/lib/server/analytics/env.ts @@ -49,6 +49,7 @@ export const SET_VARIABLES: SetVariable[] = [ { key: 'pressure', label: 'Air pressure', unit: 'hPa', dp: 1, get: (s) => s.pressure }, { key: 'waves', label: 'Wave height (offshore)', unit: 'm', dp: 1, get: (s) => s.waveHeight }, { key: 'swell', label: 'Swell height (offshore)', unit: 'm', dp: 1, get: (s) => s.swellHeight }, + { key: 'chl', label: 'Chlorophyll-a (offshore)', unit: 'mg/m³', dp: 3, get: (s) => s.chl }, { key: 'oni', label: 'El Niño index (ONI)', unit: '', dp: 1, get: (s) => s.oni }, { key: 'startSunset', diff --git a/src/lib/server/data.ts b/src/lib/server/data.ts index d819b22..4d04033 100644 --- a/src/lib/server/data.ts +++ b/src/lib/server/data.ts @@ -44,6 +44,7 @@ export interface Dataset { notes: (typeof schema.fieldNotes.$inferSelect)[]; weather: WeatherDay[]; ocean: OceanDay[]; + chlorophyll: (typeof schema.chlorophyllWeekly.$inferSelect)[]; climate: (typeof schema.climateMonthly.$inferSelect)[]; cyclones: (typeof schema.cyclonePoints.$inferSelect)[]; schoolHolidays: (typeof schema.schoolHolidays.$inferSelect)[]; @@ -97,6 +98,11 @@ export function dataset(): Dataset { notes: db.select().from(schema.fieldNotes).all(), weather: db.select().from(schema.weatherDaily).orderBy(asc(schema.weatherDaily.date)).all(), ocean: db.select().from(schema.oceanDaily).orderBy(asc(schema.oceanDaily.date)).all(), + chlorophyll: db + .select() + .from(schema.chlorophyllWeekly) + .orderBy(asc(schema.chlorophyllWeekly.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(), schoolHolidays: db diff --git a/src/lib/server/db/schema.ts b/src/lib/server/db/schema.ts index cdf5871..3ed1aee 100644 --- a/src/lib/server/db/schema.ts +++ b/src/lib/server/db/schema.ts @@ -97,6 +97,8 @@ export const sets = sqliteTable( sst: real('sst'), sstAnom: real('sst_anom'), dhw: real('dhw'), + // Offshore chlorophyll-a of the satellite week holding the set date, mg m⁻³ (#23). + chl: real('chl'), waveHeight: real('wave_height'), swellHeight: real('swell_height'), oni: real('oni'), @@ -474,6 +476,13 @@ export const oceanDaily = sqliteTable('ocean_daily', { swellMax: real('swell_max') }); +/** Weekly offshore chlorophyll-a around Moorea, NOAA VIIRS (#23). `date` is the week's centre. */ +export const chlorophyllWeekly = sqliteTable('chlorophyll_weekly', { + date: text('date').primaryKey(), + chl: real('chl'), // median of the offshore ring, mg m⁻³ + pixels: integer('pixels').notNull() // cloud-free ring pixels that week +}); + export const tideHourly = sqliteTable('tide_hourly', { ts: text('ts').primaryKey(), mm: real('mm').notNull() diff --git a/src/lib/server/import/external.ts b/src/lib/server/import/external.ts index f6f715f..362e235 100644 --- a/src/lib/server/import/external.ts +++ b/src/lib/server/import/external.ts @@ -32,6 +32,7 @@ export const EXTERNAL_FILES = [ 'weather-daily.csv', 'weather-hourly.csv.gz', 'ocean-daily.csv', + 'chlorophyll-weekly.csv', 'tide-papeete-hourly.csv.gz', 'climate-monthly.csv', 'cyclones.csv', diff --git a/src/lib/server/import/import.test.ts b/src/lib/server/import/import.test.ts index 8802028..f204118 100644 --- a/src/lib/server/import/import.test.ts +++ b/src/lib/server/import/import.test.ts @@ -94,6 +94,20 @@ describe('import of the synthetic fixture', () => { for (const b of d.schoolHolidays) expect(b.start <= b.end).toBe(true); }); + it('loads offshore chlorophyll and joins it to sets (#23)', () => { + // external/ is the committed public satellite snapshot, not synthetic data. + const weeks = d.chlorophyll.filter((w) => w.chl != null); + expect(weeks.length).toBeGreaterThan(500); + // Open South Pacific water: well under 1 mg/m³. Coastal pixels would push this up. + for (const w of weeks) expect(w.chl!).toBeLessThan(0.5); + const set = d.sets.find((s) => s.date && s.chl != null)!; + const t = Date.parse(`${set.date}T00:00:00Z`); + const week = weeks.find( + (w) => Math.abs(Date.parse(`${w.date}T00:00:00Z`) - t) <= 3 * 86_400_000 + ); + expect(set.chl).toBe(week?.chl); + }); + 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 3cfd073..a75aedc 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 = '8'; +export const IMPORTER_VERSION = '9'; const MIGRATIONS = import.meta.glob('/drizzle/*.sql', { query: '?raw', @@ -530,6 +530,16 @@ 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 chlRows = readCsv(opts.externalDir, 'chlorophyll-weekly.csv').filter((r) => r.date); + // Each weekly composite covers its centre date ± 3 days. + const chlByDay = new Map(); + for (const r of chlRows) { + const v = val(r.chl); + if (v == null) continue; + const t = Date.parse(`${r.date}T00:00:00Z`); + for (let k = -3; k <= 3; k++) + chlByDay.set(new Date(t + k * 86_400_000).toISOString().slice(0, 10), v); + } const cyclones = readCsv(opts.externalDir, 'cyclones.csv'); const school = readCsv(opts.externalDir, 'school-holidays.csv'); const tidePts: HourlyPoint[] = readCsv(opts.externalDir, 'tide-papeete-hourly.csv') @@ -635,6 +645,7 @@ export function runImport( sst: val(o?.oisst) ?? val(o?.crw_sst), sstAnom: val(o?.crw_anom), dhw: val(o?.crw_dhw), + chl: chlByDay.get(s.date) ?? null, waveHeight: val(o?.wave_max), swellHeight: val(o?.swell_max), oni: val(climate.get(ymOf(s.date))?.oni), @@ -1010,6 +1021,10 @@ export function runImport( swellMax: val(r.swell_max) })) ); + insert( + schema.chlorophyllWeekly, + chlRows.map((r) => ({ date: r.date, chl: val(r.chl), pixels: val(r.pixels) ?? 0 })) + ); insert( schema.tideHourly, tidePts.map((pt) => ({ @@ -1059,6 +1074,7 @@ export function runImport( external: JSON.stringify({ weather: [...wDaily.keys()].sort().at(-1) ?? null, ocean: [...ocean.keys()].sort().at(-1) ?? null, + chlorophyll: chlRows.at(-1)?.date ?? null, tide: tidePts.length ? new Date(tidePts[tidePts.length - 1].t * 3_600_000).toISOString().slice(0, 10) : null, diff --git a/src/routes/+layout.svelte b/src/routes/+layout.svelte index d29e332..a8ddc68 100644 --- a/src/routes/+layout.svelte +++ b/src/routes/+layout.svelte @@ -205,9 +205,9 @@

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. Cyclones: NOAA - IBTrACS. School holidays: Ministère de l'Éducation nationale (Licence Ouverte 2.0). - Coastline © OpenStreetMap contributors. + Coral Reef Watch via PacIOOS. Chlorophyll: NOAA STAR and CoastWatch (VIIRS). Tides: UHSLC + Papeete gauge. ENSO: NOAA CPC. Cyclones: NOAA IBTrACS. School holidays: Ministère de + l'Éducation nationale (Licence Ouverte 2.0). Coastline © OpenStreetMap contributors.

diff --git a/src/routes/about/+page.svelte b/src/routes/about/+page.svelte index 3e16ff6..2de1e39 100644 --- a/src/routes/about/+page.svelte +++ b/src/routes/about/+page.svelte @@ -49,6 +49,13 @@ Heat stress: NOAA Coral Reef Watch 5 km daily SST anomaly, HotSpot and Degree Heating Weeks, via PacIOOS ERDDAP. +
  • + Chlorophyll-a: NOAA S-NPP VIIRS science-quality weekly composites (4 km), via NOAA CoastWatch + ERDDAP. These data were provided by NOAA's Center for Satellite Applications and Research (STAR) + and the CoastWatch program. Pixels near the coast are unreliable, so each week is the median of + the ocean pixels within 30 km of Mo'orea's centre and at least 10 km from any land or coastal + pixel, Tahiti's included. +
  • Tides: University of Hawaii Sea Level Center fast-delivery hourly sea level, Papeete (station 015). @@ -82,7 +89,7 @@

    Last import {date(data.importedAt)}. Environmental data to {date(data.external.weather)} (weather), {date(data.external.ocean)} - (ocean) and {date(data.external.tide)} (tide). + (ocean), {date(data.external.chlorophyll)} (chlorophyll) and {date(data.external.tide)} (tide).

    diff --git a/src/routes/data-quality/+page.svelte b/src/routes/data-quality/+page.svelte index faf575e..2cd3127 100644 --- a/src/routes/data-quality/+page.svelte +++ b/src/routes/data-quality/+page.svelte @@ -42,7 +42,8 @@

    Environmental data to: weather {date(data.external.weather)}, ocean {date( data.external.ocean - )}, tide {date(data.external.tide)}, climate {data.external.climate ?? '–'}. + )}, chlorophyll {date(data.external.chlorophyll)}, tide {date(data.external.tide)}, climate {data + .external.climate ?? '–'}.

    diff --git a/src/routes/drivers/+page.svelte b/src/routes/drivers/+page.svelte index ad88e00..fd63444 100644 --- a/src/routes/drivers/+page.svelte +++ b/src/routes/drivers/+page.svelte @@ -38,10 +38,10 @@

    Environment

    What drives catches?

    - Every timed gillnet set ({num(data.n)} of them) joined with the sea temperature, heat stress, moon, - tide, weather, waves and El Niño state of that evening. Catch rate (sharks per net-hour) is compared - with each variable using Spearman rank correlation, which copes with the many zero-catch nights - ({pct(data.zero / Math.max(1, data.n))}). + Every timed gillnet set ({num(data.n)} of them) joined with the sea temperature, heat stress, ocean + colour, moon, tide, weather, waves and El Niño state of that evening. Catch rate (sharks per net-hour) + is compared with each variable using Spearman rank correlation, which copes with the many zero-catch + nights ({pct(data.zero / Math.max(1, data.n))}).

    These are single-variable associations: sites, seasons and variables overlap (warm years are diff --git a/src/routes/ocean/+page.server.ts b/src/routes/ocean/+page.server.ts index 66abca9..21ece7b 100644 --- a/src/routes/ocean/+page.server.ts +++ b/src/routes/ocean/+page.server.ts @@ -8,8 +8,14 @@ import { isNeonate, round } from '#lib/server/analytics/common'; -import { linearFit, mean, pairs } from '#lib/stats'; -import { trendText } from '#lib/server/analytics/tests'; +import { linearFit, mean, median, pairs } from '#lib/stats'; +import { + fitText, + groupsText, + rateSlopeText, + rateTest, + trendText +} from '#lib/server/analytics/tests'; import type { PageServerLoad } from './$types'; const toDay = (iso: string) => Math.round(Date.parse(`${iso}T00:00:00Z`) / 86_400_000); @@ -48,6 +54,7 @@ export const load: PageServerLoad = () => return { season, sst: round(mean(sets.map((s) => s.sst)), 2), + chl: round(mean(sets.map((s) => s.chl)), 4), oni: round(mean(sets.map((s) => s.oni)), 2), maxDhwBefore: round(Math.max(0, ...preSummer.map((r) => r.crwDhw ?? 0)), 1), cpue: round(cpueOf(eff.filter((s) => s.season === season))), @@ -84,7 +91,48 @@ export const load: PageServerLoad = () => .map((y) => o.filter((r) => r.date.startsWith(y) && r.crwAnom != null)) .map((rs) => (rs.length >= 300 ? mean(rs.map((r) => r.crwAnom)) : null)); const anomStats = trendText(annual, '°C', 'year'); + + // Offshore chlorophyll-a (#23). The seasonal test uses one median per calendar month and + // year, so a month's weekly values (which follow each other) count once. + const chl = d.chlorophyll.filter((r) => r.chl != null); + const byYm = new Map(); + for (const r of chl) { + const l = byYm.get(r.date.slice(0, 7)); + if (l) l.push(r.chl!); + else byYm.set(r.date.slice(0, 7), [r.chl!]); + } + const chlMonths = months.map((m) => + [...byYm].filter(([ym]) => Number(ym.slice(5)) === m).map(([, v]) => median(v)!) + ); + const chlClim = chlMonths.map((g) => round(median(g), 4)); + const order = months.map((_, i) => i).filter((i) => chlClim[i] != null); + order.sort((a, b) => chlClim[b]! - chlClim[a]!); + const chlCpue = pairs( + seasonRows, + (r) => (r.chl == null ? null : r.chl * 100), + (r) => r.cpue + ); return { + chl: { + series: chl.map((r) => ({ x: toDay(r.date), y: r.chl })), + clim: chlClim, + high: order[0] ?? null, + low: order.at(-1) ?? null, + stats: groupsText(chlMonths, 'calendar months (one median per month and year)'), + cpueStats: [ + fitText(chlCpue, 'sharks/net-hour per 0.01 mg/m³'), + // Set by set, holding nursery and the calendar fixed. Not season: chlorophyll + // varies mostly between seasons, so a season term would absorb it. + rateSlopeText( + rateTest(eff, { valueOf: (s) => s.chl }, 'cpue', ['season']), + 'offshore chlorophyll that week' + ) + ].filter((x): x is string => x != null), + typical: round(median(chl.map((r) => r.chl)), 3), + pixels: Math.max(0, ...chl.map((r) => r.pixels)), + first: chl[0]?.date ?? null, + last: chl.at(-1)?.date ?? null + }, anomStats, bands, sst: weekly(o, (r) => r.oisst ?? r.crwSst), diff --git a/src/routes/ocean/+page.svelte b/src/routes/ocean/+page.svelte index 2593e7f..354b45f 100644 --- a/src/routes/ocean/+page.svelte +++ b/src/routes/ocean/+page.svelte @@ -83,6 +83,47 @@ +

    +

    Ocean colour

    +

    + Chlorophyll-a, the pigment of phytoplankton, is a satellite proxy for how productive the water + is: the base of the food web that ends in the fish the pups eat. Around Mo'orea it is + typically + {num(data.chl.typical, 3)} mg/m³. Pixels beside an island are unreliable (part land, the lagoon + floor showing through, haze off the coast), so each week is the median of up to {num( + data.chl.pixels + )} ocean pixels within 30 km of Mo'orea's centre and at least 10 km from any land or coastal pixel, + Tahiti's included. It describes the ocean around the island, not the water inside the lagoon. +

    +
    + + num(v, 3)} + /> + + + num(v, 3)} + /> + +
    +
    +

    El Niño and the Southern Oscillation

    @@ -128,7 +169,7 @@

    One point per season. With only thirteen seasons, these are hints rather than conclusions.

    -
    +
    + + r.chl != null && r.cpue != null) + .map((r) => ({ x: r.chl!, y: r.cpue!, label: season(r.season) }))} + xLabel="Chlorophyll-a (mg/m³)" + yLabel="Sharks / net-hour" + xFormat={(v) => num(v, 3)} + yFormat={(v) => num(v, 2)} + r={6} + opacity={0.85} + height={240} + /> +
    @@ -202,5 +262,11 @@ /> - {#if data.lastDate}

    Ocean data to {date(data.lastDate)}.

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

    + Ocean data to {date(data.lastDate)}{data.chl.last + ? `; chlorophyll to ${date(data.chl.last)} (science-quality satellite weeks arrive later)` + : ''}. +

    + {/if}