leakagelib_bkg API documentation

This code flags IXPE tracks as background particle or photon, assigning each a “particle character”. The particle character is related to the probability of the particle representing a particle or photon. This documentation describes the python API.

leakagelib_bkg.io module

leakagelib_bkg.io.get_times(f)

Load the times in the file f as an array

leakagelib_bkg.io.write_probs(infile, outfile, bg_probs)

Write probabilities to an output file.

Parameters:
  • infile (str) – Input file name which will be masked.

  • outfile (str) – File to write the probabilities to. If the file already exists, it will be overwritten.

  • mask (array-like of bool) – Boolean array created by get_mask to apply to the input file.

leakagelib_bkg.load_tracks module

leakagelib_bkg.load_tracks.associate_events(l1_times, l2_times)
leakagelib_bkg.load_tracks.load_tracks(hdul, indices)
leakagelib_bkg.load_tracks.process_track(track)

leakagelib_bkg.nn module

class leakagelib_bkg.nn.Model

Bases: object

leakagelib_bkg.nn.account_for_prior(bg_probs)
leakagelib_bkg.nn.load_tensorflow_model()

Get the tensorflow model. This code will fail if your tensorflow is not up to date. The NN was trained with tensorflow version 2.18.0. It should be compatible with many other versions.