Skip to contents

SQL computing the per-taxon mass-preserving factor of a folded-in density survey

Usage

density_cal_factors_sql(dens = "dens_vals", replaced = "dens_replaced")

Arguments

dens

character; a relation (ms_merge_key, cell_id, val) of the survey values (the annual density models' rows of the density taxa, after the ingest's 0-100 transform).

replaced

character; a relation (ms_merge_key, cell_id, val) of what the survey replaces on those cells: the suitability (max over AquaMaps / AquaX models) where one existed, else the taxon's governing er_score where a range dataset covered the cell. Cells absent from it had no prior value.

Value

SQL selecting ms_merge_key, n_dom, n_prior, mean_prior, mean_dens, f, calibrated – f is the factor (1 when n_prior = 0), calibrated FALSE for such a taxon.