sp_validation.galaxy

GALAXY.

Name:

galaxy.py

Description:

This script contains methods to deal with galaxy and star images.

Author:

Martin Kilbinger <martin.kilbinger@cea.fr> Axel Guinot

MASK_COLUMNS = ('MASK_1_Faint_star_halos', 'MASK_2_Bright_star_halos', 'MASK_4_Stars', 'MASK_8_Manual', 'MASK_16_u', 'MASK_32_g', 'MASK_64_r', 'MASK_128_i', 'MASK_256_z', 'MASK_1024_Maximask', 'MASK_2048_z2')

All mask columns written by ShapePipe v2 (bool, True = masked), one per bit of the UNIONS healsparse mask product (grammar.MASK_LABELS; v2 does not write bit 512). Post-processed v1 comprehensive catalogues carry the same columns, presented under these names by sp_validation.grammar.

The r-band default bitmask uses bits 1 (faint star halos), 2 (bright star halos), 4 (star bodies), 8 (manual galaxy mask), 64 (r-band coverage) and 1024 (MaxiMask). The per-band coverage flags are 16 (u), 32 (g), 64 (r), 128 (i) and 256 (HSC z); 2048 is True where Pan-STARRS z-band (z2) coverage is absent.

DEFAULT_MASK_COLUMNS = ('MASK_4_Stars', 'MASK_1_Faint_star_halos', 'MASK_2_Bright_star_halos', 'MASK_8_Manual', 'MASK_64_r', 'MASK_1024_Maximask')

Mask columns OR’d together for the default galaxy selection. This set is the ShapePipe r-band default bitmask: their OR matches mask_r on covered granules (verified on the P3 sky area), with differences at footprint edges without map coverage. Deliberately not a blanket OR over MASK_COLUMNS: the other coverage flags (bits 16, 32, 128, 256) and bit 2048 would mask essentially the whole catalogue.

_column_names(dd)[source]

Return the column names of a structured array or mapping.

mask_cut(dd, mask_columns=None)[source]

Mask Cut.

Return a boolean mask that is True for objects not flagged by any of the requested ShapePipe mask columns.

Parameters:
  • dd (numpy.ndarray or dict) – input catalogue

  • mask_columns (list of str, optional) – mask columns to OR together; default is DEFAULT_MASK_COLUMNS

Returns:

boolean mask, True = keep

Return type:

numpy.ndarray

Raises:

KeyError – if any requested mask column is absent from the catalogue

classification_galaxy_overlap_ra_dec(dd, ra_key='XWIN_WORLD', dec_key='YWIN_WORLD')[source]

Classification Galaxy Overlap Ra Dec.

Return mask corresponding to non-overlapping tile areas using simple cuts in RA and Dec.

Parameters:
  • dd (FITS.record) – input data

  • ra_key (str, optional) – key name for right ascension column, default is ‘XWIN_WORLD’

  • dec_key (str, optional) – key name for declination column, default is ‘YWIN_WORLD’

Returns:

mask where True indicates galaxy to retain, and False being in overlapping region, to remove

Return type:

list of bool

classification_galaxy_base(dd, cut_overlap, gal_mag_bright=20, gal_mag_faint=26, flags_keep=None, n_epoch_min=1, mask_columns=None)[source]

Classification Galaxy Base.

Return mask corresponding to basic classification for galaxies.

Parameters:

mask_columns (list of str, optional) – ShapePipe mask columns OR’d together to reject masked objects; default is DEFAULT_MASK_COLUMNS

classification_galaxy_ngmix(dd, cut_common, stats_file=None, verbose=False)[source]

Classification Galaxy Ngmx.

Return mask corresponding to ngmix classification of galaxies

mask_overlap(ra, dec, tile_id_in, region_file_path, n_jobs=-1)[source]

Mask Overlap.

…