skyllh.plotting.utils package

Submodules

skyllh.plotting.utils.trials module

skyllh.plotting.utils.trials.plot_ns_fit_vs_mean_ns_inj(trials: ndarray, mean_n_sig_key: str = 'mean_n_sig', ns_fit_key: str = 'ns', rethist: bool = False, title: str = '', figsize: tuple | None = None, line_color: str | None = None, axis_fontsize: float = 16, title_fontsize: float = 16, tick_fontsize: float = 16, xlabel: str | None = None, ylabel: str | None = None, ylim: tuple | None = None, ratio_ylim: tuple | None = None) tuple[Figure, ndarray, ndarray, ndarray] | Figure

Creates a 2D histogram plot showing the fit number of signal events vs. the mean number of injected signal events.

Parameters:
  • trials – The record array holding the results of the trials.

  • mean_n_sig_key – The name of the key for the mean number of injected signal events in the given trials record array.

  • ns_fit_key – The name of the key for the fitted number of signal events in the given trials record array.

  • rethist – If set to True, the histogram data along with the histogram bin edges will be return as well.

  • title – The title of the plot.

  • figsize – The two-element tuple (width,height) specifying the size of the figure. If set to None, the default size (12,10) will be used.

  • line_color – The color of the lines. The default is ‘#E37222’.

  • axis_fontsize – The font size of the axis labels.

  • title_fontsize – The font size of the plot title.

  • tick_fontsize – The font size of the tick labels.

  • xlabel – The label of the x-axis in math syntax. Default is r'<n>_{\mathrm{sig,inj}}}'.

  • ylabel – The label of if y-axis in math syntax. Default is r'n_\mathrm{sig,fit}'.

  • ylim – The (low,high)-two-element tuple specifying the y-axis limits of the main plot.

  • ratio_ylim – The (low,high)-two-element tuple specifying the y-axis limits of the ratio plot in percentage. If set to None, the default (-100,100) will be used.

Returns:

  • fig – The created matplotlib Figure instance.

  • hist – The histogram bin content. This will only be returned, when the rethist argument was set to True.

  • xedges – The histogram x-axis bin edges. This will only be returned, when the rethist argument was set to True.

  • yedges – The histogram y-axis bin edges. This will only be returned, when the rethist argument was set to True.

skyllh.plotting.utils.trials.plot_gamma_fit_vs_mean_ns_inj(trials: ndarray, gamma_inj: float = 2, mean_n_sig_key: str = 'mean_n_sig', gamma_fit_key: str = 'gamma', rethist: bool = False, title: str = '', figsize: tuple | None = None, line_color: str | None = None, axis_fontsize: float = 16, title_fontsize: float = 16, tick_fontsize: float = 16, xlabel: str | None = None, ylabel: str | None = None, ratio_ylim: tuple | None = None) tuple[Figure, ndarray, ndarray, ndarray] | Figure

Creates a 2D histogram plot showing the fit spectral index gamma vs. the mean number of injected signal events.

Parameters:
  • trials – The record array holding the results of the trials.

  • gamma_inj – The spectral index with which signal events got injected into tha trial data set.

  • mean_n_sig_key – The name of the key for the mean number of injected signal events in the given trials record array.

  • gamma_fit_key – The name of the key for the fitted spectral index in the given trials record array.

  • rethist – If set to True, the histogram data along with the histogram bin edges will be return as well.

  • title – The title of the plot.

  • figsize – The two-element tuple (width,height) specifying the size of the figure. If set to None, the default size (12,10) will be used.

  • line_color – The color of the lines. The default is ‘#E37222’.

  • axis_fontsize – The font size of the axis labels.

  • title_fontsize – The font size of the plot title.

  • tick_fontsize – The font size of the tick labels.

  • xlabel – The label of the x-axis in math syntax. Default is r'<n>_{\mathrm{sig,inj}}}'.

  • ylabel – The label of if y-axis in math syntax. Default is r'\gamma_\mathrm{fit}'.

  • ratio_ylim – The (low,high)-two-element tuple specifying the y-axis limits of the ratio plot in percentage. If set to None, the default (-100,100) will be used.

Returns:

  • fig – The created matplotlib Figure instance.

  • hist – The histogram bin content. This will only be returned, when the rethist argument was set to True.

  • xedges – The histogram x-axis bin edges. This will only be returned, when the rethist argument was set to True.

  • yedges – The histogram y-axis bin edges. This will only be returned, when the rethist argument was set to True.