I have a map in galactic coordinates and I need to save it in equatorial coordinates in another file . I know i can use:
import healpy as hp
map=hp.read_map('file.fits')
map_rot=hp.mollview(map, coord=['G','C'], return_projected_map=True)
and this should return a 2D numpy
array stored in map_rot
. But when I read map_rot
, I found out it is a masked_array filled ONLY with -inf
values, and mask=False
, fill_value=-1.6735e+30
(so, apparently, -inf
is not a mask). Moreover, the total number of elements of map_rot
do not match with the number of pixels I would expect for a map (npix=12*nside**2
). For example if nside=256
I would expect to obtain npix=786432
, while map_rot
has 400*800=320000
elements. What's going on?
(I have already seen this post, but I have a map in polarization, so I need to rotate Stokes' parameters. Since mollview
knows how to do that, I was trying to obtain the new map directly from mollview
. )