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
bayespputils.py File Reference

Prototypes

def lalinference.bayespputils.get_end (siminspiral)
 
def lalinference.bayespputils.replace_column (table, old, new)
 Workaround for missing astropy.table.Table.replace_column method, which was added in Astropy 1.1. More...
 
def lalinference.bayespputils.as_array (table)
 Workaround for missing astropy.table.Table.as_array method, which was added in Astropy 1.0. More...
 
def lalinference.bayespputils.det_end_time (ifo_prefix, inj)
 
def lalinference.bayespputils.get_prior (name)
 
def lalinference.bayespputils.plot_label (param)
 A lookup table for plot labels. More...
 
def lalinference.bayespputils.skyArea (bounds)
 functions used in 2stage kdtree More...
 
def lalinference.bayespputils.random_split (items, fraction)
 
def lalinference.bayespputils.addSample (tree, coordinates)
 
def lalinference.bayespputils.kdtree_bin_sky_volume (posterior, confidence_levels)
 
def lalinference.bayespputils.kdtree_bin_sky_area (posterior, confidence_levels, samples_per_bin=10)
 takes samples and applies a KDTree to them to return confidence levels returns confidence_intervals - dictionary of user_provided_CL:calculated_area b - ordered list of KD leaves injInfo - if injection values provided then returns [Bounds_of_inj_kd_leaf ,number_samples_in_box, weight_of_box,injection_CL ,injection_CL_area] Not quite sure that the repeated samples case is fixed, posibility of infinite loop. More...
 
def lalinference.bayespputils.kdtree_bin (posterior, coord_names, confidence_levels, initial_boundingbox=None, samples_per_bin=10)
 takes samples and applies a KDTree to them to return confidence levels returns confidence_intervals - dictionary of user_provided_CL:calculated_volume b - ordered list of KD leaves initial_boundingbox - list of lists [upperleft_coords,lowerright_coords] injInfo - if injection values provided then returns [Bounds_of_inj_kd_leaf ,number_samples_in_box, weight_of_box,injection_CL ,injection_CL_volume] Not quite sure that the repeated samples case is fixed, posibility of infinite loop. More...
 
def lalinference.bayespputils.kdtree_bin2Step (posterior, coord_names, confidence_levels, initial_boundingbox=None, samples_per_bin=10, injCoords=None, alternate=False, fraction=0.5, skyCoords=False)
 input: posterior class instance, list of confidence levels, optional choice of inital parameter space, samples per box in kdtree note initial_boundingbox is [[lowerbound of each param][upper bound of each param]], if not specified will just take limits of samples fraction is proportion of samples used for making the tree structure. More...
 
def lalinference.bayespputils.greedy_bin_two_param (posterior, greedy2Params, confidence_levels)
 Determine the 2-parameter Bayesian Confidence Intervals using a greedy binning algorithm. More...
 
def lalinference.bayespputils.pol2cart (long, lat)
 Utility function to convert longitude,latitude on a unit sphere to cartesian co-ordinates. More...
 
def lalinference.bayespputils.sph2cart (r, theta, phi)
 Utiltiy function to convert r,theta,phi to cartesian co-ordinates. More...
 
def lalinference.bayespputils.cart2sph (x, y, z)
 Utility function to convert cartesian coords to r,theta,phi. More...
 
def lalinference.bayespputils.plot_sky_map (hpmap, outdir, inj=None, nest=True)
 Plots a sky map from a healpix map, optionally including an injected position. More...
 
def lalinference.bayespputils.skymap_confidence_areas (hpmap, cls)
 Returns the area (in square degrees) for each confidence level with a greedy binning algorithm for the given healpix map. More...
 
def lalinference.bayespputils.skymap_inj_pvalue (hpmap, inj, nest=True)
 Returns the greedy p-value estimate for the given injection. More...
 
def lalinference.bayespputils.mc2ms (mc, eta)
 Utility function for converting mchirp,eta to component masses. More...
 
def lalinference.bayespputils.q2ms (mc, q)
 Utility function for converting mchirp,q to component masses. More...
 
def lalinference.bayespputils.q2eta (q)
 Utility function for converting q to eta. More...
 
def lalinference.bayespputils.mc2q (mc, eta)
 Utility function for converting mchirp,eta to new mass ratio q (m2/m1). More...
 
def lalinference.bayespputils.ang_dist (long1, lat1, long2, lat2)
 Find the angular separation of (long1,lat1) and (long2,lat2), which are specified in radians. More...
 
def lalinference.bayespputils.array_dot (vec1, vec2)
 Calculate dot products between vectors in rows of numpy arrays. More...
 
def lalinference.bayespputils.array_ang_sep (vec1, vec2)
 Find angles between vectors in rows of numpy arrays. More...
 
def lalinference.bayespputils.array_polar_ang (vec)
 Find polar angles of vectors in rows of a numpy array. More...
 
def lalinference.bayespputils.rotation_matrix (angle, direction)
 Compute general rotation matrices for a given angles and direction vectors. More...
 
def lalinference.bayespputils.ROTATEZ (angle, vx, vy, vz)
 
def lalinference.bayespputils.ROTATEY (angle, vx, vy, vz)
 
def lalinference.bayespputils.orbital_momentum (fref, m1, m2, inclination)
 Calculate orbital angular momentum vector. More...
 
def lalinference.bayespputils.orbital_momentum_mag (fref, m1, m2, eta)
 
def lalinference.bayespputils.component_momentum (m, a, theta, phi)
 Calculate BH angular momentum vector. More...
 
def lalinference.bayespputils.symm_tidal_params (lambda1, lambda2, q)
 Calculate best tidal parameters [Eqs. More...
 
def lalinference.bayespputils.spin_angles (fref, mc, eta, incl, a1, theta1, phi1, a2=None, theta2=None, phi2=None)
 Calculate physical spin angles. More...
 
def lalinference.bayespputils.chi_precessing (m1, a1, tilt1, m2, a2, tilt2)
 Calculate the magnitude of the effective precessing spin following convention from Phys. More...
 
def lalinference.bayespputils.calculate_redshift (distance, h=0.6790, om=0.3065, ol=0.6935, w0=-1.0)
 Calculate the redshift from the luminosity distance measurement using the Cosmology Calculator provided in LAL. More...
 
def lalinference.bayespputils.source_mass (mass, redshift)
 Calculate source mass parameter for mass m as: m_source = m / (1.0 + z) For a parameter m. More...
 
def lalinference.bayespputils.integrand_distance (redshift, nonGR_alpha)
 Following functions added for testing Lorentz violations. More...
 
def lalinference.bayespputils.DistanceMeasure (redshift, nonGR_alpha)
 D_alpha = ((1+z)^(1-alpha))/H_0 * D_alpha # from eq.15 of arxiv 1110.2720 D_alpha calculated from integrand in above function. More...
 
def lalinference.bayespputils.lambda_a (redshift, nonGR_alpha, lambda_eff, distance)
 Converting from the effective wavelength-like parameter to lambda_A: lambda_A = lambda_{eff}*(D_alpha/D_L)^(1/(2-alpha))*(1/(1+z)^((1-alpha)/(2-alpha))) More...
 
def lalinference.bayespputils.amplitudeMeasure (redshift, nonGR_alpha, lambda_eff, distance)
 Converting to Lorentz violating parameter "A" in dispersion relation from lambda_A: A = (lambda_A/h)^(alpha-2) # eqn. More...
 
def lalinference.bayespputils.physical2radiationFrame (theta_jn, phi_jl, tilt1, tilt2, phi12, a1, a2, m1, m2, fref, phiref)
 changes for testing Lorentz violations made till here More...
 
def lalinference.bayespputils.plot_one_param_pdf_kde (fig, onedpos)
 
def lalinference.bayespputils.plot_one_param_pdf (posterior, plot1DParams, analyticPDF=None, analyticCDF=None, plotkde=False)
 Plots a 1D histogram and (gaussian) kernel density estimate of the distribution of posterior samples for a given parameter. More...
 
def lalinference.bayespputils.getRAString (radians, accuracy='auto')
 
def lalinference.bayespputils.getDecString (radians, accuracy='auto')
 
def lalinference.bayespputils.plot_corner (posterior, levels, parnames=None)
 Make a corner plot using the triangle module (See http://github.com/dfm/corner.py) More...
 
def lalinference.bayespputils.plot_two_param_kde_greedy_levels (posteriors_by_name, plot2DkdeParams, levels, colors_by_name, line_styles=__default_line_styles, figsize=(4, 3), dpi=250, figposition=[0.2, 0.2, 0.48, 0.75], legend='right', hatches_by_name=None, Npixels=50)
 Plots a 2D kernel density estimate of the 2-parameter marginal posterior. More...
 
def lalinference.bayespputils.plot_two_param_kde (posterior, plot2DkdeParams)
 Plots a 2D kernel density estimate of the 2-parameter marginal posterior. More...
 
def lalinference.bayespputils.get_inj_by_time (injections, time)
 Filter injections to find the injection with end time given by time +/- 0.1s. More...
 
def lalinference.bayespputils.histogram2D (posterior, greedy2Params, confidence_levels)
 Returns a 2D histogram and edges for the two parameters passed in greedy2Params, plus the actual discrete confidence levels imposed by the finite number of samples. More...
 
def lalinference.bayespputils.plot_two_param_greedy_bins_contourf (posteriors_by_name, greedy2Params, confidence_levels, colors_by_name, figsize=(7, 6), dpi=120, figposition=[0.3, 0.3, 0.5, 0.5], legend='right', hatches_by_name=None)
 
def lalinference.bayespputils.plot_two_param_greedy_bins_hist (posterior, greedy2Params, confidence_levels)
 Histograms of the ranked pixels produced by the 2-parameter greedy binning algorithm colured by their confidence level. More...
 
def lalinference.bayespputils.greedy_bin_one_param (posterior, greedy1Param, confidence_levels)
 Determine the 1-parameter Bayesian Confidence Interval using a greedy binning algorithm. More...
 
def lalinference.bayespputils.contigious_interval_one_param (posterior, contInt1Params, confidence_levels)
 Calculates the smallest contigious 1-parameter confidence interval for a set of given confidence levels. More...
 
def lalinference.bayespputils.autocorrelation (series)
 Returns an estimate of the autocorrelation function of a given series. More...
 
def lalinference.bayespputils.autocorrelation_length_estimate (series, acf=None, M=5, K=2)
 Attempts to find a self-consistent estimate of the autocorrelation length of a given series. More...
 
def lalinference.bayespputils.effectiveSampleSize (samples, Nskip=1)
 Compute the effective sample size, calculating the ACL using only the second half of the samples to avoid ACL overestimation due to chains equilibrating after adaptation. More...
 
def lalinference.bayespputils.readCoincXML (xml_file, trignum)
 
def lalinference.bayespputils.find_ndownsample (samples, nDownsample)
 Given a list of files, threshold value, and a desired number of outputs posterior samples, return the skip number to achieve the desired number of posterior samples. More...
 
def lalinference.bayespputils.parse_converge_output_section (fo)
 
def lalinference.bayespputils.vo_nest2pos (nsresource, Nlive=None)
 Parse a VO Table RESOURCE containing nested sampling output and return a VOTable TABLE element with posterior samples in it. More...
 
def lalinference.bayespputils.confidence_interval_uncertainty (cl, cl_bounds, posteriors)
 Returns a tuple (relative_change, fractional_uncertainty, percentile_uncertainty) giving the uncertainty in confidence intervals from multiple posteriors. More...
 
def lalinference.bayespputils.plot_waveform (pos=None, siminspiral=None, event=0, path=None, ifos=['H1', 'L1', 'V1'])
 
def lalinference.bayespputils.plot_psd (psd_files, outpath=None, f_min=30.)
 
def lalinference.bayespputils.cred_interval (x, cl=.9, lower=True)
 Return location of lower or upper confidence levels Args: x: List of samples. More...
 
def lalinference.bayespputils.spline_angle_xform (delta_psi)
 Returns the angle in degrees corresponding to the spline calibration parameters delta_psi. More...
 
def lalinference.bayespputils.plot_spline_pos (logf, ys, nf=100, level=0.9, color='k', label=None, xform=None)
 Plot calibration posterior estimates for a spline model in log space. More...
 
def lalinference.bayespputils.plot_calibration_pos (pos, level=.9, outpath=None)
 
def lalinference.bayespputils.plot_burst_waveform (pos=None, simburst=None, event=0, path=None, ifos=['H1', 'L1', 'V1'])
 
def lalinference.bayespputils.make_1d_table (html, legend, label, pos, pars, noacf, GreedyRes, onepdfdir, sampsdir, savepdfs, greedy, analyticLikelihood, nDownsample)
 

Go to the source code of this file.

Data Structures

class  lalinference.bayespputils.PosteriorOneDPDF
 A data structure representing one parameter in a chain of posterior samples. More...
 
class  lalinference.bayespputils.Posterior
 Data structure for a table of posterior samples . More...
 
class  lalinference.bayespputils.BurstPosterior
 Data structure for a table of posterior samples . More...
 
class  lalinference.bayespputils.KDTree
 A kD-tree. More...
 
class  lalinference.bayespputils.KDTreeVolume
 A kD-tree suitable for splitting parameter spaces and counting hypervolumes. More...
 
class  lalinference.bayespputils.KDSkeleton
 object to store the structure of a kd tree More...
 
class  lalinference.bayespputils.PosteriorSample
 A single parameter sample object, suitable for inclusion in a kD-tree. More...
 
class  lalinference.bayespputils.AnalyticLikelihood
 Return analytic likelihood values. More...
 
class  lalinference.bayespputils.htmlChunk
 A base class for representing web content using ElementTree . More...
 
class  lalinference.bayespputils.htmlPage
 A concrete class for generating an XHTML(1) document. More...
 
class  lalinference.bayespputils.htmlSection
 Represents a block of html fitting within a htmlPage. More...
 
class  lalinference.bayespputils.htmlCollapseSection
 Represents a block of html fitting within a htmlPage. More...
 
class  lalinference.bayespputils.RALocator
 RA tick locations with some intelligence. More...
 
class  lalinference.bayespputils.DecLocator
 Dec tick locations with some intelligence. More...
 
class  lalinference.bayespputils.RAFormatter
 
class  lalinference.bayespputils.DecFormatter
 
class  lalinference.bayespputils.ACLError
 
class  lalinference.bayespputils.PEOutputParser
 A parser for the output of Bayesian parameter estimation codes. More...
 
class  lalinference.bayespputils.VOT2HTML
 

Namespaces

namespace  lalinference
 
namespace  lalinference.bayespputils
 

Variables

 lalinference.bayespputils.hostname_short = socket.gethostbyaddr(socket.gethostname())[0].split('.',1)[1]
 
list lalinference.bayespputils.logParams = ['logl','loglh1','loglh2','logll1','loglv1','deltalogl','deltaloglh1','deltalogll1','deltaloglv1','logw','logprior','logpost','nulllogl','chain_log_evidence','chain_delta_log_evidence','chain_log_noise_evidence','chain_log_bayes_factor']
 
list lalinference.bayespputils.relativePhaseParams = [ a+b+'_relative_phase' for a,b in combinations(['h1','l1','v1'],2)]
 
list lalinference.bayespputils.snrParams = ['snr','optimal_snr','matched_filter_snr','coherence'] + ['%s_optimal_snr'%(i) for i in ['h1','l1','v1']] + ['%s_cplx_snr_amp'%(i) for i in ['h1','l1','v1']] + ['%s_cplx_snr_arg'%(i) for i in ['h1', 'l1', 'v1']] + relativePhaseParams
 
list lalinference.bayespputils.calAmpParams = ['calamp_%s'%(ifo) for ifo in ['h1','l1','v1']]
 
list lalinference.bayespputils.calPhaseParams = ['calpha_%s'%(ifo) for ifo in ['h1','l1','v1']]
 
list lalinference.bayespputils.calParams = calAmpParams + calPhaseParams
 
list lalinference.bayespputils.massParams = ['m1','m2','chirpmass','mchirp','mc','eta','q','massratio','asym_massratio','mtotal','mf','mf_evol','mf_nonevol']
 
list lalinference.bayespputils.spinParamsPrec = ['a1','a2','phi1','theta1','phi2','theta2','costilt1','costilt2','costheta_jn','cosbeta','tilt1','tilt1_isco','tilt2','tilt2_isco','phi_jl','theta_jn','phi12','phi12_isco','af','af_evol','af_nonevol','afz','afz_evol','afz_nonevol']
 
list lalinference.bayespputils.spinParamsAli = ['spin1','spin2','a1z','a2z']
 
list lalinference.bayespputils.spinParamsEff = ['chi','effectivespin','chi_eff','chi_tot','chi_p']
 
list lalinference.bayespputils.spinParams = spinParamsPrec+spinParamsEff+spinParamsAli
 
list lalinference.bayespputils.cosmoParam = ['m1_source','m2_source','mtotal_source','mc_source','redshift','mf_source','mf_source_evol','mf_source_nonevol','m1_source_maxldist','m2_source_maxldist','mtotal_source_maxldist','mc_source_maxldist','redshift_maxldist','mf_source_maxldist','mf_source_maxldist_evol','mf_source_maxldist_nonevol']
 
list lalinference.bayespputils.ppEParams = ['ppEalpha','ppElowera','ppEupperA','ppEbeta','ppElowerb','ppEupperB','alphaPPE','aPPE','betaPPE','bPPE']
 
list lalinference.bayespputils.tigerParams = ['dchi%i'%(i) for i in range(8)] + ['dchi%il'%(i) for i in [5,6] ] + ['dxi%d'%(i+1) for i in range(6)] + ['dalpha%i'%(i+1) for i in range(5)] + ['dbeta%i'%(i+1) for i in range(3)] + ['dsigma%i'%(i+1) for i in range(4)] + ['dipolecoeff'] + ['dchiminus%i'%(i) for i in [1,2]] + ['dchiMinus%i'%(i) for i in [1,2]] + ['db1','db2','db3','db4','dc1','dc2','dc4','dcl']
 
list lalinference.bayespputils.qnmtestParams = ['domega220','dtau220','domega210','dtau210','domega330','dtau330','domega440','dtau440','domega550','dtau550']
 
list lalinference.bayespputils.bransDickeParams = ['omegaBD','ScalarCharge1','ScalarCharge2']
 
list lalinference.bayespputils.massiveGravitonParams = ['lambdaG']
 
list lalinference.bayespputils.lorentzInvarianceViolationParams = ['log10lambda_a','lambda_a','log10lambda_eff','lambda_eff','log10livamp','liv_amp']
 
list lalinference.bayespputils.tidalParams = ['lambda1','lambda2','lam_tilde','dlam_tilde','lambdat','dlambdat','lambdas','bluni']
 
list lalinference.bayespputils.fourPiecePolyParams = ['logp1','gamma1','gamma2','gamma3']
 
list lalinference.bayespputils.spectralParams = ['sdgamma0','sdgamma1','sdgamma2','sdgamma3']
 
list lalinference.bayespputils.energyParams = ['e_rad', 'e_rad_evol', 'e_rad_nonevol', 'l_peak', 'l_peak_evol', 'l_peak_nonevol', 'e_rad_maxldist', 'e_rad_maxldist_evol', 'e_rad_maxldist_nonevol']
 
list lalinference.bayespputils.spininducedquadParams = ['dquadmon1', 'dquadmon2', 'dquadmona', 'dquadmona']
 
tuple lalinference.bayespputils.strongFieldParams
 
list lalinference.bayespputils.distParams = ['distance','distMPC','dist','distance_maxl']
 
list lalinference.bayespputils.incParams = ['iota','inclination','cosiota']
 
list lalinference.bayespputils.polParams = ['psi','polarisation','polarization']
 
list lalinference.bayespputils.skyParams = ['ra','rightascension','declination','dec']
 
list lalinference.bayespputils.phaseParams = ['phase', 'phi0','phase_maxl']
 
list lalinference.bayespputils.timeParams = ['time','time_mean']
 
list lalinference.bayespputils.endTimeParams = ['l1_end_time','h1_end_time','v1_end_time']
 
list lalinference.bayespputils.statsParams = ['logprior','logl','deltalogl','deltaloglh1','deltalogll1','deltaloglv1','deltaloglh2','deltaloglg1']
 
list lalinference.bayespputils.calibParams = ['calpha_l1','calpha_h1','calpha_v1','calamp_l1','calamp_h1','calamp_v1']
 
list lalinference.bayespputils.confidenceLevels = [0.67,0.9,0.95,0.99]
 Greedy bin sizes for cbcBPP and confidence leves used for the greedy bin intervals. More...
 
dictionary lalinference.bayespputils.greedyBinSizes = {'mc':0.025,'m1':0.1,'m2':0.1,'mass1':0.1,'mass2':0.1,'mtotal':0.1,'mc_source':0.025,'m1_source':0.1,'m2_source':0.1,'mtotal_source':0.1,'mc_source_maxldist':0.025,'m1_source_maxldist':0.1,'m2_source_maxldist':0.1,'mtotal_source_maxldist':0.1,'eta':0.001,'q':0.01,'asym_massratio':0.01,'iota':0.01,'cosiota':0.02,'time':1e-4,'time_mean':1e-4,'distance':1.0,'dist':1.0,'distance_maxl':1.0,'redshift':0.01,'redshift_maxldist':0.01,'mchirp':0.025,'chirpmass':0.025,'spin1':0.04,'spin2':0.04,'a1z':0.04,'a2z':0.04,'a1':0.02,'a2':0.02,'phi1':0.05,'phi2':0.05,'theta1':0.05,'theta2':0.05,'ra':0.05,'dec':0.05,'chi':0.05,'chi_eff':0.05,'chi_tot':0.05,'chi_p':0.05,'costilt1':0.02,'costilt2':0.02,'thatas':0.05,'costheta_jn':0.02,'beta':0.05,'omega':0.05,'cosbeta':0.02,'ppealpha':1.0,'ppebeta':1.0,'ppelowera':0.01,'ppelowerb':0.01,'ppeuppera':0.01,'ppeupperb':0.01,'polarisation':0.04,'rightascension':0.05,'declination':0.05,'massratio':0.001,'inclination':0.01,'phase':0.05,'tilt1':0.05,'tilt2':0.05,'phi_jl':0.05,'theta_jn':0.05,'phi12':0.05,'flow':1.0,'phase_maxl':0.05,'calamp_l1':0.01,'calamp_h1':0.01,'calamp_v1':0.01,'calpha_h1':0.01,'calpha_l1':0.01,'calpha_v1':0.01,'logdistance':0.1,'psi':0.1,'costheta_jn':0.1,'mf':0.1,'mf_evol':0.1,'mf_nonevol':0.1,'mf_source':0.1,'mf_source_evol':0.1,'mf_source_nonevol':0.1,'mf_source_maxldist':0.1,'mf_source_maxldist_evol':0.1,'mf_source_maxldist_nonevol':0.1,'af':0.02,'af_evol':0.02,'af_nonevol':0.02,'afz':0.02,'afz_evol':0.01,'afz_nonevol':0.01,'e_rad':0.1,'e_rad_evol':0.1,'e_rad_nonevol':0.1,'e_rad_maxldist':0.1,'e_rad_maxldist_evol':0.1,'e_rad_maxldist_nonevol':0.1,'l_peak':0.1,'l_peak_evol':0.1,'l_peak_nonevol':0.1}
 
string lalinference.bayespputils.xmlns = 'http://www.ivoa.net/xml/VOTable/v1.1'
 
 lalinference.bayespputils.cred_level = lambda cl, x: np.sort(x, axis=0)[int(cl*len(x))]
 
 lalinference.bayespputils.unrho
 when called by kdtree.operate will be used to calculate the density of each bin (sky area) More...
 
 lalinference.bayespputils.tabname
 
 lalinference.bayespputils.intable
 
 lalinference.bayespputils.tableElementName