Package pylal :: Module SnglInspiralUtils
[hide private]
[frames] | no frames]

Module SnglInspiralUtils

source code

Classes [hide private]
  ExtractSnglInspiralTableLIGOLWContentHandler
LIGOLWContentHandler that will extract only the SnglInspiralTable from a document.
  SnglInspiralID_old
Custom row ID thing for sngl_inspiral tables with int_8s event IDs.
Functions [hide private]
 
ReadSnglInspiralFromFiles(fileList, verbose=False, filterFunc=None)
Read the SnglInspiralTables from a list of files.
source code
 
ReadSnglInspiralSlidesFromFiles(fileList, shiftVector, vetoFile=None, verbose=False)
Function for reading time-slided single inspiral triggers with automatic resliding the times, given a list of input files.
source code
 
ReadSnglInspiralsForPipelineStage(xmldoc, slideDict, stage)
Collect the sngl_inspiral rows from a desired stage in the pipeline.
source code
 
CompareSnglInspiralByEndTime(a, b)
Orders a and b by peak time.
source code
 
CompareSnglInspiralBySnr(a, b)
Orders a and b by peak time.
source code
 
CompareSnglInspiral(a, b, twindow=lsctables.LIGOTimeGPS(0))
Returns 0 if a and b are less than twindow appart.
source code
 
slideTriggersOnLines(triggerList, shifts)
In-place modify trigger_list so that triggers are slid by appropriate value of shifts.
source code
 
slideTimeOnRing(time, shift, ring)
Return time after adding shift, but constrained to lie along the ring
source code
 
slideTriggersOnRings(triggerList, rings, shifts)
In-place modify trigger_list so that triggers are slid by appropriate value of shifts along their enclosing ring segment by the algorithm given in XXX.
source code
 
unslideTriggersOnRings(triggerList, rings, shifts)
In-place modify trigger_list so that triggers are unslid by appropriate value of shifts along their enclosing ring segment by the algorithm given in XXX.
source code
 
slideTriggersOnRingWithVector(triggerList, shiftVector, rings)
In-place modify trigger_list so that triggers are slid by along their enclosing ring segment by the algorithm given in XXX.
source code
 
slideSegListDictOnRing(ring, seglistdict, shifts)
Return seglistdict with segments that are slid by appropriate values of shifts along the ring segment by the algorithm given in XXX.
source code
 
compute_thinca_livetime(on_instruments, off_instruments, rings, vetoseglistdict, offsetvectors)
@on_instruments is an iterable of the instruments that must be on.
source code
Function Details [hide private]

ReadSnglInspiralFromFiles(fileList, verbose=False, filterFunc=None)

source code 

Read the SnglInspiralTables from a list of files. If filterFunc is not None, only keep triggers for which filterFunc evaluates to True. Ex.: filterFunc=lambda sng: sng.snr >= 6.0

Parameters:
  • fileList - list of input files
  • verbose - print progress

ReadSnglInspiralSlidesFromFiles(fileList, shiftVector, vetoFile=None, verbose=False)

source code 

Function for reading time-slided single inspiral triggers with automatic resliding the times, given a list of input files.

Parameters:
  • fileList - List of files containing single inspiral time-slided triggers
  • shiftVector - Dictionary of time shifts to apply to triggers keyed by IFO
  • vetoFile - segwizard formatted file used to veto all triggers
  • verbose - print progress

ReadSnglInspiralsForPipelineStage(xmldoc, slideDict, stage)

source code 

Collect the sngl_inspiral rows from a desired stage in the pipeline.
-- For the INSPIRAL and zerolag THINCA stages, the entire sngl_inspiral table is returned.
-- For the slide THINCA stages, return only the rows in the sngl_inspiral that
   compose a coincident event from the desired time-slide
@param xmldoc:    ligolw_xml doc
@param slideDict: dictionary of the desired time-slide (eg. {u'H1': 0.0, u'L1': 100.0})
@param stage:    the name of the stage (INSPIRAL_FIRST, THINCA_0_CAT_2, etc)

slideTriggersOnLines(triggerList, shifts)

source code 

In-place modify trigger_list so that triggers are slid by appropriate value of shifts.

Parameters:
  • triggerList - a SnglInspiralTable
  • shifts - a dictionary of the time-shifts keyed by IFO

slideTriggersOnRings(triggerList, rings, shifts)

source code 

In-place modify trigger_list so that triggers are slid by appropriate value of shifts along their enclosing ring segment by the algorithm given in XXX. This function calls the function slideTimeOnRing

Parameters:
  • triggerList - a SnglInspiralTable
  • rings - sorted segment list of possible rings
  • shifts - a dictionary of the time-shifts keyed by IFO

unslideTriggersOnRings(triggerList, rings, shifts)

source code 

In-place modify trigger_list so that triggers are unslid by appropriate value of shifts along their enclosing ring segment by the algorithm given in XXX. This function calls the function slideTriggersOnRing

Parameters:
  • triggerList - a SnglInspiralTable
  • rings - sorted segment list of possible rings
  • shifts - a dictionary of the time-shifts keyed by IFO

slideTriggersOnRingWithVector(triggerList, shiftVector, rings)

source code 

In-place modify trigger_list so that triggers are slid by along their enclosing ring segment by the algorithm given in XXX. Slide numbers are extracted from the event_id of each trigger, and multiplied by the corresponding (ifo-keyed) entry in shift_vector to get the total slide amount. This function is called by ReadSnglInspiralSlidesFromFiles and calls the function slideTimeOnRing

Parameters:
  • triggerList - a SnglInspiralTable
  • shiftVector - a dictionary of the unit time-shift vector, keyed by IFO
  • rings - sorted segment list of possible rings

slideSegListDictOnRing(ring, seglistdict, shifts)

source code 

Return seglistdict with segments that are slid by appropriate values of shifts along the ring segment by the algorithm given in XXX.

Parameters:
  • ring - segment on which to cyclicly slide segments in seglistdict
  • seglistdict - segments to be slid on ring
  • shifts - a dictionary of the time-shifts keyed by IFO

compute_thinca_livetime(on_instruments, off_instruments, rings, vetoseglistdict, offsetvectors)

source code 

@on_instruments is an iterable of the instruments that must be on.

@off_instruments is an iterable of the instruments that must be off.

on_instruments and off_instruments must be disjoint.

@rings is a list of segments defining the analysis ring boundaries. They can overlap, and do not need to be ordered.

@vetoseglistdict is a coalesced glue.segments.segmentlistdict object providing the veto segments for whatever instruments have vetoes defined for them. This can include veto lists for instruments other than those listed in on_ and off_instruments (extra veto lists will be ignored), and it need not provide lists for all instruments (instruments for which there are no veto segment lists are assumed to be on at all times).

@offsetvectors is an iterable of dictionaries of instrument-offset pairs. Each dictionary must contain entries for all instruments in the union of on_instruments and off_instruments (it is allowed to name others as well, but they will be ignored). An example of one dictionary of instrument-offset pairs: {"H1": 0.0, "H2": 5.0, "L1": 10.0}.

The return value is a float giving the livetime in seconds.