llama.files.fermi_grb module

Defines a FileHandler for generating lists of GRBs for an LVC GW trigger (or another trigger at a given time) as well as methods for obtaining historical GRB events from stored lists.

class llama.files.fermi_grb.FermiGRBsJSON

Bases: llama.filehandler.JSONFile, llama.files.healpix.skymap.HEALPixPSF

digraph "llama.files.fermi_grb.FermiGRBsJSON" { charset="utf-8" splines=ortho bgcolor=none margin=0 rankdir=LR "llama.files.fermi_grb.FermiGRBsJSON" [label=<{{<B>FermiGRBsJSON</B>|<I>fermi_grbs.json</I>|JSONFile<BR/>HEALPixPSF}}>, shape="record", style=filled, target=_top, URL="/llama.files.fermi_grb.html#llama.files.fermi_grb.FermiGRBsJSON", fillcolor="#cccccc"]; "llama.files.skymap_info.SkymapInfo" [label=<{{<B>SkymapInfo</B>|<I>skymap_info.json</I>|EventTriggeredFileHandler<BR/>JSONFile}}>, shape="record", style=filled, target=_top, URL="/llama.files.skymap_info.html#llama.files.skymap_info.SkymapInfo", fillcolor="#cccccc"]; "llama.files.skymap_info.SkymapInfo" -> "llama.files.fermi_grb.FermiGRBsJSON" [arrowtail="none", color="red", ]; }

Required input files for llama.files.fermi_grb.FermiGRBsJSON (located on the far right of the graph). For a typical trigger, the leftmost files will be generated as triggers become available. They will be used as input for files to their right, eventually allowing llama.files.fermi_grb.FermiGRBsJSON to be generated.

New and historical Fermi GRB triggers saved in a JSON file. Triggers are in a list of JSON objects, where each trigger will have (at least) the following properties:

rafloat

Right ascension in degrees.

decfloat

Declination in degrees.

sigmafloat

Angular uncertainty in degrees.

gps_timefloat

GPS time of the trigger.

Additional properties might include:

graceidstr

GraceID of the event, if available.

skymap_urlstr

URL of a FITS skymap, if available.

DEPENDENCIES = (<class 'llama.files.skymap_info.SkymapInfo'>,)
DETECTORS = (Detector(name='Fermi', abbrev='frm', fullname='Fermi', url=None, summary='Fermi', description='', citations=ImmutableDict({})),)
FILENAME = 'fermi_grbs.json'
MANIFEST_TYPES = (<class 'llama.files.fermi_grb.FermiGRBsJSON'>,)
UR_DEPENDENCIES = (<class 'llama.files.skymap_info.SkymapInfo'>,)
UR_DEPENDENCY_TREE = frozenset({<class 'llama.files.skymap_info.SkymapInfo'>})
property num_triggers

The number of triggers described by this file. Useful mostly for quickly determining if this trigger list is empty.

source_locations()

Returns a list of tuples of (RA, Dec, sigma) for all point-like sources, where (RA, Dec) is the central sky position and sigma is the standard deviation of the Gaussian PSF. Since this depends on the structure of data in the relevant file handler, it must be specified for each subclass.

property template_skymap_filehandler

The HEALPixSkyMapFileHandler whose HEALPix parameters should be used as a template for the HEALPixSkyMap output by this FileHandler. It is assumed that this HEALPixSkyMapFileHandler only returns one skymap in its list; consequently, only the first skymap loaded by this file handler will be used. Note that the template skymap file handler is likely not a dependency of this file handler; it is only used as a default for formatting generated skymaps from this file handler’s data.

llama.files.fermi_grb.get_grbs_from_csv(start_time, end_time)

Use the get_grbs_from_csv(start_time, end_time) function to obtain a list of dictionaries of past Gamma-Ray Bursts (GRB)s. The contents of each GRB dictionary are:

Parameters
  • start_time (int or float) – The start time in GPS seconds of the interval in which to search for GRBs.

  • end_time (int or float) – The end time of the search interval, also in GPS seconds.

Returns

grbs – GRB events in the given time window, where each GRB is a dictionary:

{
    'ra': ra,  # Right Ascension of the GRB in [deg]
    'dec': dec,  # Declination of the GRB [deg]
    'sigma': sigma,  # Standard deviation of the GRB location [deg]
    'time': gps_time,  # GPS time of the GRB event [deg]
}

Return type

list

Examples

>>> grbs = get_grbs_from_csv(1126089475.0,1126200000.0)
>>> sorted(grbs[0])
['dec', 'ra', 'sigma', 'time']
>>> [g['dec'] for g in grbs]
[-21.0339, 73.26, -53.79]
>>> [g['ra'] for g in grbs]
[248.4429, 321.36, 241.05]
>>> [g['sigma'] for g in grbs]
[0.033, 6.38, 1.95]
>>> [g['time'] for g in grbs]
[1126089476.0, 1126103089.0, 1126151534.0]