F-statistic (fstat) package
Submodules
simple_pe.fstat.fstat module
- simple_pe.fstat.fstat.a_f_to_snr(a, f_plus, f_cross)[source]
Given the F-stat a parameters and f_plus, f_cross for a detector, calculate the SNR. From the Harry-Fairhurst paper, the waveform is \(h = A^{\mu} h_{\mu}\) where \(h_1 = F_{+} h_{0}\); \(h_2 = F_x h_{0}\); \(h_{3} = F_{+} h_{\pi/2}\); \(h_{4} = F_x h_{\pi/2}\) and \(z = (s | h_{0}) + i (s | h_{\pi/2})\). Given the \(A^{\mu}\), the expected SNR is: \(z = F_{+} A^{1} + F_x A^{2} + i( F_{+} A^{3} + F_x A^{4})\)
- Parameters:
a – F-stat parameters
f_plus – Sensitivity to plus polarization
f_cross – Sensitivity to cross polarization
- Returns:
expected SNR
- simple_pe.fstat.fstat.a_to_circ_amp(a)[source]
Calculate the amplitudes of left/right circularly polarized waveforms from the F-stat A parameters
- Parameters:
a – array of f-stat params, entry zero assumed to be d0
- Returns:
the amplitudes of the left and right polarizations
- simple_pe.fstat.fstat.a_to_circular(a)[source]
Calculate the circular F-stat A parameters given in Whelan et al 2013
- Parameters:
a – array of f-stat params, entry zero assumed to be d0
- Returns:
circular f-stat parameters
- simple_pe.fstat.fstat.a_to_params(a)[source]
Calculate the physical parameters based upon the F-stat A parameters.
- Parameters:
a – array of f-stat params, entry zero assumed to be d0
- Returns:
distance, cos(inclination), polarization, phase
- simple_pe.fstat.fstat.amp_ratio(a)[source]
Calculate the amplitude ratio
- Parameters:
a – array of f-stat params, entry zero assumed to be d0
- Returns:
the ratio of amplitudes of the two polarizations
- simple_pe.fstat.fstat.circ_project(a, f_plus, f_cross, hand)[source]
Project the f-stat A parameters to those that would be observed by restricting to left or right circular polarization
- Parameters:
f_plus – sensitivity to plus polarization
f_cross – sensitivity to cross polarization
hand – one of “left”, “right”
- Returns:
f-stat A parameters projected to left or right circularly
polarized system
- simple_pe.fstat.fstat.dominant_polarization(f_sig)[source]
Given the detector responses, compute the dominant polarization F+, Fx and the angle that we have to rotate through to get to D.P.
- Parameters:
f_sig – sensitivity of detectors: sigma * (F+, Fx)
- simple_pe.fstat.fstat.expected_snr(a, f_plus, f_cross)[source]
Calculate the SNR for a given set of A parameters and network sensitivity.
- Parameters:
a – the F-stat A parameters
f_plus – F_plus sensitivity
f_cross – F_cross sensitivity
- Returns:
the expected SNR
- simple_pe.fstat.fstat.log_like(a_hat, f_plus, f_cross, d, cosi, psi, phi, d0=1)[source]
Calculate the log likelihood of at the given physical parameters for a signal described by a_hat and a network sensitivity f_plus, f_cross
- Parameters:
a_hat – the observed F-stat A parameters
f_plus – sensitivity to plus polarization
f_cross – sensitivity to cross polarization
d – distance to source
cosi – cos(inclination) of source
psi – polarization of source
phi – coalescence phase of source
d0 – overall scaling of A’s
- Returns:
the log likelihood (relative to the peak) at the given point
- simple_pe.fstat.fstat.lost_snrsq(a_hat, a, f_plus, f_cross)[source]
Calculate the difference in SNRSQ between the true parameters a_hat and the template a, network sensitivity f_plus, f_cross
- Parameters:
a_hat – the observed F-stat A parameters
a – the “template” F-stat A parameters
f_plus – sensitivity to plus polarization
f_cross – sensitivity to cross polarization
- Returns:
loss in SNR from incorrect f-stat parameters
- simple_pe.fstat.fstat.params_to_a(d, cosi, psi, phi=0, d0=1.0)[source]
Calculate the F-stat A params given the physical parameters and a choice of d0 to set the overall scaling
- Parameters:
d – distance to source
cosi – cos(inclination) of source
psi – polarization of source
phi – coalescence phase of source
d0 – overall scaling of A’s
- Returns:
the f-stat params, with a[:,0] storing d0
- simple_pe.fstat.fstat.phase_diff(a)[source]
Calculate the phase difference between the plus and cross polarizations
- Parameters:
a – array of f-stat params, entry zero (unused) assumed to be d0
- Returns:
phase difference between the two polarizations
- simple_pe.fstat.fstat.set_snr(a, f_plus, f_cross, snr)[source]
rescale distance to give desired SNR, return rescaled as and distance
- Parameters:
a – the F-stat A parameters
f_plus – F_plus sensitivity
f_cross – F_cross sensitivity
snr – the desired SNR
- Returns:
scaled f-stat parameters to a specific SNR
simple_pe.fstat.fstat_hm module
- simple_pe.fstat.fstat_hm.expected_snr_in_modes(a_dict, f_plus, f_cross)[source]
Calculate the SNR for a given set of A parameters and network sensitivity.
- Parameters:
a_dict – a dictionary, labelled by the modes, of the amplitude parameters
f_plus – F_plus sensitivity
f_cross – F_cross sensitivity
- simple_pe.fstat.fstat_hm.lost_snr_in_modes(a_hat, a, f_plus, f_cross)[source]
Calculate the difference in SNRSQ between the true parameters a_hat and the templates a for the given modes (ignoring cross terms), and network sensitivity f_plus, f_cross
- Parameters:
a_hat – the observed F-stat A parameters for the modes
a – the “template” F-stat A parameters for the modes
f_plus – sensitivity to plus polarization
f_cross – sensitivity to cross polarization
- simple_pe.fstat.fstat_hm.params_to_mode_a(mode, d, cosi, psi, phi=0, alpha=1, d0=1)[source]
Calculate the mode A params given the physical parameters and a choice of d0 to set the overall scaling
Note, the reference iota for 22 will always be iota = 0, where + and x both equal to one. Therefore, this factor never appears in the equations. For the other modes, however, there is no iota for which both polarizations are equal to 1, but we use their respective values at iota=pi/2 as reference.
- Parameters:
mode – the mode for which to calculate As
d – distance to source
cosi – cos(inclination) of source
psi – polarization of source
phi – coalescence phase of source
alpha – overall scaling of the mode relative to 22 –>
calculated with at iota = pi/2. (22 at iota = 0). :param d0: overall scaling of A’s
- simple_pe.fstat.fstat_hm.set_snr_in_modes(a_dict, f_plus, f_cross, snr)[source]
FIXME: for now ignoring all the cross terms. rescale distance to give desired SNR, return rescaled as and distance
- Parameters:
a_dict – a dictionary, labelled by the modes, of the amplitude parameters
f_plus – F_plus sensitivity
f_cross – F_cross sensitivity
snr – the desired SNR
- simple_pe.fstat.fstat_hm.sqri43(iota)
- simple_pe.fstat.fstat_hm.sqri4m3(iota)
- simple_pe.fstat.fstat_hm.t(iota)