TimeFrequencyWaveforms.code.TD_to_TFD_transform module

class TimeFrequencyWaveforms.code.TD_to_TFD_transform.Transformer(wdm, num_freq_points=100, fdot_grid_spec=None, fddot_grid_spec=None, num_pixels=None)[source]

Bases: object

Description.

__init__(wdm, num_freq_points=100, fdot_grid_spec=None, fddot_grid_spec=None, num_pixels=None)[source]
Parameters:
  • wdm (WDM.WDM) – An instance of the WDM wavelet transform class.

  • num_freq_points (int) – Number of frequency points in the interpolation grid. Optional.

  • fdot_grid_spec (tuple) – Specification for fdot grid as (min, max, num_points). Optional. Default is None, meaning no interpolation over fdot.

  • fddot_grid_spec (tuple) – Specification for fddot grid as (min, max, num_points). Optional. Default is None, meaning no interpolation over fddot.

  • num_pixels (int) – Number of time pixels to interpolate. If None, then use all Nf pixels. Optional.

Return type:

None

make_grids()[source]

Make the regular grid for interpolation.

Returns:

grids – The grid points for interpolation, shape=(num_freq_points, …).

Return type:

jnp.ndarray

make_interpolators()[source]

Create interpolators for the coefficients cnm, snm, chatnm and shatnm.

Returns:

interpolators – Four interpolators for cnm, snm, chatnm, shatnm.

Return type:

tuple

coeffs(F, fdot=None, fddot=None)[source]

Interpolate to get the coefficients at given parameters.

Parameters:
  • F (jnp.ndarray) – Frequencies, shape=(Nt,).

  • fdot (jnp.ndarray) – Frequency derivatives, shape=(Nt,).

  • fddot (jnp.ndarray) – Frequency second derivatives, shape=(Nt,).

Returns:

values – The quantities. Each of these are jnp.ndarray with shape=(Nt, Nf).

Return type:

tuple

cnm_snm(A_n, phi_n, f_n, fdot_n=None, fddot_n=None)[source]

Transformer.

Parameters:
  • A_n (jnp.ndarray) – The waveform amplitude \(A(t_n)\) evaluated at the sparse wavelet times \(t_n = n \Delta T\).

  • phi_n (jnp.ndarray) – The waveform phase \(\Phi(t_n)\) [rad] evaluated at the sparse wavelet times \(t_n = n \Delta T\).

  • f_n (jnp.ndarray) – The waveform frequency \(f(t_n)\) [Hz] evaluated at the sparse wavelet times \(t_n = n \Delta T\).

  • fdot_n (jnp.ndarray) – The frequency derivative \(\dot{f}(t_n)\) [Hz/s] evaluated at the sparse wavelet times \(t_n = n \Delta T\).

  • fddot (jnp.ndarray) – The frequency second derivative \(\ddot{f}(t_n)\) [Hz/s] evaluated at the sparse wavelet times \(t_n = n \Delta T\).

Return type:

CNM, SNM, CHATNM, SHATNM

transform(A_n, phi_n, f_n, fdot_n=None, fddot_n=None)[source]

Transformer.

Parameters:
  • A_n (jnp.ndarray) – The waveform amplitude \(A(t_n)\) evaluated at the sparse wavelet times \(t_n = n \Delta T\).

  • phi_n (jnp.ndarray) – The waveform phase \(\Phi(t_n)\) [rad] evaluated at the sparse wavelet times \(t_n = n \Delta T\).

  • f_n (jnp.ndarray) – The waveform frequency \(f(t_n)\) [Hz] evaluated at the sparse wavelet times \(t_n = n \Delta T\).

  • fdot_n (jnp.ndarray) – The frequency derivative \(\dot{f}(t_n)\) [Hz/s] evaluated at the sparse wavelet times \(t_n = n \Delta T\).

  • fddot (jnp.ndarray) – The frequency second derivative \(\ddot{f}(t_n)\) [Hz/s] evaluated at the sparse wavelet times \(t_n = n \Delta T\).

Returns:

wnm – The wavelet coefficients of the waveform; the real part if the plus polarisation, the imaginary part is the cross polarisation. Array shape=(self.wdm.Nt, self.wdm.Nf), dtype=complex.

Return type:

jnp.ndarray