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

Module pylal_exttrig_llutils

source code

Classes [hide private]
  Singleton
  AnalysisSingleton
  CodeTagger
  AnalysisDag
Class to hold and handle an analysis DAG and all related information.
  GRB
Class holding all the infos for a GRB and for setting up a new analysis DAG.
Functions [hide private]
 
external_call(command)
Makes an internal call to the shell (with the current set environment), wait for completion and returns the output and error of the command.
source code
 
system_call(item, command, divert_output_to_log=True)
Makes a system call.
source code
 
get_time()
Returns the current time in human-readable format
source code
 
get_gps_from_asc(date_string, time_string)
Computes the correct GPS time from the date and time as given in text strings.
source code
 
get_main_dir()
Returns the main directory of the analysis from the cp file.
source code
 
logfile_name()
Returns the file of the logfile; used in 'info' and 'system_call'
source code
 
info(item, text)
Prints an info into the log-file.
source code
 
send_mail(subject, msg, email_addresses=None, extra_addresses=None)
Function to send an email to a certain adress
source code
 
notify(grb, dag, message)
Makes an email notification to all recipients listed in the config file.
source code
 
get_lockname()
Returns the name of the lock file
source code
 
check_lock()
Checks if another instance of this code is running.
source code
 
set_lock()
Sets the lock file and writes the PID of this process
source code
 
del_lock()
Removes the lock file
source code
 
get_dag_part(ini_file)
Gets the dag-name from the ini file.
source code
 
check_file(filename)
Check the existance of a file and that it is non-zero in size (which is useful for segment files...)
source code
 
get_minimum_scienceseg_length(cp)
Calculate the minimum science segment that can be used with the data given in the actual ini-file.
source code
 
convert_segxml_to_segtxt(segxmlfile, segtxtfile)
Converts a segment xml file into a segment text file for convenience.
source code
 
read_xmlsegfile(xmlsegfile)
Function to read a segment list from a xml segment file
source code
 
update_segment_lists(segdict, timerange, tag=None, outputdir='.')
Function to download the latest segment lists.
source code
 
update_veto_lists(veto_definer, timerange, path='.', tag=None)
Function to update the veto files for a given time range
source code
 
get_veto_overlaps(segment, xmlsegfile)
Returns all vetoes from the file 'xmlsegfile' that overlap with the given 'segment'
source code
 
check_veto_time(used_ifos, list_cat, timerange, path='.', tag=None)
Function to check if the given timerange overlaps with some CAT veto
source code
 
get_segment_info(pas, timerange, minsciseg, plot_segments_file=None, path='.', tag=None, segs1=False)
Function to get the segment info for a timerange
source code
 
plot_segment_info(segdict, onsource, offsource, centertime, output_filename, plot_offset=1000, tag='')
Function to plot the segments around a 'centertime'
source code
 
get_available_ifos(trigger, minscilength, path='.', tag='', useold=False, offset=2000, onsource=None)
Function for a full scale check how many IFOs are available for a given time...
source code
 
read_adjusted_onsource(filename)
Reads the adjusted onsource times for GRBs inspected manually.
source code
 
read_adjusted_onsource_long(filename)
Reads the adjusted onsource times for GRBs inspected manually.
source code
 
parse_trigger_list(trigger_file, processed=[], max_number=None, specific_name=None)
This function parses the GRB list provided by Isabel and returns a list of new GRBs
source code
 
get_empty_exttrig_row()
Returns an empty exttrig row
source code
 
get_monitor_filename()
Returns the name of the monitor pickle filename
source code
 
read_monitor_list()
Opens the monitor pickle file (usually llmonitor.pickle) and return its contents.
source code
 
write_monitor_list(monitor_list)
Writes the monitor list to file
source code
 
read_grb_from_list(grb_name)
Returns the object associated with the given GRB.
source code
 
copy_exttrig_nofications()
Copying all relevant files to the working directory, usually from CIT from Isabels pwd
source code
 
