sunpy/sunpy — pull request #899 by wafels (2014-03-10 18:36:10+00:00)
Title: First cut at a mapcube coalignment algorithm

This PR provides functionality that coaligns the maps in a mapcube to a reference template. The functionality relies on the scikit-image "match_template" function. The template is calculated from a layer in the mapcube. The position of that template on every layer is estimated to sub-pixel accuracy. Each layer in the mapcube is then shifted according to the estimated position of the template. Clipping in the x and y directions of each map layer is implemented so that each layer in the new mapcube has the same size. The meta data 'xcen' and 'ycen' are updated in the new mapcube.

The function "coalign_mapcube" returns a coaligned mapcube and the y pixel and x-pixel shifts used to coalign the cube. Should I instead include new properties in the mapcube object returned by this function that store these shifts?

I have included this function in the util subdirectory as a first suggestion for its location, as some of the functions in here are of more general utility than just mapcube coalignment.

No test code is included just yet - I have a couple of suggested test functions but they have not been implemented.

Comments? Suggestions? Let me know what needs changed.