Classification

class gdt.missions.fermi.gbm.classification.Classification[source]

Bases: object

Class for calculating source classification probabilities

Methods Summary

bayesian(frame, loc, loc_total_error, ...)

Computes bayesian probabilities for all source classes

classify(trig_alg, frame, loc, ...[, use_loc])

Method to calculate source classification probabilities using information from a trigger.

classify_trigdat(trigdat[, use_loc, verbose])

Convenience method for quickly applying classification method to GBM triggered data.

is_local_particle(trig_rates, bkg_rates)

Check if this is a local particle trigger

is_tgf(trig_alg)

Test if this is a TGF and set the probability array accordingly

rankings()

Returns the list of ranked source classes and probability

set_unreliable_location()

Set the probability array to unreliable location

single_possibility(trig_class)

Set the probability array to a single possibility

sum_channels(arr, low, high)

Sums array values over a given energy channel range

Methods Documentation

bayesian(frame: FermiFrame, loc: tuple, loc_total_error: float, two_det_hardness_ratio: float)[source]

Computes bayesian probabilities for all source classes

Parameters:
  • frame (FermiFrame) – Spacecraft frame at trigger time

  • loc (tuple) – Best-fit source location given as (ra, dec) in degrees

  • loc_total_error (float) – 68% containment (stat + sys) radius for the localization in degrees

  • two_det_hardness_ratio (float) – Average hardness ratio in the closest two detectors

classify(trig_alg: int, frame: FermiFrame, loc: tuple, loc_total_error: float, rates: array, bkg: array, use_loc: bool = False)[source]

Method to calculate source classification probabilities using information from a trigger. Returns the two detectors closest to the source location when use_loc=True, otherwise returns top two detectors with highest rates in energy channels (3, 4)

Parameters:
  • trig_alg (int) – Trigger algorithm number

  • frame (FermiFrame) – Spacecraft frame at the trigger time

  • loc (tuple) – Best-fit source location given as (ra, dec) in degrees

  • loc_total_error (float) – Radius of 68% containment for the localization in degrees

  • rates (np.array) – Detector rates from the latest maxrates data packet

  • bkg (np.array) – Background rates

  • use_loc (bool) – Uses location when True

Returns:

(list)

classify_trigdat(trigdat: Trigdat, use_loc: bool = True, verbose: bool = False)[source]

Convenience method for quickly applying classification method to GBM triggered data.

Parameters:
  • trigdat (Trigdat) – The triggered data object

  • use_loc (bool) – Use location info when True

  • verbose (bool) – Display trigdat info to screen when True

Returns:

(list)

is_local_particle(trig_rates: array, bkg_rates: array)[source]

Check if this is a local particle trigger

Parameters:
  • trig_rates (np.array) – Detector rates in the trigger window

  • bkg_rates (np.array) – Background rates

Returns:

(bool)

is_tgf(trig_alg: int)[source]

Test if this is a TGF and set the probability array accordingly

Parameters:

trig_alg (int) – Trigger algorithm number

Returns:

(bool)

rankings()[source]

Returns the list of ranked source classes and probability

Returns:

(list)

set_unreliable_location()[source]

Set the probability array to unreliable location

single_possibility(trig_class: int)[source]

Set the probability array to a single possibility

Parameters:

trig_class (int) – Index of the source class to assign as the single possibility

sum_channels(arr: array, low: int, high: int)[source]

Sums array values over a given energy channel range

Parameters:
  • arr (np.array) – The array to sum

  • low (int) – Lowest energy channel included in the sum

  • high (int) – Highest energy channel included in the sum

Returns:

(float)