skyllh.plotting.utils package

Submodules

skyllh.plotting.utils.trials module

skyllh.plotting.utils.trials.plot_ns_fit_vs_mean_ns_inj(trials, mean_n_sig_key='mean_n_sig', ns_fit_key='ns', rethist=False, title='', figsize=None, line_color=None, axis_fontsize=16, title_fontsize=16, tick_fontsize=16, xlabel=None, ylabel=None, ylim=None, ratio_ylim=None)

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

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

  • mean_n_sig_key (str) – The name of the key for the mean number of injected signal events in the given trials record array. Default is 'mean_n_sig'.

  • ns_fit_key (str) – The name of the key for the fitted number of signal events in the given trials record array. Default is 'ns'.

  • rethist (bool) – If set to True, the histogram data along with the histogram bin edges will be return as well. Default is False.

  • title (str) – The title of the plot.

  • figsize (tuple | None) – 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 (str | None) – The color of the lines. The default is ‘#E37222’.

  • axis_fontsize (float) – The font size of the axis labels.

  • title_fontsize (float) – The font size of the plot title.

  • tick_fontsize (float) – The font size of the tick labels.

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

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

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

  • ratio_ylim (tuple | None) – 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 (MPL Figure instance) – The created matplotlib Figure instance.

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

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

  • yedges (1d ndarray) – 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, gamma_inj=2, mean_n_sig_key='mean_n_sig', gamma_fit_key='gamma', rethist=False, title='', figsize=None, line_color=None, axis_fontsize=16, title_fontsize=16, tick_fontsize=16, xlabel=None, ylabel=None, ratio_ylim=None)

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

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

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

  • mean_n_sig_key (str) – The name of the key for the mean number of injected signal events in the given trials record array. Default is 'mean_n_sig'.

  • gamma_fit_key (str) – The name of the key for the fitted spectral index in the given trials record array. Default is 'gamma'.

  • rethist (bool) – If set to True, the histogram data along with the histogram bin edges will be return as well. Default is False.

  • title (str) – The title of the plot.

  • figsize (tuple | None) – 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 (str | None) – The color of the lines. The default is ‘#E37222’.

  • axis_fontsize (float) – The font size of the axis labels.

  • title_fontsize (float) – The font size of the plot title.

  • tick_fontsize (float) – The font size of the tick labels.

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

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

  • ratio_ylim (tuple | None) – 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 (MPL Figure instance) – The created matplotlib Figure instance.

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

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

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