This package implements functions for coaligning image data.

sunkit_image.coalignment Module

This module provides routines for the co-alignment of images and MapSequence objects through both template matching and corrections due to solar rotation.


calculate_shift(this_layer, template)

Calculates the pixel shift required to put the template in the "best" position on a layer.

clip_edges(data, yclips, xclips)

Clips off the "y" and "x" edges of a 2D array according to a list of pixel values.

calculate_clipping(y, x)

Return the upper and lower clipping values for the "y" and "x" directions.

match_template_to_layer(layer, template)

Calculate the correlation array that describes how well the template matches the layer.


Calculate an estimate of the location of the peak of the correlation result in image pixels.


Estimate the location of the maximum of a fit to the input array.


Find the location of the turning point for a parabola y(x) = ax^2 + bx + c, given input values y(-1), y(0), y(1).

check_for_nonfinite_entries(layer_image, ...)

Issue a warning if there is any nonfinite entry in the layer or template images.

apply_shifts(mc, yshift, xshift[, clip])

Apply a set of pixel shifts to a MapSequence, and return a new MapSequence.

mapsequence_coalign_by_match_template(mc[, ...])

Co-register the layers in a MapSequence according to a template taken from that MapSequence.

calculate_match_template_shift(mc[, ...])

Calculate the arcsecond shifts necessary to co-register the layers in a MapSequence according to a template taken from that MapSequence.

calculate_solar_rotate_shift(mc[, layer_index])

Calculate the shift that must be applied to each map contained in a mapsequence in order to compensate for solar rotation.

mapsequence_coalign_by_rotation(mc[, ...])

Move the layers in a mapsequence according to the input shifts.