Welcome to ltf_catalog’s documentation!¶
Contents:
ltf_catalog¶
Catalog parser for the LAT Transient Factory
Installation¶
Clone this repository with git:
git clone https://github.com/giacomov/ltf_catalog.git
Then go inside the repository and execute the setup:
cd ltf_catalog
python setup.py install
Usage¶
You will need a data file. At the moment, the LAT Transient Factory catalog is private and you need to be part of the Fermi Large Area Telescope collaboration to be able to access it.
Let’s say that your data file is called “LTF_March24_2016.csv”. Then you can load the catalog like this:
import ltf_catalog as ltf
c = ltf.get_catalog("LTF_March24_2016.csv")
Now you can get the catalog of detections as:
detections = c.get_catalog_of_detections()
By default the detections are selected requiring a final TS >= 25 and at least 3 events with a probability larger than 90% of belonging to the trigger. You can change these criteria. For example, the following will consider detections all triggers with a final TS >= 30 and at lest 10 events with a probability larger than 90% of belonging to the trigger:
custom_detections = c.get_catalog_of_detections("Final_TS >= 30","GRB_events >= 10")
Once you have your catalog of detections, you can loop over them by doing:
for trigger in detections.iteritems():
[do your processing here]
So for example, this will print all the available information:
for trigger in detections.iteritems():
for det in detections.iteritems():
print("%s %s %s %s %s %s %s %s" %(det.name, det.trigger_time, det.date, det.gcn_type,
det.get_longest_time_scale_with_detection(), det.time_scale_with_largest_TS,
det.maximum_TS, det.get_position_with_smallest_error()))
To see all methods and properties of the catalog and the triggers, see the API documentation at http://ltf-catalog.readthedocs.org/
API¶
-
class
ltf_catalog.
Catalog
(data)[source]¶ -
data
¶ Returns a numpy.ndarray containing the currently loaded data
-
get_catalog_of_detections
(*criteria)[source]¶ Return a new catalog containing only the detections, according to the default criteria or the custom one specified during the call.
Examples:
Get the detections with the standard criteria (Final_TS >= 25 and GRB_Events >= 3):
> detections = c.get_catalog_of_detections()Get the detections requiring a TS larger than 30 and more than 10 events:
> detections = c.get_catalog_of_detections(“Final_TS >= 30”,”GRB_events >= 10”)
-
triggers
¶ Return the list of all the triggers
-
-
class
ltf_catalog.
TriggerResults
(name, windows)[source]¶ -
date
¶ Returns the date in UTC format
Returns: a string containing the date in UTC format
-
gcn_type
¶ Returns the GCN_type, which can be used to figure out if this GRB belongs to the seed from the GBM, INTEGRAL, SWIFT and so on
Returns: a string
-
get_longest_time_scale_with_detection
(TS=25)[source]¶ Returns the longest time scale among the time windows having a TS larger than TS
Parameters: TS – threshold for claiming a detection (default : 25) Returns: the longest time windows
-
get_position_with_smallest_error
(TS=25)[source]¶ Returns the position with the smallest error among all the time scales where the candidate has a TS larger than the provided threshold
Parameters: TS – threshold for TS (default: 25) Returns: a tuple (R.A., Dec, error), where the error is the 90% containment (statistical only)
-
maximum_TS
¶ Returns the largest TS
Returns: the maximum of TS
-
name
¶ Return the trigger name
Returns: trigger name
-
time_scale_with_largest_TS
¶ Returns the time scale which resulted in the largest TS
Returns: the time window with the maximum TS
-
trigger_time
¶ Returns the trigger time
Returns: the trigger time
-
windows
¶ Returns the time windows for this trigger where the search has been successfully executed
Returns: a list of time windows
-