Skip to contents

Applies the three tests to every cell of cell and says what happened to it. A cell is kept when its value minus one bootstrap spread clears the taxon's threshold, it is not an extrapolation, and none of its regions was dropped by the regional test. Critical habitat is never trimmed: a critical-habitat cell that fails any test is kept_ch. Every other cell carries the FIRST test it fails, in the order threshold, uncertainty, extrapolation, region:

Usage

range_constrain_sql(
  cell = "og_cell",
  thr = "og_thr",
  region = "og_region",
  verdict = "og_verdict"
)

Arguments

cell, thr, region

table names, as in range_region_sql()

verdict

table taxon, region, verdict (region_effort_test() of the counts)

Value

a SQL string: taxon, cell_id, val, status, keep, one row per row of cell

Details

statusmeaning
keptpasses all three tests
kept_chfails a test, kept as critical habitat
drop_no_thresholdthe taxon has no row in thr (never silently kept)
drop_thresholdval is missing or below the threshold
drop_uncertainval clears the threshold, val - spread does not
drop_extrapolatedoutside the environmental range the model was fitted on
drop_regionin a region whose verdict is 'dropped'

A missing spread counts as 0 and a missing extrap as FALSE: a layer the model run did not produce cannot remove a cell. A cell in no region is judged by tests 1 and 3 alone.