build_cell_grid
Build global 0.05° cell grid (v8 sampling unit)
Global ocean 0.05° raster cells in [-180,180] with env covariates + US study-area / Program-Area membership
Reproducible Quarto / R notebooks that ingest marine species distribution models onto a global 0.05° cell grid, merge them per taxon, score marine sensitivity over the US study area, and publish the v8 marine-atlas as partitioned Parquet on S3 (served via titiler + a STAC catalog). Reusable logic lives in the msens R package; these notebooks orchestrate it via targets.
33 pipeline notebooks · generated 2026-08-12 11:33
Build the global 0.05° cell grid — the v8 sampling unit that every model is rasterized onto.
Build global 0.05° cell grid (v8 sampling unit)
Global ocean 0.05° raster cells in [-180,180] with env covariates + US study-area / Program-Area membership
Acquire a source dataset and rasterize it onto the global cell grid as (mdl_key, cell_id, val). Each card's first chip is the data provider.
Ingest AquaMaps → global 0.05° cells (bilinear-weight interpolation)
Ingest BirdLife BOTW → global 0.05° cells (whole range)
Ingest IUCN Red List expert ranges → global 0.05° cells
Ingest NMFS Core Distribution Areas → global 0.05° cells
Ingest NMFS ESA Critical Habitat → global 0.05° cells
Ingest SDMs: NCCOS Atlantic & Pacific Seabird Densities
Seasonal seabird density (#/km²) → suitability [0,100] on the global 0.05° grid
Ingest SDMs: NOAA SEFSC GoMex Cetacean & Sea-Turtle Densities
Monthly hexagon abundance (#/40 km²) → density → suitability [0,100] on the global 0.05° grid
Ingest SWOT + NMFS-DPS sea turtle ranges → global 0.05° cells
Ingest US federal listings → MMPA / MBTA / ESA taxon attributes
Ingest USFWS ESA Critical Habitat → global 0.05° cells
Ingest USFWS species ranges → global 0.05° cells (v7-matched + marine-relevance)
Ingest WoRMS — (re)build the spp.duckdb `worms` table from the monthly marinespecies.org DwC-A
ingest_taxon
Crosswalk each model to a taxon, combine per-taxon models per cell, and derive validity / range / rarity flags.
Build taxon common names — NMFS > FWS > BirdLife > WoRMS (English)
Merge models — combine each taxon's models per cell (max-merge + range mask; turtles ×)
Merge prep — taxon crosswalk (each model → WORMS / BOTW taxon)
Merge taxon metrics — validity flags + range / rarity / endemism / pct_marine
Compute marine-sensitivity metrics per cell and per zone (program areas + ecoregions) over the US study area.
Score cell metrics — extrisk_{spcat} → ecoregion rescale → primprod → composite
Score setup — zones (program areas + ecoregions) + taxon prep
Score zone metrics — program-area composite + v7 equivalence gate
Consolidate the dataset + model registry and support tables the pipeline and apps depend on.
Build the model + dataset registry (`dataset` + `model` tables)
Build the zone-set registry (spatial units as vintages, not per-version copies)
Build zone_cell once per (zone set × grid), not once per release
Freeze a versioned marine-atlas release to S3, build the view-DB + STAC, and publish native serving surfaces.
Backfill a past release into the multi-version atlas
Build app support files — zone gpkgs, layers registry, metrics raster
Build cell_model — the cell-oriented twin of a release's model_cell
Build the version registry (`latest.txt`, `versions.json`, `manifest.json`)
Publish a browsable index for the public bucket (storage.marinesensitivity.org)
Publish a searchable STAC API — per-model Items over stac-geoparquet
Publish native-format input surfaces — range PMTiles + AquaMaps COGs
Publish score surfaces as COGs (retiring the SQL→tile factory)
Release marine-atlas — versioned Parquet → S3, view-DB serving, STAC
The full targets dependency graph (from _targets.R via
msens::build_targets_list()), rendered with
tar_mermaid().
graph LR
style Graph fill:#FFFFFF00,stroke:#000000;
subgraph Graph
direction LR
xa1369084a0260d9c(["score_zone_metrics"]):::score --> xa1e863d483fd328c(["build_app_support"]):::release
x49fc1e0d72360909(["ingest_worms"]):::ingest --> x9497f70f25af06d7(["build_common_names"]):::merge
x49b111dbddc718dd(["merge_taxon"]):::merge --> x9497f70f25af06d7(["build_common_names"]):::merge
x49b111dbddc718dd(["merge_taxon"]):::merge --> x353f9ddf9886075c(["build_registry"]):::schema
x41a1875ace44021e(["build_cell_grid"]):::grid --> x1a1f66f07f9fbe62(["ingest_aquamaps"]):::ingest
x41a1875ace44021e(["build_cell_grid"]):::grid --> x7de1c3460218a5c9(["ingest_birdlife_botw"]):::ingest
x41a1875ace44021e(["build_cell_grid"]):::grid --> x22c2dae0a5579fb1(["ingest_ca_nmfs"]):::ingest
x41a1875ace44021e(["build_cell_grid"]):::grid --> x4dfdc6a38879aeb4(["ingest_ch_fws"]):::ingest
x41a1875ace44021e(["build_cell_grid"]):::grid --> xa04f096eecbe6336(["ingest_ch_nmfs"]):::ingest
x41a1875ace44021e(["build_cell_grid"]):::grid --> x964ed8969f46bd55(["ingest_rng_fws"]):::ingest
x41a1875ace44021e(["build_cell_grid"]):::grid --> xe9b4164e4cddee29(["ingest_rng_iucn"]):::ingest
x41a1875ace44021e(["build_cell_grid"]):::grid --> xcba4944363cebc92(["ingest_turtles_swot_dps"]):::ingest
xaabdb461a9e32014(["merge_models_prep"]):::merge --> x6c4981172b9125c0(["merge_models"]):::merge
x4dfdc6a38879aeb4(["ingest_ch_fws"]):::ingest --> xaabdb461a9e32014(["merge_models_prep"]):::merge
x7de1c3460218a5c9(["ingest_birdlife_botw"]):::ingest --> xaabdb461a9e32014(["merge_models_prep"]):::merge
xe9b4164e4cddee29(["ingest_rng_iucn"]):::ingest --> xaabdb461a9e32014(["merge_models_prep"]):::merge
x1a1f66f07f9fbe62(["ingest_aquamaps"]):::ingest --> xaabdb461a9e32014(["merge_models_prep"]):::merge
xa0ef2b4c4b8deff2(["ingest_listings"]):::ingest --> xaabdb461a9e32014(["merge_models_prep"]):::merge
x22c2dae0a5579fb1(["ingest_ca_nmfs"]):::ingest --> xaabdb461a9e32014(["merge_models_prep"]):::merge
x49fc1e0d72360909(["ingest_worms"]):::ingest --> xaabdb461a9e32014(["merge_models_prep"]):::merge
xa04f096eecbe6336(["ingest_ch_nmfs"]):::ingest --> xaabdb461a9e32014(["merge_models_prep"]):::merge
x964ed8969f46bd55(["ingest_rng_fws"]):::ingest --> xaabdb461a9e32014(["merge_models_prep"]):::merge
xcba4944363cebc92(["ingest_turtles_swot_dps"]):::ingest --> xaabdb461a9e32014(["merge_models_prep"]):::merge
x41a1875ace44021e(["build_cell_grid"]):::grid --> x49b111dbddc718dd(["merge_taxon"]):::merge
x6c4981172b9125c0(["merge_models"]):::merge --> x49b111dbddc718dd(["merge_taxon"]):::merge
x49fc1e0d72360909(["ingest_worms"]):::ingest --> x49b111dbddc718dd(["merge_taxon"]):::merge
x49b111dbddc718dd(["merge_taxon"]):::merge --> xb598afaf51898417(["publish_native"]):::release
x353f9ddf9886075c(["build_registry"]):::schema --> x645366053402e71c(["release_marine_atlas"]):::release
x9497f70f25af06d7(["build_common_names"]):::merge --> x645366053402e71c(["release_marine_atlas"]):::release
xa1369084a0260d9c(["score_zone_metrics"]):::score --> x645366053402e71c(["release_marine_atlas"]):::release
xb598afaf51898417(["publish_native"]):::release --> x645366053402e71c(["release_marine_atlas"]):::release
x484a4524379bfe98(["score_zones"]):::score --> xfb031dbd34cf644a(["score_cell_metrics"]):::score
xfb031dbd34cf644a(["score_cell_metrics"]):::score --> xa1369084a0260d9c(["score_zone_metrics"]):::score
x41a1875ace44021e(["build_cell_grid"]):::grid --> x484a4524379bfe98(["score_zones"]):::score
x49b111dbddc718dd(["merge_taxon"]):::merge --> x484a4524379bfe98(["score_zones"]):::score
end
classDef outdated stroke:#000000,color:#000000,fill:#78B7C5;
classDef uptodate stroke:#000000,color:#ffffff,fill:#354823;
classDef none stroke:#000000,color:#000000,fill:#94a4ac;
classDef grid fill:#845ef7,stroke:#00000066,color:#10161c;
classDef ingest fill:#4dabf7,stroke:#00000066,color:#10161c;
classDef merge fill:#20c997,stroke:#00000066,color:#10161c;
classDef score fill:#fab005,stroke:#00000066,color:#10161c;
classDef schema fill:#e8590c,stroke:#00000066,color:#10161c;
classDef release fill:#f06595,stroke:#00000066,color:#10161c;
classDef outdated fill:#8b98a5,color:#10161c;