I have a mask/map as a fits file, downloadable here, and I can plot this mask with healpy using this code:
import healpy as hp
from healpy.newvisufunc import projview, newprojplot
wmap_map_I = hp.read_map('mask.fits')
projview(
wmap_map_I,
graticule=True, graticule_labels=True, xlabel="longitude", ylabel="latitude",
projection_type="mollweide",
coord=["E"],
title="Histogram equalized Ecliptic",
unit="mK",
norm="hist",
min=-1,
max=1,
);
It produces this figure:
What I want to do is split the mask into 2 new masks - one should contain only part A and the other should contain only part B. I don't know how to do this, I thought of making some conditional expression about all points for which longitude + latitude < xyz and then the opposite, but the fits file doesn't contain longitude and latitude.
So how can I split the mask into 2? Thx
I followed EHivon's answer and digged into healpy. I came up with a solution following his/her advice, but first I post 2 solutions that I discovered on the way on my own
The above we can plot like this:
Here is another way to do the split, substitute the last lines above with these:
And the solution suggest by EHivon is below, I actually made a slightly more complicated structure with for demonstration purposes: