opticam.align
Functions
|
Find the translation that maps reference_coords onto coords. An advantage of this over |
|
Align an image based on some reference coordinates. |
|
Find whether a transform is valid given some transform limits. |
Module Contents
- opticam.align.find_translation(reference_coords, coords)
Find the translation that maps reference_coords onto coords. An advantage of this over astroalign.find_transform() is that it requires fewer sources, however it is therefore more prone to errors. In general, astroalign.find_transform() should be used, but find_translation() is available if there are too few sources for astroalign.find_transform().
Parameters
- reference_coordsNDArray
The reference source coordinates.
- coordsNDArray
The source coordinates.
Returns
- SimilarityTransform
The transformation matrix that maps coords onto reference_coords.
- Parameters:
reference_coords (numpy.typing.NDArray)
coords (numpy.typing.NDArray)
- Return type:
skimage.transform.SimilarityTransform
- opticam.align.align_batch(batch, reference_image_shape, reference_coords, transform_type, rotation_limit, scale_limit, translation_limit, n_alignment_sources, gains, flat_corrector, rebin_factor, remove_cosmic_rays, background, finder, threshold, logger)
Align an image based on some reference coordinates.
Parameters
- file: str
The file path.
- reference_imageNDArray
The reference image.
- reference_coordsNDArray
The source coordinates in the reference image.
- transform_typeLiteral[‘affine’, ‘translation’]
The type of transform to use for image alignment.
- rotation_limitfloat | None
The maximum rotation limit (in degrees) for image alignment.
- scale_limitfloat | None
The maximum scaling limit for image alignment.
- translation_limitList[float] | None
The maximum translation limit for image alignment.
- n_alignment_sourcesint
The (maximum) number of sources to use for image alignment.
Returns
- Tuple[List[float], float, float]
The transform parameters, background median, and background RMS.
- Parameters:
batch (List[str])
reference_image_shape (Tuple[int])
reference_coords (numpy.typing.NDArray)
transform_type (Literal['affine', 'translation'])
rotation_limit (float | None)
scale_limit (float | None)
translation_limit (List[float] | None)
n_alignment_sources (int)
gains (Dict[str, float])
flat_corrector (opticam.correctors.flat_field_corrector.FlatFieldCorrector | None)
rebin_factor (int)
remove_cosmic_rays (bool)
background (opticam.background.global_background.BaseBackground)
finder (opticam.finders.DefaultFinder)
threshold (float | int)
logger (logging.Logger)
- Return type:
Tuple[numpy.typing.NDArray, Dict[str, float], Dict[str, float], Dict[str, float]]
- opticam.align.valid_transform(file, transform, rotation_limit, scale_limit, translation_limit, logger)
Find whether a transform is valid given some transform limits.
Parameters
- filestr
The file being transformed.
- transformSimilarityTransform
The transform.
- rotation_limitfloat | None
The rotation limit.
- scale_limitfloat | None
The scale limit.
- translation_limitList[float] | None
The translation limit.
Returns
- bool
Whether the transform is valid.
- Parameters:
file (str)
transform (skimage.transform.SimilarityTransform)
rotation_limit (float | None)
scale_limit (float | None)
translation_limit (List[float] | None)
logger (logging.Logger)
- Return type:
bool