Compensating for Solar Rotation in MapSequences

Often a set of solar image data consists of fixing the pointing of a field of view for some time and observing. Features on the Sun will differentially rotate depending on latitude, with features at the equator moving faster than features at the poles.

In this example, the process of shifting images in a MapSequence to account for the differential rotation of the Sun is demonstrated using the mapsequence_coalign_by_rotation() function.

import matplotlib.pyplot as plt

import sunpy.data.sample
from sunpy.map import Map

from sunkit_image import coalignment

First, create a MapSequence with sample data.

mc = Map(
    [
        sunpy.data.sample.AIA_193_CUTOUT01_IMAGE,
        sunpy.data.sample.AIA_193_CUTOUT02_IMAGE,
        sunpy.data.sample.AIA_193_CUTOUT03_IMAGE,
        sunpy.data.sample.AIA_193_CUTOUT04_IMAGE,
        sunpy.data.sample.AIA_193_CUTOUT05_IMAGE,
    ],
    sequence=True,
)
Files Downloaded:   0%|          | 0/1 [00:00<?, ?file/s]

AIA20110607_063307_0193_cutout.fits:   0%|          | 0.00/1.45M [00:00<?, ?B/s]

AIA20110607_063307_0193_cutout.fits:  34%|###3      | 485k/1.45M [00:00<00:00, 4.84MB/s]


Files Downloaded: 100%|##########| 1/1 [00:00<00:00,  4.30file/s]
Files Downloaded: 100%|##########| 1/1 [00:00<00:00,  4.28file/s]

Files Downloaded:   0%|          | 0/1 [00:00<?, ?file/s]

AIA20110607_063931_0193_cutout.fits:   0%|          | 0.00/1.45M [00:00<?, ?B/s]

AIA20110607_063931_0193_cutout.fits:  38%|###8      | 553k/1.45M [00:00<00:00, 5.47MB/s]


Files Downloaded: 100%|##########| 1/1 [00:00<00:00,  3.83file/s]
Files Downloaded: 100%|##########| 1/1 [00:00<00:00,  3.82file/s]

Files Downloaded:   0%|          | 0/1 [00:00<?, ?file/s]

AIA20110607_064555_0193_cutout.fits:   0%|          | 0.00/1.45M [00:00<?, ?B/s]

AIA20110607_064555_0193_cutout.fits:  31%|###1      | 454k/1.45M [00:00<00:00, 4.52MB/s]


Files Downloaded: 100%|##########| 1/1 [00:00<00:00,  4.70file/s]
Files Downloaded: 100%|##########| 1/1 [00:00<00:00,  4.68file/s]

Files Downloaded:   0%|          | 0/1 [00:00<?, ?file/s]

AIA20110607_065219_0193_cutout.fits:   0%|          | 0.00/1.46M [00:00<?, ?B/s]

AIA20110607_065219_0193_cutout.fits:  34%|###3      | 489k/1.46M [00:00<00:00, 4.89MB/s]


Files Downloaded: 100%|##########| 1/1 [00:00<00:00,  3.77file/s]
Files Downloaded: 100%|##########| 1/1 [00:00<00:00,  3.76file/s]

Files Downloaded:   0%|          | 0/1 [00:00<?, ?file/s]

AIA20110607_065843_0193_cutout.fits:   0%|          | 0.00/1.45M [00:00<?, ?B/s]

AIA20110607_065843_0193_cutout.fits:   7%|6         | 95.5k/1.45M [00:00<00:01, 954kB/s]


Files Downloaded: 100%|##########| 1/1 [00:00<00:00,  4.16file/s]
Files Downloaded: 100%|##########| 1/1 [00:00<00:00,  4.15file/s]

Let’s plot the MapSequence so we can later compare it with the shifted result.

plt.figure()
anim = mc.plot()
plt.show()
AIA $193 \; \mathrm{\mathring{A}}$ 2011-06-07 06:33:07

The mapsequence_coalign_by_rotation() function can be applied to the Map Sequence

derotated = coalignment.mapsequence_coalign_by_rotation(mc)

By default, the de-rotation shifts are calculated relative to the first map in the MapSequence. This function does not differentially rotate the image (see Differentially rotating a map for an example). It is useful for de-rotating images when the effects of differential rotation in the MapSequence can be ignored.

See the docstring of mapsequence_coalign_by_rotation() for more features of the function.

To check that the applied shifts were reasonable, plot an animation of the shifted MapSequence to compare with the original plot above.

plt.figure()
anim_derotate = derotated.plot()
plt.show()
AIA $193 \; \mathrm{\mathring{A}}$ 2011-06-07 06:33:07

The de-rotation shifts used in the above function can be calculated without applying them using the calculate_solar_rotate_shift() function.

shifts = coalignment.calculate_solar_rotate_shift(mc)

The calculated shifts can be passed as an argument to mapsequence_coalign_by_rotation().

Total running time of the script: ( 0 minutes 3.895 seconds)

Gallery generated by Sphinx-Gallery