create_image_handlers¶
- one_pass_fitting.create_image_handlers(images: list[str], catalogs: list[list] = []) list[ImageHandler]¶
Create a list of
ImageHandler-like objects, to be used for catalog merging.This function takes a list of image filenames and, optionally, a list of corresponding input catalogs. It processes the images and their catalogs, and turns them into ImageHandler-like objects. If no input catalogs are provided, the function will attempt to find them using the
find_catalogsfunction. For more documentation onImageHandler, see thedata_handlerspackage documentation.Parameters:¶
Returns:¶
- list of ImageHandler subclasses
A list of all the
ImageHandlersubclass objects created for the input images and their catalogs
Notes:¶
This function processes a list of images and their corresponding catalogs, and produces a list of ImageHandlers. It first checks if input catalogs are provided; if not, it uses the
find_catalogsfunction to attempt to locate them.find_catalogsrequires the catalogs to be named specifically with the suffix_sci<X>_xyrd.catreplacing the .fits (where <X> corresponds to the number of the science extension, i.e.idny01a1q_flc_sci1_xyrd.catcorresponding to extension `idny01a1q_flc.fits[SCI, 1] )After loading image catalogs into
ImageHandlerobjects, you can apply corrections to the catalogs, such as aperture corrections, if necessary. Then, the corrected catalogs can be combined into a final output catalog usingmerge_catalogs.Example:¶
To create a final catalog from a list of images, you can use this function as follows:
>>> image_files = ["image1.fits", "image2.fits"] # Note how one image can have multiple SCI extensions, and thus multiple catalogs (e.g. WFC3/UVIS) >>> catalogs = [["image1_sci1_xyrd.cat", "image1_sci2_xyrd.cat"], ["image2_sci1_xyrd.cat"]] >>> im_handlers = = create_image_handlers(images=image_files, catalogs=catalogs) >>> final_catalog = merge_catalogs(im_handlers, match_size=0.5)