Skip to content

Commit

Permalink
Merge pull request #1288 from wafels/coalignment_refactor
Browse files Browse the repository at this point in the history
Coalignment functionality refactor
  • Loading branch information
Cadair committed Mar 16, 2015
2 parents 200a74f + ba8cd48 commit 5ac67a9
Show file tree
Hide file tree
Showing 4 changed files with 421 additions and 230 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ Latest
* `sunpy.cm.get_cmap` no longer defaults to 'sdoaia94'
* Added database url config setting to be setup by default as a sqlite database in the sunpy working directory
* Added a few tests for the sunpy.roi module
* Refactored mapcube co-alignment functionality.
* Removed sample data from distribution and added ability to download sample files

0.5.0
Expand Down
16 changes: 14 additions & 2 deletions doc/source/guide/data_types/maps.rst
Original file line number Diff line number Diff line change
Expand Up @@ -221,16 +221,28 @@ features in your representative template.
SunPy provides a function to coalign mapcubes. The implementation of this
functionality requires the installation of the scikit-image library, a
commonly used image processing library. To coalign a mapcube, simply import
the function and apply it to yout mapcube::
the function and apply it to your mapcube::

from sunpy.image.coalignment import mapcube_coalign_by_match_template
coaligned = mapcube_coalign_by_match_template(mc)

This will return a new mapcube, coaligned to a template extracted from the
center of the first map in the mapcube, with the map dimensions clipped as
required. The coalignment algorithm provides many more options for handling
the coalignment of mapcubes; type::
the coalignment of mapcubes type::

help(mapcube_coalign_by_match_template)

for a full list of options and functionality.

If you just want to calculate the shifts required to compensate for solar
rotation relative to the first map in the mapcube without applying them, use::

from sunpy.image.coalignment import calculate_match_template_shift
shifts = calculate_match_template_shift(mc)

This is the function used to calculate the shifts in mapcube coalignment
function above. Please consult its docstring to learn more about its features.
Shifts calculated using calculate_match_template_shift can be passed directly
to mapcube coalignment function.

0 comments on commit 5ac67a9

Please sign in to comment.