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
andHEALPixPSF
subclass instances (i.e. pointlike-source lists) to a dict of style properties that can be fed tomatplotlib.pyplot.scatterplot
as kwargs. In particular, you MUST definemarker
andcolor
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).-
BACKGROUND_SKYMAP
= None¶
-
POINT_SOURCES
= None¶
-
mollview
(**kwargs)¶ Return a Mollweide projection of this skymap as a
matplotlib
figure. Remaining**kwargs
are passed tohealpy.mollview
.
-
classmethod
set_class_attributes
(subclass)¶ See
FileHandler.set_class_attributes
; this method additionally sets theDEPENDENCIES
andFILENAME
attributes based onsubclass.POINT_SOURCES
andsubclass.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 tohealpy.projscatter
. Returns the current figure.
-
llama.files.healpix.plotters.
default_cmap
()¶ Get the matplotlib colormap.
-
llama.files.healpix.plotters.
outline_effect
()¶ 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 toskymap.mollview
. Define the opacity of the skymap withalpha
(must be in [0,1]). In particular, usehold=True
to use the current axis for this plot.