SunPy image

sunpy.image Package

sunpy.image.rescale Module

Image resampling methods


resample(orig, dimensions[, method, center, ...]) Returns a new numpy.ndarray that has been resampled up or down.
reshape_image_to_4d_superpixel(img, ...) Re-shape the two dimension input image into a a four dimensional array whose first and third dimensions express the number of original pixels in the x and y directions that form one superpixel.

sunpy.image.transform Module

Functions for geometrical image transformation and warping.


affine_transform(image, rmatrix[, order, ...]) Rotates, shifts and scales an image using skimage.transform.warp(), or scipy.ndimage.interpolation.affine_transform() if specified.

sunpy.image.coalignment Module

This module provides routines for the coalignment of images and mapcubes.

Currently this module provides image coalignment by template matching. Which is partially inspired by the SSWIDL routine

In this implementation, the template matching is handled via the scikit-image routine skimage.feature.match_template().


Template matching algorithm:


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.
find_best_match_location(corr) Calculate an estimate of the location of the peak of the correlation result in image pixels.
get_correlation_shifts(array) Estimate the location of the maximum of a fit to the input array.
parabolic_turning_point(y) 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).
repair_image_nonfinite(image) Return a new image in which all the nonfinite entries of the original image have been replaced by the local mean.
apply_shifts(mc, yshift, xshift[, clip]) Apply a set of pixel shifts to a MapCube, and return a new MapCube.
mapcube_coalign_by_match_template(mc[, ...]) Co-register the layers in a MapCube according to a template taken from that MapCube.
calculate_match_template_shift(mc[, ...]) Calculate the arcsecond shifts necessary to co-register the layers in a MapCube according to a template taken from that MapCube.