merge_catalogs

one_pass_fitting.merge_catalogs(im_handlers, match_size: float = 0.5, ra_key: str = 'RA', dec_key: str = 'Dec', ref_wcs=None) Table

Merge and aggregate multiple catalogs based on their positions in the output frame.

This function merges multiple catalogs of objects by matching their positions in the output frame. It clusters the objects based on their positions and computes aggregate statistics (mean and standard deviation) for each cluster.

Parameters:

im_handlerslist[ImageHandler]

List of ImageHandler subclasses for all the catalogs to be merged

match_sizefloat, optional

The maximum distance that objects within a cluster can be apart, matching threshold.

ra_keystr, optional

The column key for Right Ascension (RA) in the catalog tables.

dec_keystr, optional

The column key for Declination (Dec) in the catalog tables.

Returns:

astropy.table.Table

A table containing the merged and aggregated catalog.

Notes:

  • This function creates an output WCS grid based on WCS’s of the input ImageHandlers

  • It projects all the positions into pixel positions in the output WCS frame

  • Clustering of objects is based on their positions using the separate_and_agglomerate function.

  • The function computes mean and standard deviation values for each cluster.

  • The returned table contains the merged and aggregated catalog.

Example:

>>> ims = ['jwst_image1.fits', 'jwst_image2.fits']
>>> tbls = ['jwst_image1_sci1_xyrd.ecsv', 'jwst_image2_sci1_xyrd.ecsv']
>>> im_handlers = [NIRCamHandler(im, tbl) for im, tbl in zip(ims, tbls)]
>>> match_size = 0.5
>>> merged_catalog = merge_catalogs(im_handlers, match_size)
>>> # `merged_catalog` contains the merged and aggregated catalog.