update_durations(monitor_list)
Reads the local copy of the parsed circular and updated any duration information in the monitor_list structure
source code
 
obtain_results(grb)
Obtain the result, i.e the smallest p(c|0)
source code
 
generate_summary(publish_path, publish_url)
Generating summary page, with all sanity and/or openbox results properly linked.
source code
 
get_code_tag()
Returns the name of the tag currently stored in an environment variable
source code
 
get_env(name, required=False) source code
Variables [hide private]
  cp = None
hash(x)
  maindir = None
hash(x)
  template_trigger_hipe = "./lalapps_trigger_hipe" " --number-bu...
  template_trigger_hipe_inj = "./lalapps_trigger_hipe" " --numbe...
  basic_ifolist = ['H1', 'H2', 'L1', 'V1']
  colors = itertools.cycle(['b', 'g', 'r', 'c', 'm', 'y'])
  runtimes = {'A': [931035296, 935798487], 'B': [937800015, 9473...
  offset_gps_to_linux = 315964800
  total_summary_prefix = ...
Function Details [hide private]

external_call(command)

source code 

Makes an internal call to the shell (with the current set environment), wait for completion and returns the output and error of the command.

Parameters:
  • command - command to be executed internally
Returns:
a tuple (status, output, error)

get_gps_from_asc(date_string, time_string)

source code 

Computes the correct GPS time from the date and time as given in text strings.

Parameters:
  • date_string - date in a string format, i.e. 090717
  • time_string - time in a string format, i.e. 19:10:34

get_main_dir()

source code 

Returns the main directory of the analysis from the cp file. If that does not exist, returns the current directory.

send_mail(subject, msg, email_addresses=None, extra_addresses=None)

source code 

Function to send an email to a certain adress

Parameters:
  • subject - Subject line of the email
  • msg - Message of the email
  • email_addresses - list of email addresses to which the mail is sent
  • extra_addresses - Extra adresses to which to send the email

notify(grb, dag, message)

source code 

Makes an email notification to all recipients listed in the config file.

Parameters:
  • grb - grb dictionary for obtaining some informations
  • message - the message of the notification

check_lock()

source code 

Checks if another instance of this code is running. See http://code.activestate.com/recipes/546512/

get_dag_part(ini_file)

source code 

Gets the dag-name from the ini file. This might be non-robust, therefore it is coded as a complete function which can be changes easily.

Parameters:
  • ini_file - the name of the ini-file
  • return - the common part of any dag name

check_file(filename)

source code 

Check the existance of a file and that it is non-zero in size (which is useful for segment files...)

Parameters:
  • filename - name of the file to check
Returns:
True or False

get_minimum_scienceseg_length(cp)

source code 

Calculate the minimum science segment that can be used with the data given in the actual ini-file. The procedure below is taken from trigger_hipe.

update_segment_lists(segdict, timerange, tag=None, outputdir='.')

source code 

Function to download the latest segment lists.

Parameters:
  • segdict - the names of the segment for each IFO
  • timerange - the timerange the segments should cover
  • tag - optional parameter indicating the tag (e.g. 'grb090802')
  • outputdir - optional parameter indicating the output directory.

update_veto_lists(veto_definer, timerange, path='.', tag=None)

source code 

Function to update the veto files for a given time range

Parameters:
  • tag - Tag for the output files [optional]

check_veto_time(used_ifos, list_cat, timerange, path='.', tag=None)

source code 

Function to check if the given timerange overlaps with some CAT veto

Parameters:
  • used_ifos - A list of used ifos for which SCIENCE data is available
  • list_cat - A list of numbers, specifying the categories that should be checked for
  • timerange - The range of time that should be checked
  • path - Output path for the segment files [optional]
  • tag - Tag for the output files [optional]

get_segment_info(pas, timerange, minsciseg, plot_segments_file=None, path='.', tag=None, segs1=False)

source code 

Function to get the segment info for a timerange

Parameters:
  • timerange - The range of time the SCIENCE segments should be checked
  • minsciseg - The minimum time length (in seconds) for an analyzable consecutive segment
  • plot_segments_file - Name of the output name for the plot [optional]
  • path - Output path for the segment files (NOT the image) [optional]
  • tag - Tag for the files [optional]
  • segscat1 - CAT1 veto times to be considered when finding the best segment [optional]

plot_segment_info(segdict, onsource, offsource, centertime, output_filename, plot_offset=1000, tag='')

source code 

Function to plot the segments around a 'centertime'

Parameters:
  • segdict - dictionary containing the segments of the science data
  • onsource - the onsource segment
  • offsource - the offsource segment
  • centertime - the time at which the origin is set
  • output_filename - output filename of the plot
  • plot_offet - additional times (in second) on either side of the range
  • tag - full tag denoting e.g. the GRB (with the underscore before)

get_available_ifos(trigger, minscilength, path='.', tag='', useold=False, offset=2000, onsource=None)

source code 

Function for a full scale check how many IFOs are available for a given time
Requires a CP to be set with the following fileds:
  'data','science_segment_[IFO]'
  'data','veto_definer'
  'analysis','onsource_left'
  'analysis','onsource_right'

read_adjusted_onsource(filename)

source code 

Reads the adjusted onsource times for GRBs inspected manually. Uses the simple file format

read_adjusted_onsource_long(filename)

source code 

Reads the adjusted onsource times for GRBs inspected manually. Uses the Jordi-type of file

parse_trigger_list(trigger_file, processed=[], max_number=None, specific_name=None)

source code 

This function parses the GRB list provided by Isabel and returns a list of new GRBs

Parameters:
  • trigger_file - The name of the trigger file to parse
  • processed - List of triggers already processed [optional]
  • max_number - Returns at maximum this number of new triggers
  • specific_name - Will return a list with only the trigger information for this specific item, if it is found [optional]

get_empty_exttrig_row()

source code 

Returns an empty exttrig row

Returns:
empty exttrig table row

get_monitor_filename()

source code 

Returns the name of the monitor pickle filename

Returns:
name of the monitor pickle file

read_monitor_list()

source code 

Opens the monitor pickle file (usually llmonitor.pickle) and return its contents.

Returns:
list of GRB instances from the pickle file

write_monitor_list(monitor_list)

source code 

Writes the monitor list to file

Parameters:
  • monitor_list - list to be written to file

obtain_results(grb)

source code 

Obtain the result, i.e the smallest p(c|0)

Parameters:
  • grb - the grb stucture with all the infos in it

generate_summary(publish_path, publish_url)

source code 

Generating summary page, with all sanity and/or openbox results properly linked.

Parameters:
  • publish_path - Main path to where to copy the results and files
  • publish_url - The url identifier of the same path

get_code_tag()

source code 

Returns the name of the tag currently stored in an environment variable

Returns:
name of the tag

Variables Details [hide private]

template_trigger_hipe

Value:
"./lalapps_trigger_hipe" " --number-buffer-left 8 --number-buffer-righ\
t 8" " --verbose --skip-datafind " " --injection-config injectionsWI.i\
ni" " --user-tag onoff"

template_trigger_hipe_inj

Value:
"./lalapps_trigger_hipe" " --number-buffer-left 8 --number-buffer-righ\
t 8" " --verbose --skip-datafind " " --user-tag inj " " --overwrite-di\
r"

runtimes

Value:
{'A': [931035296, 935798487], 'B': [937800015, 947347215], 'C': [94900\
3215, 961545615], 'D': [961545615, 971654415]}

total_summary_prefix

Value:
"""
<body style="color: rgb(0, 0, 0); background-color: rgb(221, 255, 255)\
;" alink="#000099" link="#000099" vlink="#990099">

<h1>Summary of Gamma Ray Burst low-latency results during S6</h1>

<span style="font-weight: bold;"><br><br>
The following table contain a list of Gamma Ray Bursts occured during \
...