Standardize notebook table-relationship documentation cells

This commit is contained in:
2026-05-22 14:21:51 -07:00
parent c95f22fcdb
commit 03239ad007
9 changed files with 147 additions and 191 deletions

View File

@@ -1184,23 +1184,35 @@
"id": "22",
"metadata": {},
"source": [
"## Tables Created\n",
"## Tables Created by This Notebook and Their Relationships\n",
"\n",
"This notebook creates four PostGIS tables for NOAA HMS smoke exposure analysis. The tables are designed to separate source observations, raw geometries, long-form data-center exposure, and the final per-site summary.\n",
"### Tables Created / Maintained\n",
"1. `public.hms_smoke_days`\n",
"- One row per observed HMS product day (daily denominator table).\n",
"\n",
"| Table | Grain | Purpose |\n",
"|---|---|---|\n",
"| `public.hms_smoke_days` | One row per observed HMS product day | Denominator table for daily percentages, including days with zero smoke polygons. Stores `smoke_date`, source metadata, and `feature_count`. |\n",
"| `public.hms_smoke_daily` | One row per HMS smoke polygon | Raw smoke plume geometry table. Stores `smoke_date`, satellite/time fields, normalized `density`, `density_rank`, source metadata, and `geom`. |\n",
"| `public.data_center_hms_smoke_dc_day` | One row per `(master_id, smoke_date)` | Long-form daily exposure table for every data center on every observed HMS day. `max_density_rank = 0` means observed no smoke; `1`, `2`, and `3` represent light/unspecified, medium, and heavy smoke exposure. |\n",
"| `public.data_center_hms_smoke_exposure` | One row per `master_id` | Final per-data-center summary table joinable to `public.master_data_centers`. Includes location fields, observation status, smoke-period dates, exposure-day counts, percentage metrics, worst/mean density, and longest streak metrics. |\n",
"2. `public.hms_smoke_daily`\n",
"- One row per smoke polygon geometry from HMS source products.\n",
"\n",
"Recommended use:\n",
"3. `public.data_center_hms_smoke_dc_day`\n",
"- One row per `(master_id, smoke_date)` with daily smoke exposure classification.\n",
"\n",
"- Use `public.data_center_hms_smoke_exposure` for most site-level analysis and ranking.\n",
"- Use `public.data_center_hms_smoke_dc_day` for time-series analysis, seasonal summaries, or custom thresholds.\n",
"- Use `public.hms_smoke_daily` when you need the original smoke plume geometries for mapping or spatial QA.\n",
"- Use `public.hms_smoke_days` whenever calculating percentages so no-smoke observed days remain in the denominator."
"4. `public.data_center_hms_smoke_exposure`\n",
"- One row per `master_id` with summary smoke-exposure metrics.\n",
"\n",
"### Key Relationships\n",
"- `public.hms_smoke_days (smoke_date)`\n",
" - 1-to-many -> `public.hms_smoke_daily (smoke_date)`\n",
"\n",
"- `public.master_data_centers (master_id)`\n",
" - 1-to-many -> `public.data_center_hms_smoke_dc_day (master_id, smoke_date)`\n",
" - 1-to-1 (effective) -> `public.data_center_hms_smoke_exposure (master_id)`\n",
"\n",
"- `public.data_center_hms_smoke_dc_day`\n",
" - many-to-1 summary rollup -> `public.data_center_hms_smoke_exposure`\n",
"\n",
"### Rerun Notes\n",
"- Designed for repeat refreshes as additional HMS days become available.\n",
"- Summary exposure table is recomputed from daily source/bridge tables so results stay consistent after reloads."
]
}
],