Main API
- phazap.phazap(event_1, event_2, plot=False, output_dir='./', output_filename=None)[source]
Compute the \(D_J\) statistic, the \(V_J\) statistic, the phase shift, and the \(p\)-value
- Parameters:
event_1 (str or PostprocessedPhase) – The first event. If it is a string, it should be a file path to either a postprocessed phase file or a PE result file
event_2 (str or PostprocessedPhase) – The second event. If it is a string, it should be a file path to either a postprocessed phase file or a PE result file
plot (bool, optional) – Whether to plot the results, by default False
output_dir (str, optional) – The output directory, by default “./”
output_filename (str, optional) – The output filename, by default None
- Returns:
D_J (float) – The \(D_J\) statistic
vol_J (float) – The \(V_J\) statistic
phase_shift (float) – The phase shift
D_J_n (np.ndarray) – The \(D_J\) statistic for each allowed phase shift
p_value (float) – The \(p\)-value
- phazap.phazap_summary(event_1, event_2, plot=False, output_dir='./', output_filename=None)[source]
Compute the \(D_J\) statistic, the \(V_J\) statistic, the phase shift, and the \(p\)-value
- Parameters:
event_1 (str or PostprocessedPhase) – The first event. If it is a string, it should be a file path to either a postprocessed phase file or a PE result file
event_2 (str or PostprocessedPhase) – The second event. If it is a string, it should be a file path to either a postprocessed phase file or a PE result file
plot (bool, optional) – Whether to plot the results, by default False
output_dir (str, optional) – The output directory, by default “./”
output_filename (str, optional) – The output filename, by default None
- Returns:
D_J (float) – The \(D_J\) statistic
vol_J (float) – The \(V_J\) statistic
phase_shift (float) – The phase shift
p_value (float) – The \(p\)-value
- phazap.postprocess_phase(pe_result, flow=20.0, fhigh=100.0, fbest=40.0, superevent_name=None, label=None, output_dir='/home/docs/.phazap', output_filename=None)[source]
Postprocess the phase of the GW signal.
The procedure is described in Sec. II of https://arxiv.org/pdf/2308.06616.pdf
- Parameters:
pe_result (str or ParameterEstimationInput) – Path to the bilby result/PESummary file or an instance of ParameterEstimationInput
flow (float) – Lower frequency cutoff for computing \(\Delta \phi_f\)
fhigh (float) – Upper frequency cutoff for computing \(\Delta \phi_f\)
fbest (float) – Frequency at which the phase is best measured
superevent_name (str) – Name of the superevent
label (str) – Label for the postprocessed phase
output_dir (str) – Path to the output directory
output_filename (str) – Name of the output file
- Returns:
An instance of PostprocessedPhase class
- Return type:
- phazap.plot_utils.phazap_plot(event1_postprocessed_phase, event2_postprocessed_phase, output_dir='./', output_filename=None, use_latex=True)[source]
Plot the postprocessed phase for two events
- Parameters:
event1_postprocessed_phase (PostprocessedPhase) – PostprocessedPhase instance for event 1
event2_postprocessed_phase (PostprocessedPhase) – PostprocessedPhase instance for event 2
output_dir (str, optional) – Output directory
output_filename (str, optional) – Output filename
use_latex (bool, optional) – Use LaTeX for the labels
- Returns:
The figure object
- Return type:
matplotlib.figure.Figure