galmex.Detection_module module

class galmex.Detection_module.ObjectDetector(galaxy_name, image)[source]

Bases: object

Class to detect objects in astronomical images.

sep_detector(thresh=1.5, minarea=10, deblend_nthresh=32, deblend_cont=0.001, filter_type='matched', bkg_std=0, sub_bkg=False, zp=30)[source]

Detect objects using SEP (Python port of SExtractor algorithms).

Parameters:
  • thresh (float) – Detection threshold in sigma.

  • minarea (int) – Minimum number of contiguous pixels for detection.

  • deblend_nthresh (int) – Number of thresholds for deblending.

  • deblend_cont (float) – Minimum contrast ratio for deblending.

  • filter_type (str) – Type of filter to apply (e.g., ‘matched’).

  • bkg_std (float) – Standard deviation of background noise.

  • sub_bkg (bool) – Whether to subtract background before detection.

Returns:

  • catalog_df (pd.DataFrame) – Catalog of detected objects including flux and magnitudes.

  • segmentation_map (ndarray) – Labeled segmentation map where each object has a unique ID.

sex_detector(sex_folder='./', sex_default='default.sex', sex_keywords=None, sex_output_folder='./', clean_up=True)[source]

Run SExtractor on the image to detect sources and create a segmentation map.

Parameters:
  • sex_folder (str) – Directory containing the SExtractor executable and config files.

  • sex_default (str) – Name of the default .sex configuration file.

  • sex_keywords (dict or None) – Additional keyword parameters for SExtractor.

  • sex_output_folder (str) – Where to save the output catalog and segmentation.

  • clean_up (bool) – Whether to delete temporary files after execution.

Returns:

  • catalog_df (pd.DataFrame) – Table of detected sources with renamed and normalized columns.

  • segmentation_map (ndarray) – Segmentation image created by SExtractor.