5.27. align

Aligns the FITS files with the given reference.


FitsArray.align(self, reference: Fits | int = 0, output: str | None = None, max_control_points: int = 50, min_area: int = 5) Self

Aligns the FITS files with the given reference.

Parameters

referenceUnion[Fits, int], default=0

The reference image or the index of the Fits object in the FitsArray to be aligned as a Fits object.

outputOptional[str]

New path to save the files.

max_control_pointsint, default=50

The maximum number of control point sources to find the transformation. See Astroalign documentation for details.

min_areaint, default=5

Minimum number of connected pixels to be considered a source. See Astroalign documentation for details.

Returns

FitsArray

A FitsArray object of aligned images.


5.27.1. Example:

from myraflib import FitsArray, Fits
import math

fa = FitsArray.sample()
fits = Fits.sample()

aligned_fa_1 = fa.align(fits)
aligned_fa_2 = fa.align(0)