AstrometricAlignStep
This step provides absolute astrometric alignment to some external reference catalog, and back-propagates this to the
crf.fits files. It allows for multiple iterations, to get e.g. a rough idea of the shift and then adding in rotation
to improve the solution. We can also inherit solutions from other bands, for e.g. long wavelength MIRI observations
where we find very few point sources so this kind of matching doesn’t work. There is also an option for
cross-correlating the images to try and find a shift, but our testing finds this does not work particularly well and
simply inheriting the tweakreg solutions from a shorter wavelength band works better.
API
- class pjpipe.AstrometricAlignStep(target, bands, progress_dict, target_dir, catalog_dir, step_ext, procs, step_parameters, catalogs=None, align_mapping_mode='shift', align_mapping=None, tweakreg_parameters=None, reproject_func='interp', overwrite=False)[source]
Perform absolute astrometric alignment
There are a number of modes here. The simplest is by matching a catalog of sources, using tweakreg. Alternatively, we can either apply calculated shifts to other mosaics, or attempt to match via cross-correlation.
- Parameters:
target – Target to consider
bands – Bands to consider
catalog_dir – Directory of alignment catalogs
step_ext – .fits extension for the files going into the step
procs – Number of processes to run in parallel
catalogs – Dictionary for the external alignment catalogs
align_mapping_mode – If locking to other JWST image, method to use. Option is “shift” (pull the tweakreg solution from the existing file), or “cross-corr” (do some cross-correlation between the images)
tweakreg_parameters – Dictionary of parameters to pass to tweakreg for the standard alignment
reproject_func – Which reproject function to use. Defaults to ‘interp’, but can also be ‘exact’ or ‘adaptive’
overwrite – Whether to overwrite or not. Defaults to False
- align_to_aligned_image(band, in_dir, align_mapping=None, align_mapping_mode='shift', reproject_func='interp')[source]
Align to a pre-aligned image
This will align to a pre-aligned image, either using cross-correlation or by pulling out the shift values and matrix from tweakreg (default)
- Parameters:
band – Band to consider
in_dir – Input directory
align_mapping – Mapping to use to align to
align_mapping_mode – If locking to other JWST image, method to use. Option is “shift” (pull the tweakreg solution from the existing file), or “cross-corr” (do some cross-correlation between the images)
reproject_func – Which reproject function to use. Defaults to ‘interp’
- do_step()[source]
Run absolute astrometric alignment
- do_step_band(band)[source]
Run absolute astrometric alignment per-band
- Parameters:
band – Band to consider
- move_tweakback_files(files, shift=None, matrix=None, ref_tpwcs=None)[source]
Wrapper to parallelise up tweakback
- Parameters:
files – List of files to tweakback
shift – shift for tweakback. Defaults to None
matrix – rotation/skew matrix. Defaults to None
ref_tpwcs – WCS defining the plane in which the shift/matrix was defined. Defaults to None
- tweakreg_align(band, in_dir, catalogs=None, cat_suffix='cat.ecsv', tweakreg_parameters=None)[source]
Align using tweakreg
- Parameters:
band – Band to consider
in_dir – Input directory
catalogs – Dictionary for the external alignment catalogs
cat_suffix – extension for the existing catalog. Defaults to “cat.ecsv”, which is the pipeline default
tweakreg_parameters – Dictionary of parameters to pass to tweakreg for the standard alignment