calculate_match_template_shift#

sunkit_image.coalignment.calculate_match_template_shift(mc, template=None, layer_index=0, func=<function _default_fmap_function>)[source]#

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

When using this functionality, it is a good idea to check that the shifts that were applied to were reasonable and expected. One way of checking this is to animate the original MapSequence, animate the coaligned MapSequence, and compare the differences you see to the calculated shifts.

Parameters:
  • mc (sunpy.map.MapSequence) – A MapSequence of shape (ny, nx, nt), where nt is the number of layers in the MapSequence.

  • template ({None , Map , numpy.ndarray}, optional) – The template used in the matching. If an ~numpy.ndarray` is passed, the numpy.ndarray has to have two dimensions.

  • layer_index (int, optional) – The template is assumed to refer to the map in the MapSequence indexed by the value of “layer_index”. Displacements of all maps in the MapSequence are assumed to be relative to this layer. The displacements of the template relative to this layer are therefore (0, 0).

  • func (function, optional) – A function which is applied to the data values before the coalignment method is applied. This can be useful in coalignment, because it is sometimes better to co-align on a function of the data rather than the data itself. The calculated shifts are applied to the original data. Examples of useful functions to consider for EUV images are the logarithm or the square root. The function is of the form func = F(data). The default function ensures that the data are floats.