skyllh.core.utils package

Submodules

skyllh.core.utils.multidimgridpdf module

This module contains utility functions for creating and managing MultiDimGridPDF instances.

skyllh.core.utils.multidimgridpdf.get_kde_pdf_sig_spatial_norm_factor_func(log10_psi_name='log10_psi')

Returns the standard normalization factor function for the spatial signal MultiDimGridPDF, which is created from KDE PDF values. It can be used for the norm_factor_func argument of the create_MultiDimGridPDF_from_photosplinetable and create_MultiDimGridPDF_from_kde_pdf function.

Parameters:

log10_psi_name (str) – The name of the event data field for the log10(psi) values.

skyllh.core.utils.multidimgridpdf.get_kde_pdf_bkg_norm_factor_func()

Returns the standard normalization factor function for the background MultiDimGridPDF, which is created from KDE PDF values. It can be used for the norm_factor_func argument of the create_MultiDimGridPDF_from_photosplinetable and create_MultiDimGridPDF_from_kde_pdf function.

skyllh.core.utils.multidimgridpdf.create_MultiDimGridPDF_from_photosplinetable(multidimgridpdf_cls, pmm, ds, data, info_key, splinetable_key, kde_pdf_axis_name_map_key='KDE_PDF_axis_name_map', norm_factor_func=None, cache_pd_values=False, tl=None, **kwargs)

Creates a MultiDimGridPDF instance with pdf values taken from a photospline pdf, i.e. a spline interpolation of KDE PDF values stored in a splinetable on disk.

Parameters:
  • multidimgridpdf_cls (subclass of MultiDimGridPDF) – The MultiDimGridPDF class, which should be used.

  • pmm (instance of ParameterModelMapper) – The instance of ParameterModelMapper, which defines the mapping of global parameters to local model parameters.

  • ds (instance of Dataset) – The instance of Dataset the PDF applies to.

  • data (instance of DatasetData) – The instance of DatasetData that holds the experimental and monte-carlo data of the dataset.

  • info_key (str) – The auxiliary data name for the file containing PDF information.

  • splinetable_key (str) – The auxiliary data name for the name of the file containing the photospline spline table.

  • kde_pdf_axis_name_map_key (str) – The auxiliary data name for the KDE PDF axis name map.

  • norm_factor_func (callable | None) – The function that calculates a possible required normalization factor for the PDF value based on the event properties. For more information about this argument see the documentation of the skyllh.core.pdf.MultiDimGridPDF.__init__() method.

  • cache_pd_values (bool) – Flag if the probability density values should get cached by the MultiDimGridPDF class.

  • tl (instance of TimeLord | None) – The optional instance of TimeLord to use for measuring timing information.

Returns:

pdf (instance of multidimgridpdf_cls) – The created PDF instance of MultiDimGridPDF.

skyllh.core.utils.multidimgridpdf.create_MultiDimGridPDF_from_kde_pdf(multidimgridpdf_cls, pmm, ds, data, numerator_key, denumerator_key=None, kde_pdf_axis_name_map_key='KDE_PDF_axis_name_map', norm_factor_func=None, cache_pd_values=False, tl=None, **kwargs)

Creates a MultiDimGridPDF instance with pdf values taken from KDE PDF values stored in the dataset’s auxiliary data.

Parameters:
  • multidimgridpdf_cls (subclass of MultiDimGridPDF) – The MultiDimGridPDF class, which should be used.

  • pmm (instance of ParameterModelMapper) – The instance of ParameterModelMapper, which defines the mapping of global parameters to local model parameters.

  • ds (instance of Dataset) – The instance of Dataset the PDF applies to.

  • data (instance of DatasetData) – The instance of DatasetData that holds the auxiliary data of the dataset.

  • numerator_key (str) – The auxiliary data name for the PDF numerator array.

  • denumerator_key (str | None) – The auxiliary data name for the PDF denumerator array. This can be None, if no denumerator array is required.

  • kde_pdf_axis_name_map_key (str) – The auxiliary data name for the KDE PDF axis name map.

  • norm_factor_func (callable | None) – The function that calculates a possible required normalization factor for the PDF value based on the event properties. For more information about this argument see the documentation of the skyllh.core.pdf.MultiDimGridPDF.__init__() method.

  • cache_pd_values (bool) – Flag if the probability density values should get cached by the MultiDimGridPDF class.

  • tl (instance of TimeLord | None) – The optional instance of TimeLord to use for measuring timing information.

Returns:

pdf (instance of multidimgridpdf_cls) – The created PDF instance of MultiDimGridPDF.