Loading [MathJax]/extensions/TeX/AMSsymbols.js
LALInference 4.1.9.1-00ddc7f
All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
cbcBayesBurstPPAnalysis Namespace Reference

Data Structures

class  LIGOLWContentHandlerExtractSimBurstTable
 

Functions

def fractional_rank (x, xs)
 Returns the fraction of samples, xs, that fall below the value x. More...
 
def pp_plot (ps, title=None, outfile=None)
 Generates a p-p plot for the given ps. More...
 
def pp_kstest_pvalue (ps)
 Returns the K-S p-value for the test of the given ps against a uniform distribution on [0,1]. More...
 
def read_posterior_samples (f)
 Returns a named numpy array of the posterior samples in the file f. More...
 
def output_html (outdir, ks_pvalues, injnum, skypp=False)
 Outputs the HTML page summarizing the results. More...
 

Variables

dictionary posterior_name_to_sim_burst_extractor
 
dictionary posterior_name_to_latex_name
 
string USAGE
 
 parser = optparse.OptionParser(USAGE)
 
 action
 
 type
 
 dest
 
 help
 
 default
 
 None
 
 options
 
 args
 
 injs = lsctables.SimBurstTable.get_table(utils.load_filename(options.injxml,contenthandler=LIGOLWContentHandlerExtractSimBurstTable))
 
list parameters = ['frequency', 'quality', 'hrss', 'ra', 'dec', 'psi', 'time', 'alpha','polar_eccentricity']
 
dictionary pvalues = { }
 
 posfiles = args
 
int Ninj = 0
 
def psamples = read_posterior_samples(posfile)
 
 true_params = injs[index]
 
def samples = psamples[par]
 
dictionary true_value = posterior_name_to_sim_burst_extractor[par](true_params)
 
def p = fractional_rank(true_value, samples)
 
dictionary ks_pvalues = {}
 
 ps
 
 title
 
 outfile
 
bool skypp = False
 
int found = 0
 
 inf = os.path.join(os.path.realpath(options.skypp),'p-p.%s'%i)
 
 outf = os.path.join(options.outdir,'sky_p-p.%s'%i)
 
 outdir
 

Function Documentation

◆ fractional_rank()

def cbcBayesBurstPPAnalysis.fractional_rank (   x,
  xs 
)

Returns the fraction of samples, xs, that fall below the value x.

Definition at line 93 of file cbcBayesBurstPPAnalysis.py.

◆ pp_plot()

def cbcBayesBurstPPAnalysis.pp_plot (   ps,
  title = None,
  outfile = None 
)

Generates a p-p plot for the given ps.

:param ps: The p-values whose cumulative distribution is to be plotted.

:param title: An (optional) title for the plot.

:param outfile: An (optional) basename for the plot file; both basename.png and basename.pdf will be created.

Definition at line 109 of file cbcBayesBurstPPAnalysis.py.

◆ pp_kstest_pvalue()

def cbcBayesBurstPPAnalysis.pp_kstest_pvalue (   ps)

Returns the K-S p-value for the test of the given ps against a uniform distribution on [0,1].

Definition at line 145 of file cbcBayesBurstPPAnalysis.py.

◆ read_posterior_samples()

def cbcBayesBurstPPAnalysis.read_posterior_samples (   f)

Returns a named numpy array of the posterior samples in the file f.

Definition at line 154 of file cbcBayesBurstPPAnalysis.py.

◆ output_html()

def cbcBayesBurstPPAnalysis.output_html (   outdir,
  ks_pvalues,
  injnum,
  skypp = False 
)

Outputs the HTML page summarizing the results.

Definition at line 165 of file cbcBayesBurstPPAnalysis.py.

Variable Documentation

◆ posterior_name_to_sim_burst_extractor

dictionary cbcBayesBurstPPAnalysis.posterior_name_to_sim_burst_extractor
Initial value:
1= {
2 'frequency' : lambda sb: sb.frequency,
3 'duration' : lambda sb: sb.duration,
4 'quality' : lambda sb: sb.q,
5 'hrss' : lambda sb: sb.hrss,
6 'psi' : lambda sb: sb.psi,
7 'time' : lambda sb: sb.time_geocent_gps + 1e-9*sb.time_geocent_gps_ns,
8 'ra' : lambda sb: sb.ra,
9 'dec' : lambda sb: sb.dec,
10 'polar_angle':lambda sb:sb.pol_ellipse_angle,
11 'polar_eccentricity':lambda sb:sb.pol_ellipse_e,
12 'alpha':lambda sb:sb.pol_ellipse_angle
13}

Definition at line 58 of file cbcBayesBurstPPAnalysis.py.

◆ posterior_name_to_latex_name

dictionary cbcBayesBurstPPAnalysis.posterior_name_to_latex_name
Initial value:
1= {
2 'frequency' : r'$f$',
3 'quality' : r'$q$',
4 'duration' : r'$\tau$',
5 'hrss' : r'$hrss$',
6 'time' : r'$t$',
7 'ra' : r'$\alpha$',
8 'dec' : r'$\delta$',
9 'psi' : r'$\psi$',
10 'polar_angle' : r'$\xi_a$',
11 'polar_eccentricity' : r'$\xi_e$',
12 'alpha' : r'$\zeta_{orb}$',
13
14
15}

