Skip to content

Access gating blocks tributaries based on upstream mainstem barriers #122

@NewGraphEnvironment

Description

@NewGraphEnvironment

Problem

Access gating incorrectly blocks tributaries based on gradient barriers that are upstream on the mainstem, not downstream of the tributary's confluence.

Evidence from ADMS comparison

Cayenne Creek (wscode 100.190442.999098.995997.058910.326444) enters the mainstem (BLK 356362743) at measure 65,641.

Five gradient_15 barriers exist on the mainstem at measures 190,844 to 200,395 — all far upstream of the confluence. These barriers should NOT block access to Cayenne Creek.

But frs_habitat marks all Cayenne Creek segments as accessible = false for CH (15% threshold species).

bcfishpass correctly considers Cayenne Creek fully accessible for CH, with 272 segments and 62.61 km of rearing habitat.

Impact

This is the primary cause of the remaining CH/CO undercount in the ADMS comparison:

Species Habitat fresh bcfishpass diff
CH rearing 94.55 308.23 -69.3%
CO rearing 123.36 351.19 -64.9%

CH/CO use the 15% access threshold (more gradient barriers exist at lower thresholds). Tributaries that join the mainstem below any 15% barrier are incorrectly blocked.

BT (25% threshold) is less affected but likely also impacted (-13%).

Expected behavior

A gradient barrier on the mainstem should only block access to segments that are upstream of the barrier — i.e., on the same blue_line_key at a higher measure, or on a tributary whose confluence is at a higher measure.

The FWA localcode_ltree at the barrier's position determines which tributaries are upstream. A tributary whose wscode branches off below the barrier's localcode is NOT blocked.

How bcfishpass handles this

bcfishpass.barriers_ch_cm_co_pk_sk contains gradient barriers. load_dnstr() indexes downstream barriers per segment using ltree ancestor queries WITH measure comparisons. A barrier is only "downstream" of a segment if it's on the network path from that segment to the ocean.

Relates to NewGraphEnvironment/link#16

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions