Package pylal :: Module followup_trigger :: Class FollowupTrigger
[hide private]
[frames] | no frames]

Class FollowupTrigger

source code

This defines a class for following up a trigger and to create the timeseries of found triggers in each stage of the pipeline.

Usage:

# first need to initialize the class followup = followup_trigger.FollowupTrigger(cache, opts)

# later, one can do a followup of different objects, like an injection, # a coinc. trigger or a single trigger: htmlname1 = followup.from_coinc(coinc) htmlname2 = followup.from_sngl(sngl_inspiral) htmlname3 = followup.from_missed(missed_inj) htmlname4 = followup.from_found(found_inj) htmlname5 = followup.from_new_coinc(new_coinc,[sngls]) htmlname6 = followup.from_new_slide_coinc(new_coinc,[sngls],slideDict,segs)

# In each case the path to the created html file is returned. # In the first call a CoincInspirals table is expected, a SnglInspiral # table in the second case and a SimInspiral table in the two last.

Instance Methods [hide private]
 
__init__(self, cache, opts, use_injections=True, do_slides=False)
Initialize this class and sets up all the cache files.
source code
 
set_sned(self, executable)
Sets the sned flag to 'flag'
source code
 
execute_sned(self, injections)
Makes an external call to lalapps_sned to recalculate the effective distances
source code
 
setTag(self, tag)
Setting a tag (non-conformal naming because of backwards compatibality)
source code
 
set_tag(self, tag)
Setting a tag
source code
 
get_injection_window(self)
Extracting the length of the used injection_window from any 'FOUND' file in the cache.
source code
 
get_injection_id(self, filename=None, url=None, cache_entry=None)
Extracting the injection ID from the filename, using the mechanism as used in lalapps_path2cache.
source code
 
check_injection_id(self, cache_entry, tag)
The above relies on a very specific naming convention, here we check if the injection tag is present in the files' description.
source code
 
find_injection_id(self, injection)
Find the injection-ID corresponding to this particular injection.
source code
 
read_veto_files(self)
Reads the veto segments given by veto-files (if any)
source code
 
reset(self)
Resets the counting number for the time-series plots generated.
source code
 
print_inj(self, inj, injID)
Print some useful informations to the screen.
source code
 
save_plot(self, stage)
Saves the plots and store them in a seperate fname_list.
source code
 
get_time_trigger(self, trig)
This is a helper function to return a GPS time as one float number
source code
 
get_effective_snr(self, trig, fac=50) source code
 
get_new_snr(self, trig, index=6.) source code
 
get_sim_time(self, sim, ifo=None)
This is a helper function to return a GPS time as one float number for a certain IFO.
source code
 
is_veto(self, time_trigger, ifo)
This function checks if there is a veto at the time 'timeTrigger' for the IFO 'ifo'.
source code
 
put_text(self, text)
Puts some text into an otherwise empty plot.
source code
 
create_timeseries(self, trigger_files, stage, number, slideDict=None)
Investigate inspiral triggers and create a time-series of the SNRs around the injected time
source code
 
select_category(self, trigger_files, category)
Return a trigger list that contains only files for the choosen category.
source code
 
fill_table(self, page, contents, header=False, no_wrapping=False)
Fills contents in a html table
source code
 
create_table_inj(self, inj)
Creates the first table containing basic properties of the injection which is followed up.
source code
 
create_table_sngl(self, trig)
Creates the first table containing basic properties of the trigger which is followed up.
source code
 
create_table_coinc(self, coinc, snglInspirals=None, page=None, slideDict=None)
Creates the first table containing basic properties of the coincidence which is followed up.
source code
 
create_table_time(self, trigger_time)
Creates the first table containing the time of the followup
source code
 
add_table_followup(self, page, invest_dict)
Adds the table containing specific information on the loudest trigger found in the followup region for each IFO.
source code
 
from_coinc(self, coinc, ifo=None, more_infos=False, injection_id=None, slideDict=None)
Creates a followup page from a coincident trigger.
source code
 
from_new_coinc(self, coinc, sngls, more_infos=False, injection_id=None)
Creates a followup page from a coincident trigger.
source code
 
from_new_slide_coinc(self, coinc, sngls, slideDict, more_infos=False, injection_id=None)
Creates a followup page from a slid coincident trigger.
source code
 
from_sngl(self, sngl, ifo=None, more_infos=False, injection_id=None)
Creates a followup page from a single trigger.
source code
 
from_missed(self, missed, ifo=None, more_infos=True, injection_id=None)
Creates a followup page from a missed injection.
source code
 
from_found(self, found, ifo=None, more_infos=False, injection_id=None, coinc=None, sngls=None)
Creates a followup page from a found injection.
source code
 
from_injection(self, injection, ifo=None, more_infos=True, injection_id=None, coinc=None, sngls=None)
Creates a followup page from an injection.
source code
 
from_time(self, trigger_time, ifo=None, more_infos=False, injection_id=None)
Creates a followup page from a given time.
source code
 
followup(self, page, slideDict=None)
Central followup procedure, finding corresponding files, generating the time-series and creating the output html files
source code
 
find_unvetoed_ifos(self, inj, ifo_list)
Find the list of unvetoed injections for this particular injection (missed or found)
source code
 
get_relevant_distance(self, inj, ifo_list)
Find the relevant distance for this injection, given the list of IFO's
source code
 
populate_followup_list(self, inj, ifo_list)
Find the relevant effective distance for this injection including any possible vetoes.
source code
 
followup_missed_injections(self, opts, missed_injections, found_injections, xvalue='mtotal', xlog='linear', ylog='log')
This function will do the complete followup on each relevant missed injection.
source code
Method Details [hide private]

__init__(self, cache, opts, use_injections=True, do_slides=False)
(Constructor)

source code 

Initialize this class and sets up all the cache files.

Parameters:
  • cache - The cache of all files
  • opts - The 'opts' structure from the main code
  • use_injections - Specifying if injections are being used (if no injections are used and this is set to False, it speeds up the whole initalization...)

set_sned(self, executable)

source code 

Sets the sned flag to 'flag'

Parameters:
  • flag - the executable used to calculate the sned

execute_sned(self, injections)

source code 

Makes an external call to lalapps_sned to recalculate the effective distances

Parameters:
  • injections - the list of injections to be converted
Returns:
the recalculated injection

setTag(self, tag)

source code 

Setting a tag (non-conformal naming because of backwards compatibality)

Parameters:
  • tag - the tag to be set

set_tag(self, tag)

source code 

Setting a tag

Parameters:
  • tag - well, its the tag!

get_injection_id(self, filename=None, url=None, cache_entry=None)

source code 

Extracting the injection ID from the filename, using
the mechanism as used in lalapps_path2cache. You can specify the filename
itself, the url or the cache entry. You must not specify more than one input!
The injection-ID is calculated in the following way (exttrig only):

The code expects the INSPIRAL and THINCA files in the following scheme (example):
  PREFIX-TAGPART_injections32_77-GPS-DURATION.xml
The number of the injection run is extracted (INJRUN) as well as the following
number (INJNUMBER). The injection ID is then calculated as:
   INJID = 100000*INJRUN + INJNUMBER
so for this example the injectionj ID is 3200077.

@param filename: filename from which the injection ID is extracted
@param url:  url from which the injection ID is extracted
@param cache_entry: cache entry from which the injection ID is extracted

find_injection_id(self, injection)

source code 

Find the injection-ID corresponding to this particular injection.

Parameters:
  • injection - the injection object
Returns:
the injection ID

print_inj(self, inj, injID)

source code 

Print some useful informations to the screen.

Parameters:
  • inj - the current missed injection
  • injID - the injection ID (used for exttrig only)

save_plot(self, stage)

source code 

Saves the plots and store them in a seperate fname_list.

Parameters:
  • stage - the stage this plot belongs to (e.g. INSPIRAL, THINCA,...)

get_time_trigger(self, trig)

source code 

This is a helper function to return a GPS time as one float number

Parameters:
  • trig - a sngl_inspiral table entry

get_sim_time(self, sim, ifo=None)

source code 

This is a helper function to return a GPS time as one float number for a certain IFO. If no IFO is specified the injected geocentric time is returned.

Parameters:
  • sim - a sim_inspiral table entry
  • ifo - the IFO for which we want the sim time

is_veto(self, time_trigger, ifo)

source code 

This function checks if there is a veto at the time 'timeTrigger' for the IFO 'ifo'.

Parameters:
  • time_trigger - The time to be investigated
  • ifo - The name of the IFO to be investigated

put_text(self, text)

source code 

Puts some text into an otherwise empty plot.

Parameters:
  • text - text to put in the empty plot

create_timeseries(self, trigger_files, stage, number, slideDict=None)

source code 

Investigate inspiral triggers and create a time-series of the SNRs around the injected time

Parameters:
  • trigger_files - List of files containing the inspiral triggers
  • stage - the name of the stage (INSPIRAL_FIRST, THINCA_0_CAT_2)
  • number - the consecutive number for this inspiral followup
  • slideDict - A dictionary of ifo keyed slide times if using slides

select_category(self, trigger_files, category)

source code 

Return a trigger list that contains only files for the choosen category.

