Re: {SunPy} Abridged summary of sunpy@googlegroups.com - 2 updates in 1 topic

22 views
Skip to first unread message

Deb Baker

unread,
Oct 10, 2023, 8:56:23 AM10/10/23
to su...@googlegroups.com

Hi Nabil,

Thank you for clarifying the need to install the sunkit_image library which I have done.  So far, I cannot find an equivalent ‘function’ to sunpy.image.coalignment used in Will’s tutorial.  The code used in the tutorial is as follows:

 

Degrade AIA to EIS resolution:

n_x = (m_aia.scale.axis1 * m_aia.dimensions.x) / m_eis.scale.axis1

n_y = (m_aia.scale.axis2 * m_aia.dimensions.y) / m_eis.scale.axis2

m_aia_r = m_aia.resample(u.Quantity([n_x, n_y]))

 

Compute the shifts:

yshift, xshift = sunpy.image.coalignment.calculate_shift(m_aia_r.data, m_eis.data)

 

Apply the shifts:

reference_coord = m_aia_r.pixel_to_world(xshift, yshift)

Txshift = reference_coord.Tx - m_eis.bottom_left_coord.Tx

Tyshift = reference_coord.Ty - m_eis.bottom_left_coord.Ty

print(Txshift)

print(Tyshift)

m_eis_fixed = m_eis.shift(Txshift, Tyshift)

 

I have tried to use the Gallery example by: from sunkit_image import coalignment then applying to the resampled AIA map and EIS map

coalignment.mapsequence_coalign_by_match_template() in place of sunpy.image.coalignment but it has not worked to get the yshift and xshift.  Is this because I am not doing a map sequence?  Do you have any suggestions to use the sunkit_image module to obtain the shifts?

 

Once again, I appreciate the time and effort from you to help me with Sunpy and Python.

 

Deb

 

 

 

 

 

 

From: su...@googlegroups.com <su...@googlegroups.com>
Date: Tuesday, 10 October 2023 at 04:03
To: Abridged recipients <su...@googlegroups.com>
Subject: {SunPy} Abridged summary of su...@googlegroups.com - 2 updates in 1 topic

·        Co-aligning AIA 193 and EIS Fe XII maps - 2 Updates

Deb Baker <d.bak...@gmail.com>: Oct 09 03:35PM

Hi Will and all,
My code for aligning AIA and EIS maps was based on your Hinode/IRIS tutorial from 2021. Now I see that that sunpy.image.coalignment has been deprecated in favor of
...more

Nabil Freij <nabil...@gmail.com>: Oct 09 11:44AM -0400

Hi Deb,
 
To use sunkit_image, you will need to install it as it's a separate library.
 
You should be able to run: conda install -c conda-forge sunkit_image to get
it. Hopefully I didn't overlook
...more

You received this digest because you're subscribed to updates for this group. You can change your settings on the group membership page.
To unsubscribe from this group and stop receiving emails from it send an email to sunpy+un...@googlegroups.com.

 

Nabil Freij

unread,
Oct 10, 2023, 9:58:06 AM10/10/23
to SunPy
Hi Deb,

I believe the replacement for "calculate_shift" is  "match_template_to_layer", can you see if that works?

Kind regards,
Nabil

Deb Baker

unread,
Oct 11, 2023, 11:32:51 AM10/11/23
to su...@googlegroups.com

Hi Nabil,

I think this is a big step towards getting what I need. Thanks very much.

Deb

 

From: su...@googlegroups.com <su...@googlegroups.com>
Date: Wednesday, 11 October 2023 at 04:04
To: Abridged recipients <su...@googlegroups.com>
Subject: {SunPy} Abridged summary of su...@googlegroups.com - 2 updates in 1 topic

Deb Baker <d.bak...@gmail.com>: Oct 10 12:56PM

Hi Nabil,
Thank you for clarifying the need to install the sunkit_image library which I have done. So far, I cannot find an equivalent ‘function’ to sunpy.image.coalignment used in Will’s
...more

Nabil Freij <nabil...@gmail.com>: Oct 10 06:58AM -0700


Hi Deb,
 
I believe the replacement for "calculate_shift" is "match_template_to_layer",
can you see if that works?
 
Kind regards,
Nabil
 

Reply all
Reply to author
Forward
0 new messages