sp_validation.catalog_builders¶
CATALOG BUILDERS.
Catalogue construction pipeline — the runner classes that create, mask, and
calibrate joint comprehensive catalogues, plus the run_* entry-point
functions. Built on the catalogue data layer in catalog (imported here as
sp_cat), which supplies the read/write/column-access/matching primitives.
- Author:
Martin Kilbinger
- class Mask(col_name, label, kind=None, value=0, col_name2=None, dat=None, verbose=False)[source]¶
Bases:
objectMask.
Class to handle masking of catalogues.
- Parameters:
col_name (str) – name of column to use for mask
label (str) – mask label
kind (str) – operation type; see
apply_condition()for the allowed values, plus “not_equal_2bands”, which keeps objects whose value differs fromvalueincol_nameorcol_name2(two-band OR)value (float or list) – value(s) to be used in mask operation
col_name2 (str, optional) – name of second column; required for (and only used by) kind “not_equal_2bands”
dat (numpy.ndarray, optional) – input data, default is None; apply mask if given
verbose (bool, optional) – verbose output if
True; default isFalse
- get_masks_from_config(config, dat, masks_to_apply=None, verbose=False)[source]¶
Get Masks From Config.
Return the masks of the config’s
datcut list (catalogue_cuts), evaluated ondat.- Parameters:
config (dict) – config information
dat (numpy.ndarray or grammar.V2View) – input catalogue, in the v2 column grammar (e.g. from
CalibrateCat.read_cat)masks_to_apply (list, optional) – masks to apply exclusively; if None (default), use all masks
verbose (bool, optional) – verbose output if
True; default isFalse
- Returns:
list – list of masks
dict – list of indices for given mask column name (label)