Visualization ============= The HealPixProjection routines can easily be used to display a full sky map with different projections. In the :mod:`hpproj.visu` module, several projection have been implemented .. plot:: :include-source: import matplotlib.pyplot as plt import numpy as np import healpy as hp from astropy.wcs import WCS from hpproj import mollview # Ring like healpix map nside = 2**6 hp_map = np.arange(hp.nside2npix(nside)) hp_header = {'NSIDE': nside, 'ORDERING': 'RING', 'COORDSYS': 'G'} # Projection of the map and plotting _ = mollview(hp_map, hp_header) fig = plt.figure() ax = fig.add_subplot(1,1,1, projection=WCS(_.header)) ax.imshow(_.data, origin='lower', interpolation='none') ax.grid() ax.set_title('mollview') Note that these maps have a proper :class:`~astropy.wcs.WCS` header and thus can be easily used to overplot markers and artists. Other classical projections have been implemented .. plot:: import matplotlib.pyplot as plt import numpy as np import healpy as hp from astropy.wcs import WCS from hpproj import carview, orthview, \ merview, coeview, bonview, pcoview, tscview # Ring like healpix map nside = 2**6 hp_map = np.arange(hp.nside2npix(nside)) hp_header = {'NSIDE': nside, 'ORDERING': 'RING', 'COORDSYS': 'G'} # Projection of the map and plotting for view in [carview, merview, coeview, bonview, pcoview, tscview]: fig = plt.figure() _ = view(hp_map, hp_header) ax = fig.add_subplot(1,1,1, projection=WCS(_.header)) ax.imshow(_.data, origin='lower', interpolation='none') ax.grid() ax.set_title(view.__name__)