2

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?

SD11
  • 165
  • 1
  • 7

1 Answers1

1

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

Andrea Zonca
  • 8,378
  • 9
  • 42
  • 70