MarineSensitivity Workflows

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.

36 pipeline notebooks · generated 2026-09-15 11:34

Grid 2

Build the global 0.05° cell grid — the v8 sampling unit that every model is rasterized onto.

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

deps: bootstrap_version
notebook ↗code ↗ ran 2026-09-15 11:32

Ingest 15

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

amAquaMapssuitabilityrasterstatic

Ingest AquaMaps → global 0.05° cells (bilinear-weight interpolation)

deps: build_cell_grid
notebook ↗code ↗ ran 2026-09-15 11:32

ingest_aquax

axAquaXsuitabilityrasterstatic

Ingest AquaX → global 0.05° cells (position-mapped) · supersedes AquaMaps in US waters

v9: 10,536 AquaX ensemble suitability rasters, delivered on the v8 grid and masked to US waters, as dataset `ax`

deps: build_cell_grid, ingest_aquamaps
notebook ↗code ↗ ran 2026-09-15 11:32

ingest_ca_nmfs

ca_nmfsNOAA NMFSrangevectorstatic

Ingest NMFS Core Distribution Areas → global 0.05° cells

deps: build_cell_grid
notebook ↗code ↗ ran 2026-09-15 11:32

ingest_ch_nmfs

ch_nmfsNOAA NMFSrangevectorstatic

Ingest NMFS ESA Critical Habitat → global 0.05° cells

deps: build_cell_grid
notebook ↗code ↗ ran 2026-09-15 11:32

ingest_dps_nmfs

dps_nmfsNOAA NMFSrangevectorstatic

Ingest NMFS listed entities (DPS / ESU / subspecies) → per-cell extinction risk on the global 0.05° grid

From the authoritative NOAA Fisheries critical-habitat service, with the IUCN range as the baseline outside listed DPSs

deps: build_cell_grid, ingest_rng_iucn, ingest_worms
notebook ↗code ↗ ran 2026-09-15 11:32

ingest_sdm_nc

ncNOAA NCCOSdensityrasterseasonal

Ingest SDMs: NCCOS Atlantic & Pacific Seabird Densities

Seasonal seabird density (#/km²) → suitability [0,100] on the global 0.05° grid

deps: build_cell_grid
notebook ↗code ↗ ran 2026-09-15 11:32

ingest_sdm_gm

gmNOAA SEFSCdensityvectormonthly

Ingest SDMs: NOAA SEFSC GoMex Cetacean & Sea-Turtle Densities

Monthly hexagon abundance (#/40 km²) → density → suitability [0,100] on the global 0.05° grid

deps: build_cell_grid
notebook ↗code ↗ ran 2026-09-15 11:32

ingest_ch_fws

ch_fwsUSFWSrangevectorstatic

Ingest USFWS ESA Critical Habitat → global 0.05° cells

deps: build_cell_grid
notebook ↗code ↗ ran 2026-09-15 11:32

ingest_rng_fws

rng_fwsUSFWSrangevectorstatic

Ingest USFWS species ranges → global 0.05° cells (v7-matched + marine-relevance)

deps: build_cell_grid
notebook ↗code ↗ ran 2026-09-15 11:32

ingest_taxon

ingest_taxon

deps: ingest_worms

Merge 4

Crosswalk each model to a taxon, combine per-taxon models per cell, and derive validity / range / rarity flags.

merge_models

Merge models — combine each taxon's models per cell (max-merge + range mask; turtles ×)

deps: merge_models_prep
notebook ↗code ↗ ran 2026-09-15 11:32

merge_models_prep

Merge prep — taxon crosswalk (each model → WORMS / BOTW taxon)

deps: ingest_worms, ingest_aquamaps, ingest_aquax, ingest_dps_nmfs, ingest_rng_iucn, ingest_birdlife_botw, ingest_rng_fws, ingest_ch_nmfs, ingest_ch_fws, ingest_turtles_swot_dps, ingest_ca_nmfs, ingest_listings
notebook ↗code ↗ ran 2026-09-15 11:32

merge_taxon

Merge taxon metrics — validity flags + range / rarity / endemism / pct_marine

deps: merge_models, build_cell_grid, ingest_worms
notebook ↗code ↗ ran 2026-09-15 11:32

Score 3

Compute marine-sensitivity metrics per cell and per zone (program areas + ecoregions) over the US study area.

Registry & schema 3

Consolidate the dataset + model registry and support tables the pipeline and apps depend on.

Release & publish 9

Freeze a versioned marine-atlas release to S3, build the view-DB + STAC, and publish native serving surfaces.

release_marine_atlas

Release marine-atlas — versioned Parquet → S3, view-DB serving, STAC

deps: build_registry, score_zone_metrics, publish_native, build_common_names
notebook ↗code ↗ ran 2026-09-15 11:32

Pipeline DAG

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
    x6e289803328789d0(["build_zone_cells"]):::schema --> x40fe1d171c8eedd0(["backfill_versions"]):::release
    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
    xa1369084a0260d9c(["score_zone_metrics"]):::score --> xf0c53fc856f316ee(["build_version_manifest"]):::release
    x153b773382f144b9(["build_zone_sets"]):::schema --> x6e289803328789d0(["build_zone_cells"]):::schema
    x41a1875ace44021e(["build_cell_grid"]):::grid --> x153b773382f144b9(["build_zone_sets"]):::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
    x22c2dae0a5579fb1(["ingest_ca_nmfs"]):::ingest --> xaabdb461a9e32014(["merge_models_prep"]):::merge
    x1a1f66f07f9fbe62(["ingest_aquamaps"]):::ingest --> xaabdb461a9e32014(["merge_models_prep"]):::merge
    x964ed8969f46bd55(["ingest_rng_fws"]):::ingest --> xaabdb461a9e32014(["merge_models_prep"]):::merge
    x4dfdc6a38879aeb4(["ingest_ch_fws"]):::ingest --> xaabdb461a9e32014(["merge_models_prep"]):::merge
    xa04f096eecbe6336(["ingest_ch_nmfs"]):::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
    xcba4944363cebc92(["ingest_turtles_swot_dps"]):::ingest --> xaabdb461a9e32014(["merge_models_prep"]):::merge
    xa0ef2b4c4b8deff2(["ingest_listings"]):::ingest --> xaabdb461a9e32014(["merge_models_prep"]):::merge
    x49fc1e0d72360909(["ingest_worms"]):::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
    xa1369084a0260d9c(["score_zone_metrics"]):::score --> xc9c4a2b9a8604e0a(["publish_score_cogs"]):::release
    x353f9ddf9886075c(["build_registry"]):::schema --> x68ad2e20742db9ce(["publish_stac_api"]):::release
    x645366053402e71c(["release_marine_atlas"]):::release --> xda6a768e0035397c(["publish_storage_index"]):::release
    xa1369084a0260d9c(["score_zone_metrics"]):::score --> x645366053402e71c(["release_marine_atlas"]):::release
    x9497f70f25af06d7(["build_common_names"]):::merge --> x645366053402e71c(["release_marine_atlas"]):::release
    x353f9ddf9886075c(["build_registry"]):::schema --> 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
    x1cb1e02a9bfc5134(["build_v7_cell_model"]):::release
  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;