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

Module mvsc_plots

source code

Contains functions to create various plots from lalapps_mvsc_player


Author: Tristan Miller <tmiller@caltech.edu>

Functions [hide private]
 
patread(filename, station=None, readpat=False, readstr=False, headeronly=False, colsonly=False)
Reads in a file from SprOutputWriterApp.
source code
 
inforead(filename)
Reads the printout of SprBaggerDecisionTreeApp and returns info.
source code
 
rewrite_results(patpath, resultpath)
Rewrites the output of SprOutputWriterApp because it couldn't be bothered to save the numbers to full precision.
source code
 
sort_inj_ts(data)
Sorts data into injections and timeslides
source code
 
ROC(timeslides, injections)
Computes true and false positive rates.
source code
 
wilson(p, n)
Calculates the Wilson interval, the confidence interval for a binomial distribution.
source code
 
stairs(x, y)
Transforms lists (x,y) into (x1,y1) such that plotting them will create a stairs graph.
source code
 
top_events(data, cols, n, stations, mvsc_to_fan=None)
Finds the n events with the highest MVSC values.
source code
 
ROCplot(data_inj, data_ts, cols, op_point=1, ts_trig_ratio=25)
Creates an ROC plot from one file.
source code
 
FOMplot(fom)
Plots FOM vs bagger cycle.
source code
 
mvsc_vs_effsnr(data_inj, data_ts, cols, mvsc_cutoff=None, effsnr_cutoff=None, zerodata=None)
Plots mvsc values vs the sum of the squares of effective snr.
source code
 
fraction_detected(data_inj, data_ts, cols, afar=None, mvsc_cutoff=None, distance=False)
Graphs the fraction detected vs snr or distance.
source code
 
snr_vs_chisqr(data_inj, data_ts, cols, afar=1.0/2000, zerodata=None)
Plots SNR vs Chi Squared, indicating which triggers were correctly classified, and which were incorrectly classified.
source code
 
FARplot(data_ts, cols, zerodata=None, ts_trig_ratio=25)
Graphs the cumulative number of detections vs MVSC threshold.
source code
 
IFANplot(data_ts, cols, zerodata, ts_trig_ratio=25)
Plots the inverse false alarm number vs cumulative number of detections.
source code
Variables [hide private]
  __prog__ = 'mvsc_plots'
Function Details [hide private]

patread(filename, station=None, readpat=False, readstr=False, headeronly=False, colsonly=False)

source code 

Reads in a file from SprOutputWriterApp.

If readpat is false, reads a dat file. Otherwise, reads a pat file. If headeronly is true, only outputs header in a list. If cols only is true, only outputs header in dict. If station is given, outputs two dicts, the first with more standardized names (ie 'H1L1' => 't1t2') If readstr is false, reads floats. Otherwise, reads strings (which keeps full precision).

inforead(filename)

source code 
Reads the printout of SprBaggerDecisionTreeApp and returns info.

Info returned: List of FOM values
               Table of number of tree splits
               Number of timeslides in training set
               Number of injections in training set
               Number of timeslides in validation set
               Number of injections in validation set

rewrite_results(patpath, resultpath)

source code 

Rewrites the output of SprOutputWriterApp because it couldn't be bothered to save the numbers to full precision.

Returns the data (so that you don't have to reread the file later)

ROC(timeslides, injections)

source code 

Computes true and false positive rates.

May change the order of timeslides and injections.

wilson(p, n)

source code 

Calculates the Wilson interval, the confidence interval for a binomial distribution.

Returns the appropriate upper and lower error bars. The confidence level used is always 68%.

top_events(data, cols, n, stations, mvsc_to_fan=None)

source code 

Finds the n events with the highest MVSC values.

If multiple events tie for last, all will be included. Must give data in string form to keep precision. If given mvsc_to_fan (which is [list of mvsc cutoff values, list of corresponding false alarm numbers]), then will add a column of FAN.

ROCplot(data_inj, data_ts, cols, op_point=1, ts_trig_ratio=25)

source code 

Creates an ROC plot from one file.

Returns the confidence interval of the resulting efficiency.

fraction_detected(data_inj, data_ts, cols, afar=None, mvsc_cutoff=None, distance=False)

source code 

Graphs the fraction detected vs snr or distance.

Returns the false alarm rate (afar), the mvsc cutoff and the effsnr cutoff. Graphs vs snr by default, but if distance=True, will graph against distance instead. Requires either the afar or mvsc_cutoff in order to choose operating point.

snr_vs_chisqr(data_inj, data_ts, cols, afar=1.0/2000, zerodata=None)

source code 

Plots SNR vs Chi Squared, indicating which triggers were correctly classified, and which were incorrectly classified.

afar is the allowed false alarm rate in the classification

FARplot(data_ts, cols, zerodata=None, ts_trig_ratio=25)

source code 

Graphs the cumulative number of detections vs MVSC threshold.

Returns the coordinates of plotted points so that the FAN can be extracted from the MVSC value later.

IFANplot(data_ts, cols, zerodata, ts_trig_ratio=25)

source code 

Plots the inverse false alarm number vs cumulative number of detections.

Returns false if fails, true if succeeds