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
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 andsigma
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 theHEALPixSkyMap
output by thisFileHandler
. It is assumed that thisHEALPixSkyMapFileHandler
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]