Created
September 13, 2011 21:01
-
-
Save zonca/1215159 to your computer and use it in GitHub Desktop.
example of Mollview hitmap
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import numpy as np | |
import healpy | |
RA = np.random.random(10000)*360 | |
DEC= np.random.random(10000)*135-45 | |
NSIDE = 64 #nside determines the size of the pixels | |
pixels = healpy.ang2pix(NSIDE, np.radians(90-DEC), np.radians(RA)) #NOTE healpy uses colatitude (north pole 0) instead of latitude | |
hitmap = np.ones(healpy.nside2npix(NSIDE)) * healpy.UNSEEN #by convention non hit pixels have a specific value | |
pixels_binned = np.bincount(pixels) | |
hitmap[:len(pixels_binned)] = pixels_binned | |
healpy.mollview(hitmap, xsize=2000) | |
healpy.graticule() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
More info on Healpix pixelization http://healpix.jpl.nasa.gov/html/intro.htm