Waveforms package

Submodules

simple_pe.waveforms.parameter_bounds module

simple_pe.waveforms.parameter_bounds.param_bounds(params, dx_directions, harm2=False)[source]

calculate appropriate bounds on the dx_directions given the value of params

Parameters:
  • params – dictionary with parameter values for initial point

  • dx_directions – list of parameters for which to calculate waveform variations

  • harm2 – flag to indicate filtering 2-harmonic waveform

simple_pe.waveforms.waveform module

simple_pe.waveforms.waveform.check_physical(x, dx, scaling, maxs=None, mins=None, verbose=False)[source]

A function to check whether the point described by the positions x + dx is physically permitted. If not, rescale and return the scaling factor

Parameters:
  • x – dictionary with parameter values for initial point

  • dx – dictionary with parameter variations

  • scaling – the scaling to apply to dx

  • maxs – a dictionary with the maximum permitted values of the physical parameters

  • mins – a dictionary with the minimum physical values of the physical parameters

  • verbose – print logging messages

Return alpha:

the scaling factor required to make x + scaling * dx physically permissible

simple_pe.waveforms.waveform.make_offset_waveform(x, dx, scaling, df, f_low, flen, approximant='IMRPhenomD', harm2=False)[source]

This function makes a waveform for the given parameters and returns h_plus generated at value (x + scaling * dx).

Parameters:
  • x – dictionary with parameter values for initial point

  • dx – dictionary with parameter variations (can be a subset of the parameters in x)

  • scaling – the scaling to apply to dx

  • df – frequency spacing of points

  • f_low – low frequency cutoff

  • flen – length of the frequency domain array to generate

  • approximant – the approximant generator to use

  • harm2 – generate the 2-harmonics

Return h_plus:

waveform at parameter space point x + scaling * dx

simple_pe.waveforms.waveform.make_waveform(params, df, f_low, flen, approximant='IMRPhenomD', return_hc=False, modes=None, harm2=False)[source]

This function makes a waveform for the given parameters and returns h_plus generated at value x.

Parameters:
  • params – SimplePESamples with parameter values for waveform generation

  • df – frequency spacing of points

  • f_low – low frequency cutoff

  • flen – length of the frequency domain array to generate

  • approximant – the approximant generator to use

  • return_hc – flag to choose to return cross polarization (only non-precessing)

  • modes – the modes to generate (only for non-precessing)

  • harm2 – generate the 2-harmonics

Return h_plus:

waveform at parameter space point x

simple_pe.waveforms.waveform.offset_params(x, dx, scaling)[source]

Update the parameters x by moving to a value (x + scaling * dx)

Parameters:
  • x – dictionary with parameter values for initial point

  • dx – dictionary with parameter variations (can be a subset of the parameters in x)

  • scaling – the scaling to apply to dx

Return x_prime:

parameter space point x + scaling * dx

simple_pe.waveforms.waveform.precessing_approximant(approximant)[source]

Function to check whether a given approximant supports in-plane spins and therefore generates precessing waveforms.

Parameters:

approximant – the approximant generator to use

Return prec:

boolean which is True if waveform supports precession

simple_pe.waveforms.waveform_modes module

simple_pe.waveforms.waveform_modes.calculate_alpha_lm_and_overlaps(mass1, mass2, spin1z, spin2z, ifo_psd, f_low, approximant, modes, dominant_mode='22', spin1x=0.0, spin1y=0.0, spin2x=0.0, spin2y=0.0)[source]

Calculate the higher harmonic waveforms for given set of modes. Return waveforms and parts orthogonal to the (2,2)

Parameters

mass1: float

mass1

mass2: float

mass2

spin1z: float

spin1z

spin2z: float

spin2z

ifo_psd: pycbc.Frequency_Series

PSD to use when orthogonalizing

f_low: float

low frequency cutoff

approximant: str

waveform to use

modes: list

modes to consider

dominant_mode: str

mode to use when orthogonalizing

spin1x: float

spin1x (optional)

