Cutouts of Active regions

I am trying to get a cutouts of active regions in both AIA data and HMI data. However, the size of image is different for both the images.
Can someone help me with any python function to do so?
I tried t0 use out_hmi = map_hmi.reproject_to(map_aia.wcs)
I am not getting correct output with this.

Can you share the script you’re using to download the data (or links to the data files), the script you’re using to try and reproject the files, and what you think is wrong with the output? Without those it isn’t really possible to work out what is going wrong with your code.

keys_hmi, segments = c.query(‘hmi.M_720s[2013.01.03_01:00:00_TAI]’, key=drms.const.all, seg=‘magnetogram’)
url_hmi = ‘’ + segments.magnetogram[0]
photosphere_full_image = fits.getdata(url_hmi)
header = dict(keys_hmi.iloc[0])
header[‘DATE-OBS’] = keys_hmi.DATE__OBS[0]
header[‘HGLN_OBS’] = 0.0

if (keys_hmi.CROTA2[0] > 5.0):
photosphere_full_image = np.rot90(photosphere_full_image,2)

keys_aia, segments = c.query(‘aia.lev1[2013.01.03_01:00:00_TAI/12s][?WAVELNTH=335?]’, key=drms.const.all, seg=‘image_lev1’)
url_aia = ‘’ + segments.image_lev1[0] # add the suffix to the segment name
chromosphere_image =, cache = False) # download the data
chromosphere_header = dict(keys_aia.iloc[0])
if (keys_aia.CROTA2[0] > 5.0):
chromosphere_image[1].data = np.rot90(chromosphere_image[1].data,2)

from import Map
m = Map(chromosphere_image[1].data, chromosphere_header)
n = Map(photosphere_full_image, header)

The above lines I am using to download the images and to remap them to same size.
However it is neither remapping the images nor plotting them correct. When I tried to plot them, I am getting very weird output. Also the images are not remapped.


I will run this code and see what happens but could you post an example of the output you are getting?


I ran this:

from import fits
from import Map
import drms
import matplotlib.pyplot as plt

drms_client = drms.Client(email="")

keys_hmi, segments = drms_client.query('hmi.M_720s[2013.01.03_01:00:00_TAI]', key=drms.const.all, seg='magnetogram')
url_hmi = '' + segments.magnetogram[0]
hmi_data = fits.getdata(url_hmi)
header = dict(keys_hmi.iloc[0])
header['DATE-OBS'] = keys_hmi.DATE__OBS[0]
header['HGLN_OBS'] = 0.0
hmi_map = Map(hmi_data, header)
# De-rotate HMI
hmi_map = hmi_map.rotate()

keys_aia, segments = drms_client.query('aia.lev1[2013.01.03_01:00:00_TAI/12s][?WAVELNTH=335?]', key=drms.const.all, seg='image_lev1')
url_aia = '' + segments.image_lev1[0]
aia_map = Map(url_aia)



out_hmi = hmi_map.reproject_to(aia_map.wcs)

The HMI before and after plots don’t look that different from a quick glance.

Original HMI Map:

Reproject Map:

The data array is now the same size as AIA now and according to the WCS now has the same CDELTA.

Is this what you are expecting?