How to obtain square maps (smaller patches) from a full sky map in Healpy

Viewed 184

I have a full sky convergence map. I would like to cut from this map, smaller square patches in healpy.

I would like to know how is this possible.

if I read the map and plot it, this is how it looks :

map_kappa_lcdm = hp.read_map('lightcone.fits',nest=False);
import seaborn as sns
color_pal = sns.color_palette("colorblind", 6).as_hex()
fig, (ax1) = plt.subplots(figsize = (17,8),ncols=1)
################
fontsize = 16
plt.rcParams.update({'font.size':fontsize})
cax = hp.mollview(map_kappa_lcdm,title="convergence ($\kappa$) map, $\Lambda$CDM",xsize=4000, 
                  min=-0.02, max=0.025,hold=True,norm="%hist", format="%.01g",cmap='RdBu',cbar=True,nlocs=4)
hp.graticule()
plt.rcParams.update({'font.size':fontsize})

enter image description here

Hereafter I have no idea how I can cut smaller square patches.

2 Answers

You can use hp.gnomview for plotting square patches.

If you want to have a 2D array of a patch of sky, you can set return_projected_map=True in gnomview and that will return it for further processing.

This is what the solution would be, thanks to @Andrea Zonca now we can lop over Ra and Dec (argument = rot[ra, dec]), to get over the full sky

map_cut=hp.gnomview(map_kappa_lcdm,rot=[280.5,32.9],reso=0.8,min=-3e-4,max=3e-4,cmap='RdYlBu_r')

Related