llama.files.healpix.plotters module

More complex plotting commands for joint events in more human-readable formats, e.g. the GW skymap plots from O2 with their overlaid crosses marking neutrino positions.

class llama.files.healpix.plotters.JointSkymapScatter

Bases: llama.filehandler.FileHandler, llama.files.healpix.skymap.MollviewMixin, llama.filehandler.mixins.FileExtensionMixin

Plot a base skymap but with a scatterplot added on top. This is a bit different from joint skymaps that contain information on pixelwise likelihood products since it is only meant to be a human-readable representation.

The following class attributes must be defined in subclasses, either manually or programmatically (see: FileHandler.set_class_attributes and its implementations in subclasses).

A dictionary mapping TriggerList and HEALPixPSF subclass instances (i.e. pointlike-source lists) to a dict of style properties that can be fed to matplotlib.pyplot.scatterplot as kwargs. In particular, you MUST define marker and color in order to distinguish between different types of sources.

The HEALPixRepresentableFileHandler containing skymaps that should be used as the continuous background (against which point-sources will be plotted).


Return a Mollweide projection of this skymap as a matplotlib figure. Remaining **kwargs are passed to healpy.mollview.

classmethod set_class_attributes(subclass)

See FileHandler.set_class_attributes; this method additionally sets the DEPENDENCIES and FILENAME attributes based on subclass.POINT_SOURCES and subclass.BACKGROUND_SKYMAP.

llama.files.healpix.plotters.add_scatterplot(right_ascensions, declinations, marker='$\\bigodot$', color='green', zorder=1000, **kwargs)

Add a scatterplot to the current HEALpy axis. Useful for plotting neutrinos etc.; remaining kwargs are passed to healpy.projscatter. Returns the current figure.


Get the matplotlib colormap.


Get a matplotlib.patheffects.withStroke effect that outlines text nicely to improve plot readability.

llama.files.healpix.plotters.plot_healpix(skymap, title=None, unit='Probability Density', central_longitude=180, central_latitude=0, rotation_about_center=0, dpi=200, cbar=None, cmap=None, alpha=None, **kwargs)

Plot a healpix skymap in a LLAMA-specific style. Works on skymap objects with a HEALpy-esque mollview method. Returns a figure object for this skymap plot. No colorbar by default. Extra kwargs are passed to skymap.mollview. Define the opacity of the skymap with alpha (must be in [0,1]). In particular, use hold=True to use the current axis for this plot.