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

Module coh_PTF_pyutils

source code

Utilities for the coherent PTF inspiral analysis.

Functions [hide private]
 
new_snr_chisq(snr, new_snr, chisq_dof, q=4.0, n=3.0)
Returns the chisq value needed to weight snr into new_snr
source code
 
get_bestnr(trig, q=4.0, n=3.0, null_thresh=(4.25,6), snr_threshold=6., sngl_snr_threshold=4., chisq_threshold=None, null_grad_thresh=20., null_grad_val=1./5.)
Calculate BestNR (coh_PTF detection statistic) through signal based vetoes:
source code
 
calculate_contours(q=4.0, n=3.0, null_thresh=6., null_grad_snr=20, new_snr_thresh=6.0, new_snrs=[5.5,6,6.5,7,8,9,10,11], null_grad_val=0.2, chisq_dof=60, bank_chisq_dof=40, cont_chisq_dof=160)
Generate the plot contours for chisq variable plots
source code
 
plot_contours(axis, snr_vals, contours, colors) source code
 
readSegFiles(segdir) source code
 
makePaperPlots() source code
 
get_det_response(ra, dec, trigTime)
Return detector response for complete set of IFOs for given sky location and time.
source code
 
get_f_resp(self)
FIXME
source code
 
append_process_params(xmldoc, args, version, date)
Construct and append process and process_params tables to ligolw.Document object xmldoc, using the given sys.argv variable args and other parameters.
source code
 
identify_bad_injections(log_dir) source code
 
remove_bad_injections(sims, badInjs) source code
 
sim_inspiral_get_theta(self) source code
 
apply_snr_veto(mi_table, snr=6.0, return_index=False)
Veto events in a MultiInspiralTable based on their (coherent) SNR value.
source code
 
apply_chisq_veto(mi_table, snr=6.0, chisq_index=4.0, return_index=False)
Veto events in a MultiInspiralTable based on their $\chi^2 $ re-weighted coherent SNR.
source code
 
apply_bank_veto(mi_table, snr=6.0, chisq_index=4.0, return_index=False)
Veto events in a MultiInspiralTable based on their bank chisq- weighted (new) coherent SNR.
source code
 
apply_auto_veto(mi_table, snr=6.0, chisq_index=4.0, return_index=False)
Veto events in a MultiInspiralTable based on their auto chisq- weighted (new) coherent SNR.
source code
 
apply_sngl_snr_veto(mi_table, snrs=[4.0,4.0], return_index=False)
Veto events in a MultiInspiralTable based on their single-detector snr in the most sensitive detectors.
source code
 
apply_null_snr_veto(mi_table, null_snr=6.0, snr=20.0, grad=0.2, return_index=False)
Veto events in a MultiInspiralTable based on their null SNR.
source code
 
