galmex.Flagging_module module

class galmex.Flagging_module.FlaggingHandler(detected_objects, segmentation_map, image=None)[source]

Bases: object

Class to handle flagging of secondary objects in astronomical images.

flag_objects(k_flag=1.5, delta_mag=1, nsec_max=4, r=20)[source]

Evaluate proximity and contamination flags for the main galaxy.

Parameters:
  • k_flag (float) – Multiplicative factor to define flagging ellipse radius.

  • delta_mag (float) – Magnitude threshold to consider a nearby object “bright”.

  • nsec_max (int) – Maximum number of allowed secondary objects nearby.

  • r (float) – Base radius for proximity checks (in pixels).

Returns:

flags – Dictionary with the following keys: - ‘maingalaxy_flag’: 1 if no galaxy found at image center. - ‘edge_flag’: 1 if galaxy is too close to a frame edge. - ‘Nsec_flag’: 1 if too many neighbors within radius. - ‘BrightObj_flag’: 1 if a nearby bright object exists. - ‘rflag_pixels’: radius used for spatial checks. - ‘N_rcheck’: number of sources within radius. - ‘N_deltaMAG’: number of sources within delta magnitude. - ‘normDist_closest’: normalized distance to closest object. - ‘minMAG_diff’: minimum magnitude difference found. - ‘dist_minMAG_diff’: distance to closest bright object.

Return type:

dict