SD11
SD11

Reputation: 165

Rotating a healpy(or healpix) map to an arbitrary direction

I have a healpy map that contains an object centered at the location Dec=0 deg and RA=0 deg. Now I want to move the position of the object to an arbitrary point, for instance, Dec=20 deg, RA=10 deg. Is there a simple and precise way of doing the rotation? I red the healpy documentation, but it's still unclear to me how to rotate a map.

Let's say that I have a number array map representing a healpy map. Then can you suggest example codes for the rotation?

Upvotes: 2

Views: 259

Answers (1)

Andrea Zonca
Andrea Zonca

Reputation: 8783

you can use the rotate_map_alms method of hp.Rotator

longitude = 10 * u.deg
latitude = 20 * u.deg
rot_custom = hp.Rotator(rot=[longitude.to_value(u.deg), latitude.to_value(u.deg)], inv=True)
m_smoothed_rotated_alms = rot_custom.rotate_map_alms(m_smoothed)

enter image description here

I wrote a full tutorial on how to rotate maps with healpy based on this

Upvotes: 1

Related Questions