veto(self, seglist, time_slide_table=None)
Return a MultiInspiralTable with those row from self not lying inside (i.e.
source code
 
vetoed(self, seglist, time_slide_table=None)
Return a MultiInspiralTable with those row from self lying inside (i.e.
source code
Function Details [hide private]

get_bestnr(trig, q=4.0, n=3.0, null_thresh=(4.25,6), snr_threshold=6., sngl_snr_threshold=4., chisq_threshold=None, null_grad_thresh=20., null_grad_val=1./5.)

source code 

Calculate BestNR (coh_PTF detection statistic) through signal based vetoes:

The signal based vetoes are as follows:
  * Coherent SNR < 6
  * Bank chi-squared reduced (new) SNR < 6
  * Auto veto reduced (new) SNR < 6
  * Single-detector SNR (from two most sensitive IFOs) < 4
  * Null SNR (CoincSNR^2 - CohSNR^2)^(1/2) < nullthresh
Returns BestNR as float

get_det_response(ra, dec, trigTime)

source code 

Return detector response for complete set of IFOs for given sky location and time. Inclination and polarization are unused so are arbitrarily set to 0.

apply_snr_veto(mi_table, snr=6.0, return_index=False)

source code 
Veto events in a MultiInspiralTable based on their (coherent) SNR
value.

@param mi_table
    a MultiInspiralTable from which to veto events
@param snr
    the value of coherent SNR on which to threshold
@param return_index
    boolean to return the index array of non-vetoed elements rather
    than a new table containing the elements themselves

@returns
    a new MultiInspiralTable with those events not vetoed OR
    the indices of the original mi_table not vetoed if return_index=True

apply_chisq_veto(mi_table, snr=6.0, chisq_index=4.0, return_index=False)

source code 
Veto events in a MultiInspiralTable based on their $\chi^2$
re-weighted coherent SNR.

@param mi_table
    a MultiInspiralTable from which to veto events
@param snr
    the value of coherent new SNR on which to threshold
@param chisq_index
    the index $\iota$ used in the newSNR calculation:
    [
ho_{\mbox{new}} =
        rac{
ho}{\left[rac{1}{2}
            \left(1 + \left(rac{\chi^2}{n_\mbox{dof}}
ight)^{\iota/3}
            
ight)
ight]^{1/\iota}}
    ]
@param return_index
    boolean to return the index array of non-vetoed elements rather
    than a new table containing the elements themselves

apply_bank_veto(mi_table, snr=6.0, chisq_index=4.0, return_index=False)

source code 
Veto events in a MultiInspiralTable based on their bank chisq-
weighted (new) coherent SNR.

@param mi_table
    a MultiInspiralTable from which to veto events
@param snr
    the value of coherent new SNR on which to threshold
@param chisq_index
    the index $\iota$ used in the newSNR calculation:
    [
ho_{\mbox{new}} =
        rac{
ho}{\left[rac{1}{2}
            \left(1 + \left(rac{\chi^2}{n_\mbox{dof}}
ight)^{\iota/3}
            
ight)
ight]^{1/\iota}}
    ]
@param return_index
    boolean to return the index array of non-vetoed elements rather
    than a new table containing the elements themselves

@returns
    a new MultiInspiralTable with those events not vetoed OR
    the indices of the original mi_table not vetoed if return_index=True

apply_auto_veto(mi_table, snr=6.0, chisq_index=4.0, return_index=False)

source code 
Veto events in a MultiInspiralTable based on their auto chisq-
weighted (new) coherent SNR.

@param mi_table
    a MultiInspiralTable from which to veto events
@param snr
    the value of coherent new SNR on which to threshold
@param chisq_index
    the index $\iota$ used in the newSNR calculation:
    [
ho_{\mbox{new}} =
        rac{
ho}{\left[rac{1}{2}
            \left(1 + \left(rac{\chi^2}{n_\mbox{dof}}
ight)^{\iota/3}
            
ight)
ight]^{1/\iota}}
    ]
@param return_index
    boolean to return the index array of non-vetoed elements rather
    than a new table containing the elements themselves

@returns
    a new MultiInspiralTable with those events not vetoed OR
    the indices of the original mi_table not vetoed if return_index=True

apply_sngl_snr_veto(mi_table, snrs=[4.0,4.0], return_index=False)

source code 
Veto events in a MultiInspiralTable based on their single-detector
snr in the most sensitive detectors.

@param mi_table
    a MultiInspiralTable from which to veto events
@param snrs
    an X-element list of single-detector SNRs on which to threshold
    for the X most sensitive detectors (in sensitivity order)
@param return_index
    boolean to return the index array of non-vetoed elements rather
    than a new table containing the elements themselves

@returns
    a new MultiInspiralTable with those events not vetoed OR
    the indices of the original mi_table not vetoed if return_index=True

apply_null_snr_veto(mi_table, null_snr=6.0, snr=20.0, grad=0.2, return_index=False)

source code 
Veto events in a MultiInspiralTable based on their null SNR.

@param mi_table
    a MultiInspiralTable from which to veto events
@param null_snr
    the value of null SNR on which to threshold
@param snr
    the value of coherent SNR on above which to grade the null SNR
    threshold
@param grad
    the rate at which to increase the null SNR threshold above snr
@param return_index
    boolean to return the index array of non-vetoed elements rather
    than a new table containing the elements themselves

@returns
    a new MultiInspiralTable with those events not vetoed OR
    the indices of the original mi_table not vetoed if return_index=True

veto(self, seglist, time_slide_table=None)

source code 

Return a MultiInspiralTable with those row from self not lying inside (i.e. not vetoed by) any elements of seglist.

If time_slide_table is not None, any time shifts will be undone and each detector checked individually

vetoed(self, seglist, time_slide_table=None)

source code 

Return a MultiInspiralTable with those row from self lying inside (i.e. vetoed by) any elements of seglist.

If time_slide_table is not None, any time shifts will be undone and each detector checked individually