coalign_map#

sunkit_image.coalignment.coalign_map(target_map, reference_map, method='match_template', **kwargs)[source]#

Performs image coalignment using the specified method by updating the metadata of the target map to align it with the reference map.

Note

This function is intended to correct maps with inaccurate metadata. It is not designed to correct for differential rotation or changes in observer location.

Warning

This function is currently only designed to update the reference coordinate metadata based on the translation component of the affine transformation. Changes to the rotation and scale metadata are not currently supported. If you have a use case that requires changes to the rotation or scale metadata please open an issue on the issue tracker.

Note

This function modifies the metadata of the map, not the underlying array data. For adjustments that involve coordinate transformations, consider using reproject_to instead.

Parameters:
  • target_map (sunpy.map.GenericMap) – The map to be coaligned.

  • reference_map (sunpy.map.GenericMap) – The map to which the target map is to be coaligned. It is expected that the pointing data of this map is accurate. For best results, reference_map and target_map should have approximately the same observer location and observation time. For coalignment methods which do not account for different pixel scales or rotations, it is recommended that reference_map and target_map are resampled and/or rotated such that they have the same orientation and plate scale.

  • method ({'match_template', 'phase_cross_correlation'}, optional) – The name of the registered coalignment method to use. Defaults to match_template_coalign.

  • kwargs (dict) – Additional keyword arguments to pass to the registered method.

Returns:

sunpy.map.GenericMap – The coaligned target map with the updated metadata.

Raises:

ValueError – If the specified method is not registered.