pythonmatplotlibplothealpy

Adding tick labels to healpy mollview


I am trying to plot a HEALPix mask using healpy, e.g.:

    import healpy as hp
    import matplotlib
    from pylab import *

    # Read in mask...
    # ...

    # Plot mask
    fig = figure(figsize=(12,8))
    ax = hp.projaxes.HpxMollweideAxes(fig,[0.1,0.1,0.8,0.8],rot=(180.0,0.0,0.0),coord=["C"])
    fig.add_axes(ax)
    ax.projmap(mask,nest=False)
    hp.visufunc.graticule()
    show()

However, I would like to display the RA/Dec (phi/theta) tick labels to the axes. Does anybody know how to do this?

Oh, also, does anybody have python code to plot a HEALPix mask on a hammer projection plot?

Thanks!

Alex


Solution

  • No way to do it right now with healpy

    There is an open issue on healpy about this: https://github.com/healpy/healpy/issues/19.

    An alternative is to plot a map directly using matplotlib:

    https://github.com/zonca/paperplots/blob/master/python/scripts/PlanckFig_map.py