spin1y: float

spin1y (optional)

spin2x: float

spin2x (optional)

spin2y: float

spin2y (optional)

Returns

alpha_lm: dict

relative amplitudes of modes

overlap_lm: dict

overlap of lm with 22

simple_pe.waveforms.waveform_modes.calculate_hm_multipoles(mass1, mass2, spin1z, spin2z, ifo_psd, f_low, approximant, modes, dominant_mode='22', spin1x=0.0, spin1y=0.0, spin2x=0.0, spin2y=0.0)[source]

Calculate the higher harmonic waveforms for given set of modes. Return waveforms and parts orthogonal to the (2,2)

Parameters

mass1: float

mass of primary

mass2: float

mass of secondary

spin1z: float

z-component of primary spin

spin2z: float

z-component of primary spin

ifo_psd: psd

to use when orthogonalizing

f_low: float

low frequency cutoff

approximant: str

waveform to use

modes: list

modes to consider

dominant_mode: str

mode to use when orthogonalizing, default is 22 mode

spin1x: float

spin1x

spin1y: float

spin1y

spin2x: float

spin2x

spin2y: float

spin2y

Returns

h: dict

normalized waveform modes

h_perp: dict

orthonormalized waveform modes

sigmas: dict

waveform normalizations

zetas: dict

complex overlap with dominant mode

simple_pe.waveforms.waveform_modes.calculate_mode_snr(strain_data, ifo_psd, waveform_modes, t_start, t_end, f_low, modes, dominant_mode='22')[source]

Calculate the SNR in each of the modes. This is done by finding time of the peak SNR for the dominant mode, and then calculating the SNR of other modes at that time.

Parameters

strain_data: pycbc.Time_Series

the ifo data

ifo_psd: pycbc.Frequency_Series

PSD for ifo

waveform_modes: dict

dictionary of waveform modes (time/frequency series)

t_start: float

beginning of time window to look for SNR peak

t_end: float

end of time window to look for SNR peak

f_low: float

low frequency cutoff

modes: list

the modes to calculate SNR for

dominant_mode: str

mode that is used to define the peak time

Returns

z: dict

dictionary of complex SNRs for each mode

t: float

the time of the max SNR

simple_pe.waveforms.waveform_modes.mode_array(mode, approx)[source]

Return the mode array for a given approximant. This returns either the mode or the positive and negative m modes, depending upon the approximant

Parameters

mode: str

the mode of interest

approx: str

the waveform approximant

Returns

mode_array: list

list of modes corresponding to desired mode

simple_pe.waveforms.waveform_modes.network_mode_snr(z, ifos, modes, dominant_mode='22')[source]

Calculate the Network SNR in each of the specified modes. For the dominant mode, this is simply the root sum square of the snrs in each ifo. For the other modes, we calculate both the rss SNR and the network SNR which requires the relative phase between ifos is consistent with the dominant.

Parameters

z: dict

dictionary of dictionaries of SNRs in each mode (in each ifo)

ifos: list

A list of ifos to use

modes: list

A list of modes to use

dominant_mode: str

the mode with most power (for orthogonalization)

Returns

rss_snr: dict

the root sum squared SNR in each mode

net_snr: dict

the SNR in each mode that is consistent (in amplitude and phase) with the dominant mode SNR

simple_pe.waveforms.waveform_modes.orthonormalize_modes(h, ifo_psd, f_low, modes, dominant_mode='22')[source]

Orthonormalize a set of waveforms for a given PSD Return normalized waveforms orthogonal to the dominant mode, sigmas and (complex) overlaps of original waveforms

Parameters

h: dict

dictionary of waveform modes

ifo_psd: pycbc.Frequency_Series

PSD to use for orthonormalization

f_low: float

low frequency cutoff

modes: list

modes to consider

dominant_mode: str

mode to use for orthonormalization

Returns

h_perp: dict orthonormalized waveforms sigmas: dict

waveform normalizations, pre-orthogonalization

zetas: dict

complex overlap with dominant mode