icecube_tools.point_source_analysis.point_source_analysis module

class icecube_tools.point_source_analysis.point_source_analysis.MapScan(path: str, output_path: str, events: Events | None = None)

Bases: PointSourceAnalysis

Class for performing point source scans of the entire sky or some smaller patches.

apply_cuts()

Apply cuts of energy and dec that are provided in the yaml config. Actual cuts are only applied to displayed data of self.events in terms of masked properties. All data stored in private variables stays in place.

classmethod combine_outputs(*paths, events: Events | None = None)

Wrapper for load_output to load and combine multiple data sets. The task of checking for the correct declination is delegated to the user. #TODO check if check works :param paths: Paths to files whose output should be combined :return: Dict of combined data

config_structure = {'data': {'cuts': {'equator': {'emin': <class 'float'>}, 'max_dec': <class 'float'>, 'min_dec': <class 'float'>, 'northern': {'emin': <class 'float'>}, 'southern': {'emin': <class 'float'>}}, 'likelihood': <class 'str'>, 'periods': <class 'list'>}, 'sources': {'dec': <class 'list'>, 'npix': <class 'int'>, 'nside': <class 'int'>, 'ra': <class 'list'>}, 'ts': {'ntrials': <class 'int'>, 'seed': <class 'int'>}}
generate_sources(nside: bool = True)

Generate sources from config-specified specifics. Provided ra, dec lists take priority over npix and nside. :param nside: If healpy’s nside should be used in calculating test sources.

load_config(path: str)

Load analysis config from file :param path: Path to config file

classmethod load_output(path: str, events: Events | None = None)

Load previously saved hdf5 file :param path: Path to hdf5 file :param events: If provided, create MapScan and return it, else return dict with data

make_p_values(file_base: str) ndarray

Method to load output of MapScanTSDistribution and use it to create p_values from all TS values. :param file_base: str of file names common to all results of MapScanTSDistribution outputs :return: np.ndarray of p_values of shape self.ts.shape

perform_scan(show_progress: bool = False, minos: bool = False)

Perform scan over provided source list whose coordinates are stored in self.ra_test, self.dec_test :param show_progress: True if progress bar should be displayd :param minos: True if additionally Minuit.minos() should be called for calculating errors

write_config(path: str, source_list: bool = False)

Write config used in analysis to file :param path: Path to config file :param source_list: True if source list (ra, dec) should be written to config

write_output(path: str, source_list: bool = False)

Save analysis results to hdf5 and additionally the used config, path is saved in results hdf5. :param path: Path to file :param source_list: True if source list should be written to additionally saved yaml config

class icecube_tools.point_source_analysis.point_source_analysis.MapScanTSDistribution(path: str, output_path: str, events: Events | None = None, bg_sim: bool = False)

Bases: MapScan

Class to create TS distributions (and subsequently local p-values. Inherhits from the ‘normal’ MapScan.

perform_scan(show_progress: bool = False, minos: bool = False)

Perform multiple (ntrials) fits of the same declination. :param show_progress: Bool, if True progress bar is shown, defaults to False :param minos: Bool, if True minos error calculation is carried out, defaults to False

perform_scan_bg_sim(show_progress: bool = False, minos: bool = False)

Perform multiple (ntrials) fits of the same declination. :param show_progress: Bool, if True progress bar is shown, defaults to False :param minos: Bool, if True minos error calculation is carried out, defaults to False

class icecube_tools.point_source_analysis.point_source_analysis.PointSourceAnalysis

Bases: ABC

Meta class

abstract apply_cuts()

Make cuts on loaded data

abstract load_config()
classmethod peek(path: str)

Load previously saved hdf5 file :param path: Path to hdf5 file :param events: If provided, create MapScan and return it, else return dict with data

property which
abstract write_config()
abstract write_output()