What we want to do here is to do a plotting of the Stripe82 region. For such, we need to

  1. define the sky coordinates of the Stripe
  2. prepare a canvas in a proper projection for the sky
    • in astronomy people seem to use the 'mollweide' projection. I prefer the 'hammer' projection
  3. draw our points --actually, it should be rectangular region (i.e, a stripe)-- over the projection

In [2]:
# Sky coordinates (limits) for stripe82
ra_deg = [-50,60]
dec_deg = [-1.25,1.25]

# Let's define the limits for our plot also
#ra_lim = [-90,90]
#dec_lim = [-3,3]

In [27]:
# Let's do it now with the Healpix python wrapper (Healpy)
%matplotlib inline
import matplotlib.pyplot as plt
import healpy as hp
import numpy as np

NSIDE=64
mapp = np.arange(hp.nside2npix(NSIDE))

hp.mollview(mapp,nest=True)
plt.savefig('moc_healpy_nest_full.svg')
hp.graticule()


0.0 180.0 -180.0 180.0
The interval between parallels is 30 deg -0.00'.
The interval between meridians is 30 deg -0.00'.

In [26]:
plt.cla()
plt.clf()

import healpy as hp
import random
import numpy as np

NSIDE=64
npix = hp.nside2npix(NSIDE)
mapp = np.arange(npix)

pix_min = random.randint(0,npix)
pix_max = random.randint(pix_min,npix)
mask = np.zeros(mapp.shape).astype(bool)
mask[pix_min:pix_max] = 1

mapp[~mask] = 0

hp.mollview(mapp,nest=True)
plt.savefig('moc_healpy_nest_maskrandom.svg')
hp.graticule()


0.0 180.0 -180.0 180.0
The interval between parallels is 30 deg -0.00'.
The interval between meridians is 30 deg -0.00'.
<matplotlib.figure.Figure at 0x11071c410>

In [ ]: