AI Decision System
Replayable, offline-verifiable records for AI-assisted go/no-go decisions: experiment promotions, typed model answers and human-approved actions.
스트림 네트워크 입력을 서식별 서식지 분류로 해석하는 실험적 도구, Fresh와 연동, 개발 중
Experimental tooling for interpreting field and modelled inputs as per-segment habitat classifications on stream networks. Pairs with fresh. Under active development; APIs and outputs change without n
개발 도구R · ShellGitHub @NewGraphEnvironment온라인운영자 미확인
써 보셨어요? 한 번만 눌러 주세요. 로그인은 필요 없어요.
Stream-network habitat interpretation: load evidence, snap to network, resolve per-species barrier connectivity, reproduce bcfishpass on BC's Freshwater Atlas. Pairs with fresh.
저장소 README에서 가져옴
README 전체를 불러오는 중입니다. 아래는 저장된 발췌입니다.
An interpretation layer between field/modelled evidence and stream-network habitat modelling. Loads override CSVs through a canonical schema, snaps points to the network, matches records across data systems, resolves per-species barrier connectivity from observations and confirmations, and orchestrates a multi-phase pipeline that produces per-segment habitat outputs. Pairs with fresh for the modelling engine. Currently reproduces bcfishpass's fish-passage classification method on BC's Freshwater Atlas; interpretation logic is network-agnostic by design.README 전문 보기 ↗Develop, test and communicate intrinsic habitat and connectivity models for the BC Freshwater Atlas stream network
link is a tool for building models of where each fish species could spawn and rear on a stream network, and which of that habitat fish can reach. Current models rate habitat from stream gradient, channel width and discharge, resolve access past natural barriers such as falls and steep gradients, and record the road and rail crossings and dams that sit below. Its value is flexibility: every rule and threshold is a row in a config, so a model can be changed, run beside another, checked against fish observations and traced back to the rules that produced it.
Arctic grayling habitat in the Parsnip River watershed group. Purple reaches drain to Williston Reservoir behind the W.A.C. Bennett Dam. Orange and red reaches sit above a road or rail crossing that is a barrier. Grey reaches lie above a natural barrier to grayling.
pak::pak("NewGraphEnvironment/link")
link is under active development and its functions change between releases (see NEWS). Pin a release for reproducible work: pak::pak("NewGraphEnvironment/[email protected]").
link runs against a PostgreSQL database holding the BC Freshwater Atlas through fwapg, set up as for fresh.
A model is a config, and its rules are tables you can read and edit:
library(link)
cfg <- lnk_config("default")
loaded <- lnk_load_overrides(cfg)
th <- loaded$parameters_habitat_thresholds
th[th$species_code %in% c("BT", "GR"),
c("species_code", "spawn_gradient_max", "spawn_channel_width_min",
"rear_gradient_max", "rear_channel_width_min")]
#> species_code spawn_gradient_max spawn_channel_width_min rear_gradient_max rear_channel_width_min
#> 1 BT 0.0549 2 0.1049 1.5
#> 2 GR 0.0249 4 0.0349 1.5
Run it for a watershed group, then sum the habitat each species can reach:
conn <- lnk_db_conn()
cfg$pipeline$schema <- "fresh_default"
lnk_pipeline_run(conn, aoi = "PARS", cfg = cfg, loaded = loaded,
mapping_code = TRUE)
lnk_rollup_wsg(conn, aoi = "PARS", species = c("BT", "GR"),
schema = "fresh_default")
#> wsg species accessible_km spawning_km rearing_km rearing_lake_connection_km
#> 1 PARS BT 6883.03 1685.38 2635.01 0
#> 2 PARS GR 4442.31 983.86 1366.32 0
Change a threshold, run again, and compare. Each run records its inputs, its parameters and the source versions its data was loaded from, in log tables beside its results.
| Package | Role |
|---|---|
| link | Intrinsic habitat models: develop, test and communicate (this package) |
| fresh | Stream network modelling engine: segment, classify, cluster, aggregate |
| wet | Stream flow and water temperature for BC's Freshwater Atlas |
| gq | Shared map symbology |
link's access model follows the method of bcfishpass, built by Simon Norris and maintained with contributions from many groups. link also reads bcfishpass's community-maintained corrections to crossings, barriers and habitat, synced weekly into the default and bcfishpass configs so they stay in one place. A bcfishpass config applies bcfishpass's own rules, so results can be checked against the method they come from. Fish observations come from bcfishobs, and the stream network from fwapg and the BC Freshwater Atlas.
citation("link")
MIT (see LICENSE). Redistributed bcfishpass data carries its own license: see NOTICE.md and LICENSE-bcfishpass.