Definition at line 73 of file cbcBayesBurstPPAnalysis.py.

◆ USAGE

string cbcBayesBurstPPAnalysis.USAGE
Initial value:
1= '''%prog [options] posfile1.dat posfile2.dat ...
2 Generate PP analysis for a set of injections. posfiles must be in same order as injections.'''

Definition at line 221 of file cbcBayesBurstPPAnalysis.py.

◆ parser

cbcBayesBurstPPAnalysis.parser = optparse.OptionParser(USAGE)

Definition at line 223 of file cbcBayesBurstPPAnalysis.py.

◆ action

cbcBayesBurstPPAnalysis.action

Definition at line 224 of file cbcBayesBurstPPAnalysis.py.

◆ type

cbcBayesBurstPPAnalysis.type

Definition at line 224 of file cbcBayesBurstPPAnalysis.py.

◆ dest

cbcBayesBurstPPAnalysis.dest

Definition at line 224 of file cbcBayesBurstPPAnalysis.py.

◆ help

cbcBayesBurstPPAnalysis.help

Definition at line 225 of file cbcBayesBurstPPAnalysis.py.

◆ default

cbcBayesBurstPPAnalysis.default

Definition at line 230 of file cbcBayesBurstPPAnalysis.py.

◆ None

cbcBayesBurstPPAnalysis.None

Definition at line 235 of file cbcBayesBurstPPAnalysis.py.

◆ options

cbcBayesBurstPPAnalysis.options

Definition at line 237 of file cbcBayesBurstPPAnalysis.py.

◆ args

cbcBayesBurstPPAnalysis.args

Definition at line 237 of file cbcBayesBurstPPAnalysis.py.

◆ injs

cbcBayesBurstPPAnalysis.injs = lsctables.SimBurstTable.get_table(utils.load_filename(options.injxml,contenthandler=LIGOLWContentHandlerExtractSimBurstTable))

Definition at line 239 of file cbcBayesBurstPPAnalysis.py.

◆ parameters

cbcBayesBurstPPAnalysis.parameters = ['frequency', 'quality', 'hrss', 'ra', 'dec', 'psi', 'time', 'alpha','polar_eccentricity']

Definition at line 242 of file cbcBayesBurstPPAnalysis.py.

◆ pvalues

dictionary cbcBayesBurstPPAnalysis.pvalues = { }

Definition at line 251 of file cbcBayesBurstPPAnalysis.py.

◆ posfiles

cbcBayesBurstPPAnalysis.posfiles = args

Definition at line 252 of file cbcBayesBurstPPAnalysis.py.

◆ Ninj

cbcBayesBurstPPAnalysis.Ninj = 0

Definition at line 253 of file cbcBayesBurstPPAnalysis.py.

◆ psamples

def cbcBayesBurstPPAnalysis.psamples = read_posterior_samples(posfile)

Definition at line 256 of file cbcBayesBurstPPAnalysis.py.

◆ true_params

cbcBayesBurstPPAnalysis.true_params = injs[index]

Definition at line 258 of file cbcBayesBurstPPAnalysis.py.

◆ samples

def cbcBayesBurstPPAnalysis.samples = psamples[par]

Definition at line 267 of file cbcBayesBurstPPAnalysis.py.

◆ true_value

dictionary cbcBayesBurstPPAnalysis.true_value = posterior_name_to_sim_burst_extractor[par](true_params)

Definition at line 268 of file cbcBayesBurstPPAnalysis.py.

◆ p

def cbcBayesBurstPPAnalysis.p = fractional_rank(true_value, samples)

Definition at line 269 of file cbcBayesBurstPPAnalysis.py.

◆ ks_pvalues

cbcBayesBurstPPAnalysis.ks_pvalues = {}

Definition at line 280 of file cbcBayesBurstPPAnalysis.py.

◆ ps

cbcBayesBurstPPAnalysis.ps

Definition at line 282 of file cbcBayesBurstPPAnalysis.py.

◆ title

cbcBayesBurstPPAnalysis.title

Definition at line 282 of file cbcBayesBurstPPAnalysis.py.

◆ outfile

cbcBayesBurstPPAnalysis.outfile

Definition at line 282 of file cbcBayesBurstPPAnalysis.py.

◆ skypp

bool cbcBayesBurstPPAnalysis.skypp = False

Definition at line 287 of file cbcBayesBurstPPAnalysis.py.

◆ found

int cbcBayesBurstPPAnalysis.found = 0

Definition at line 289 of file cbcBayesBurstPPAnalysis.py.

◆ inf

cbcBayesBurstPPAnalysis.inf = os.path.join(os.path.realpath(options.skypp),'p-p.%s'%i)

Definition at line 293 of file cbcBayesBurstPPAnalysis.py.

◆ outf

cbcBayesBurstPPAnalysis.outf = os.path.join(options.outdir,'sky_p-p.%s'%i)

Definition at line 294 of file cbcBayesBurstPPAnalysis.py.

◆ outdir

cbcBayesBurstPPAnalysis.outdir

Definition at line 305 of file cbcBayesBurstPPAnalysis.py.