align_drizzled_image

grizli.prep.align_drizzled_image(root='', mag_limits=[14, 23], radec=None, NITER=3, clip=20, log=True, outlier_threshold=5, verbose=True, guess=[0.0, 0.0, 0.0, 1], simple=True, rms_limit=2, use_guess=False, triangle_size_limit=[5, 1800], max_sources=200, triangle_ba_max=0.9, max_err_percentile=99, catalog_mask_pad=0.05, min_flux_radius=1.0, min_nexp=2, match_catalog_density=None, assume_close=False, ref_border=100, transform=None, refine_final_niter=8)[source]

Pipeline for astrometric alignment of drizzled image products

  1. Generate source catalog from image mosaics

  2. Trim catalog lists

  3. Find matches and compute (shift, rot, scale) transform

Parameters
rootstr

Image product rootname, passed to make_SEP_catalog

mag_limits(float, float)

AB magnitude limits of objects in the image catalog to use for the alignment

radecstr or (array, array)

Reference catalog positions (ra, dec). If str, will read from a file with np.loadtxt, assuming just two columns

NITERint

Number of matching/transform iterations to perform

clipfloat

If positive, then coordinate arrays will be clipped with clip_lists.

logbool

Write results to wcs.log file and make a diagnostic figure

verbosebool

Print status message to console

guesslist

Initial guess for alignment:

>>> guess = [0., 0., 0., 1]
>>> guess = [xshift, yshift, rot, scale]
use_guessbool

Use the guess

rms_limitfloat

If transform RMS exceeds this threshold, use null [0,0,0,1] transform

simplebool

Parameter for match_lists

outlier_thresholdfloat

Parameter for match_lists

triangle_size_limit(float, float)

Parameter for match_lists

triangle_ba_maxfloat

Parameter for match_lists

max_sourcesint

Maximum number of sources to use for the matches. Triangle matching combinatorics become slow for hundreds of sources

max_err_percentilefloat

Only use sources where weight image is greater than this percentile to try to limit spurious sources in low-weight regions (catalog_mask)

catalog_mask_padfloat

Mask sources outside of this fractional size of the image dimensions to try to limit spurius sources (catalog_mask)

match_catalog_densitybool, None

Try to roughly match the surface density of the reference and target source lists, where the latter is sorted by brightness to try to reduce spurious triangle matches

assume_closebool

not used

ref_borderfloat

Only include reference sources within ref_border pixels of the target image, as calculated from the original image WCS

transformNone, skimage.transform object

Coordinate transformation model. If None, use skimage.transform.EuclideanTransform, i.e., shift & rotation

refine_final_niterint

Number of final alignment iterations to derive the transform from simple nearest neighbor matches after the initial tristars pattern matching

Returns
orig_wcsWCS

Original WCS

drz_wcsWCS

Transformed WCS

out_shift(float, float)

Translation, pixels

out_rotfloat

Rotation (degrees)

out_scalefloat

Scale