0

I would like to understand a bit better the behavior of rotate_map_pixel() in this particular case. Below I try to provide a minimal toy example:

map = hp.ma(hp.read_map(mapFile))
map.mask = np.logical_not(hp.read_map(maskFile))
rot = hp.Rotator(coord=['G','C'])
map = rot.rotate_map_pixel(map)
mask = hp.read_map(maskFile)
mask = rot.rotate_map_pixel(mask)

This produces a slightly different map.mask and mask. By "different", I mean

skycut = np.where(map.mask[obj_pix]==False))

and

skycut = np.where(mask[obj_pix]==1.)

or

skycut = np.where(np.isclose(mask[obj_pix],1.))

all produce different skycut. I'd guess this is due to the interpolation procedure?

If I wish to use the mask for selection purpose, what should I do?

1 Answer 1

1

If you display the 2 masks, you can see that in one case the mask is a float, in the other case it is a boolean.

Now one case healpy fills the map with UNSEEN and then interpolation is handled by HEALPix C++. I don't know how internally HEALPix handles that. In the other case we pass a map of 0 and 1 and HEALPix does the interpolation, but we don't trigger any special case of handling UNSEEN values.

See https://zonca.dev/2021/06/healpy-rotate-mask.html a full notebook investigating that.

I find out experimentally that if I round the mask with a number very close to 1 I find the same mask.

enter image description here

enter image description here

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.