make_jwst_tweakreg_catfile

one_pass_fitting.make_jwst_tweakreg_catfile(images, catalogs, catfile_name='tweakreg_catfile.txt')

Create a catalog file associating images with their corresponding catalogs, for use in JWST TweakRegStep.

Parameters

imageslist of str

List of image filenames.

catalogslist of Table

List of Astropy tables representing the catalogs for each image (catalogs myst be in same order as images).

catfile_namestr, optional

Name of the output catalog file. Default is ‘tweakreg_catfile.txt’.

Returns

catfile_namestr

The name of the created catalog file.

Notes

This function creates a catalog file that associates image filenames with their corresponding catalogs. It writes the catalog file in a format with commented headers. Ensure that the catalogs have columns labeled ‘x’ and ‘y’ containing the PSF fit pixel positons (0 indexed)!

Example

>>> # catalog1 and catalog2 are astropy Tables
>>> catfile = make_catfile(['image1.fits', 'image2.fits'], [catalog1, catalog2], 'my_catfile.txt')
>>> print(f'Created catalog file: {catfile}')