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

Module auxmvc_utils

source code

Functions [hide private]
 
ROC(clean_ranks, glitch_ranks)
Calculates ROC curves based on the ranks assigned by a classifier to clean and glitch aux triggers.
source code
 
compute_FAP(clean_ranks, glitch_ranks, rank)
Compute false alarm probability for a given rank using array of ranks for clean and glitch samples.
source code
 
compute_Eff(clean_ranks, glitch_ranks, rank)
Compute detection probability for a given rank using array of ranks for clean and glitch samples.
source code
 
split_array(array, Nparts=2)
Splits 2-d record array in N equal parts.
source code
 
get_clean_samples(Triggers)
Returns only clean samples from the set of random samples.
source code
 
get_samples_in_segments(Triggers, segments)
Returns new recarray containing only those samples (triggers) that are in segments.
source code
 
getKWAuxTriggerFromDQCAT(Triggers, DQ_category) source code
 
ReadKWAuxTriggers(files)
Reads in KW auxiliary triggers from files.
source code
 
ShuffleKWAuxTriggers(KWAuxTriggers, dT=60.0)
Shuffle segmented trigger packets.
source code
 
FilterKWAuxTriggers(KWAuxTriggers, excludeparameters, excludechannels)
Irrelevant channels and trigger parameters are excluded.
source code
 
ConvertKWAuxToMVSC(KWAuxGlitchTriggers, KWAuxCleanTriggers, ExcludeVariables=None)
Converts KW auxiliary triggers into MVSC triggers.
source code
 
WriteMVSCTriggers(MVSCTriggers, output_filename, Classified=False)
Write MVSC triggers to file.
source code
 
ReadMVSCTriggers(files, Classified=True)
Reads in MVSC triggers from files.
source code
 
LoadOVL(filename)
Reads in the pickled output of CV data (eg: kwl1-35.track.9.pickle) and inverts the data storage.
source code
 
Convert_ovl_chan(chan, channels)
converts a channel name into an integer (or vice versa) using channels (a file) as a dictionary.
source code
Function Details [hide private]

compute_FAP(clean_ranks, glitch_ranks, rank)

source code 

Compute false alarm probability for a given rank using array of ranks for clean and glitch samples. Input arrays clean_ranks and glitch_ranks mst be sorted in ascending order.

compute_Eff(clean_ranks, glitch_ranks, rank)

source code 

Compute detection probability for a given rank using array of ranks for clean and glitch samples. Input arrays clean_ranks and glitch_ranks mst be sorted in ascending order.

split_array(array, Nparts=2)

source code 

Splits 2-d record array in N equal parts. If the the number of elements in array is not divisible by Nparts, all but last sub arrays are equal. It returns list of sub-arrays.

get_clean_samples(Triggers)

source code 

Returns only clean samples from the set of random samples. By definition, a sample in unclean if there is a KW trigger with 0.1 seconds time window.

get_samples_in_segments(Triggers, segments)

source code 

Returns new recarray containing only those samples (triggers) that are in segments. segments is a list of tuples of the form (t1,t2). This function is not as efficient as it could be. It can be speed up if Triggers and segments are sorted. But sorting would mix glitches and clean samples. We sacrifice performance for clarity ( but should keep in mind optional speed up).

ReadKWAuxTriggers(files)

source code 

Reads in KW auxiliary triggers from files. Triggers are storead in the 2-D array. The rows of the array are labelled by the names of the variables, which are read off of the first line of the input file. The columns are populated by the values of the corresponding variables. Every line (except the first) of the input file(s) corresponds to a column (or a KW trigger) in the array.

ShuffleKWAuxTriggers(KWAuxTriggers, dT=60.0)

source code 

  Shuffle segmented trigger packets. The trigger packets are segmented with each dT seconds usig G
PS time.
  

FilterKWAuxTriggers(KWAuxTriggers, excludeparameters, excludechannels)

source code 

Irrelevant channels and trigger parameters are excluded. excludechannels is a list of irrelevant channel names to be excluded. excludeparameters is a list of comma separated parameters. i.e. dur,freq,npts

ConvertKWAuxToMVSC(KWAuxGlitchTriggers, KWAuxCleanTriggers, ExcludeVariables=None)

source code 

Converts KW auxiliary triggers into MVSC triggers. KWAuxGlitchTriggers - KW triggers corresponding to glitches in DARM KWAuxCleanTriggers - KW triggers correspondingto clean DARM data.

WriteMVSCTriggers(MVSCTriggers, output_filename, Classified=False)

source code 

Write MVSC triggers to file. If Classified = False, triggers are treated as unclassfied and saved in the input file for MVSC. If Classified = True, triggers as saved in the same format as output of MVSC.

ReadMVSCTriggers(files, Classified=True)

source code 

Reads in MVSC triggers from files. MVSC triggers are storead in the 2-D array. The rows of the array are labelled by the names of the variables, which are read off of the first(or second) line of the input file, depending on whether the triggers were classifed or not. The columns are populated by the values of the corresponding variables. Every line (except the first 1 or 2 lines) of the input file(s) corresponds to a column (or a MVSC trigger) in the array.

LoadOVL(filename)

source code 

Reads in the pickled output of CV data (eg: kwl1-35.track.9.pickle) and inverts the data storage. Returns a list of gwtrg's removed by the Cveto method.
returned gwtrg's are labeled by tcent (and only tcent) and are associated with a given vconfig (vchan, vthr, vwin) and vstats (dsec, c_dsec, etc)
input arg:
  filename: the file that is to be loaded. This must be a string
output arg:
  gwtrg_vtd_tcent: a list of gwtrgs (labeled by tcent) with associated vconfig and vstats. the storage structure is: under each column: [tcent, [vconfig], [vstats]]
    check below for exact formats of vconfig and vstats. 

Convert_ovl_chan(chan, channels)

source code 

converts a channel name into an integer (or vice versa) using channels (a file) as a dictionary. channels should correspond to a file in which each line is a channel name, and the line number defines the int. the idea is to convert between OVL channel integers and channel names quickly.