Parameters:
  • trigger_files - a list of trigger file names
  • category - a category number
Returns:
a sub list of filename corresponding to the category requested

fill_table(self, page, contents, header=False, no_wrapping=False)

source code 

Fills contents in a html table

Parameters:
  • page - the page object describing a html page

create_table_inj(self, inj)

source code 

Creates the first table containing basic properties of the injection which is followed up.

Parameters:
  • inj - an injection table

create_table_sngl(self, trig)

source code 

Creates the first table containing basic properties of the trigger which is followed up.

Parameters:
  • trig - an sngl_inspiral table

create_table_coinc(self, coinc, snglInspirals=None, page=None, slideDict=None)

source code 

Creates the first table containing basic properties of the coincidence which is followed up.

Parameters:
  • coinc - an CoincInspiral table

create_table_time(self, trigger_time)

source code 

Creates the first table containing the time of the followup

Parameters:
  • trigger_time - well, just the trigger time

add_table_followup(self, page, invest_dict)

source code 

Adds the table containing specific information on the loudest trigger found in the followup region for each IFO.

Parameters:
  • page - the html page to which to add the table
  • invest_dict - dictionary containing the stage results

from_coinc(self, coinc, ifo=None, more_infos=False, injection_id=None, slideDict=None)

source code 

Creates a followup page from a coincident trigger.

Parameters:
  • coinc - the coincidence to be followed up
  • ifo - specifies the ifo to be used from the coinc.
  • more_infos - to have some additional informations
  • injection_id - Must be specified for exttrig search to specify what injection to use

from_new_coinc(self, coinc, sngls, more_infos=False, injection_id=None)

source code 

Creates a followup page from a coincident trigger.

Parameters:
  • coinc - the coincidence to be followed up
  • ifo - specifies the ifo to be used from the coinc.
  • more_infos - to have some additional informations
  • injection_id - Must be specified for exttrig search to specify what injection to use

from_new_slide_coinc(self, coinc, sngls, slideDict, more_infos=False, injection_id=None)

source code 

Creates a followup page from a slid coincident trigger. This function does not yet produce the plots (as I'm not sure how to!) but the relevant information to do this (the slide dictionary and the segment list) are provided to this function.

Parameters:
  • coinc - the coincidence to be followed up
  • ifo - specifies the ifo to be used from the coinc.
  • more_infos - to have some additional informations
  • injection_id - Must be specified for exttrig search to specify what injection to use

from_sngl(self, sngl, ifo=None, more_infos=False, injection_id=None)

source code 

Creates a followup page from a single trigger.

Parameters:
  • sngl - the sngl trigger to be followed up
  • ifo - NOT USED
  • more_infos - to have some additional informations
  • injection_id - Must be specified for exttrig search to specify what injection to use

from_missed(self, missed, ifo=None, more_infos=True, injection_id=None)

source code 

Creates a followup page from a missed injection.

Parameters:
  • sngl - the missed injection to be followed up
  • ifo - The ifo whose time is used (geocent if None)
  • more_infos - to have some additional informations
  • injection_id - Must be specified for exttrig search to specify what injection to use

from_found(self, found, ifo=None, more_infos=False, injection_id=None, coinc=None, sngls=None)

source code 

Creates a followup page from a found injection.

Parameters:
  • sngl - the found injection to be followed up
  • ifo - The ifo whose time is used (geocent if None)
  • more_infos - to have some additional informations
  • injection_id - Must be specified for exttrig search to specify what injection to use

from_injection(self, injection, ifo=None, more_infos=True, injection_id=None, coinc=None, sngls=None)

source code 

Creates a followup page from an injection.

Parameters:
  • injection - the injection to be followed up
  • ifo - The ifo whose time is used (geocent if None)
  • more_infos - to have some additional informations
  • injection_id - Must be specified for exttrig search to specify what injection to use

from_time(self, trigger_time, ifo=None, more_infos=False, injection_id=None)

source code 

Creates a followup page from a given time.

Parameters:
  • trigger_time - the time to be followed up
  • ifo - NOT USED
  • injection_id - Must be specified for exttrig search to specify what injection to use

followup(self, page, slideDict=None)

source code 

Central followup procedure, finding corresponding files, generating the time-series and creating the output html files

Parameters:
  • page - The head of the html page created with different informations
  • slideDict - A dictionary of ifo keyed slide times if using slides
Returns:
filename of the created html

find_unvetoed_ifos(self, inj, ifo_list)

source code 

Find the list of unvetoed injections for this particular injection (missed or found)

Parameters:
  • inj - the injection (SimInspiral table)
  • ifo_list - the ifo list