GBGPU Utility Functions

Gravitational-wave utilities

gbgpu.utils.utility.AET(X, Y, Z)

Return the A,E,T channels from X,Y,Z

Parameters:
  • X (xp.ndarray) – Arrays holding XYZ TDI information. The signals can be in any domain.

  • Y (xp.ndarray) – Arrays holding XYZ TDI information. The signals can be in any domain.

  • Z (xp.ndarray) – Arrays holding XYZ TDI information. The signals can be in any domain.

Returns:

(A,E,T) with array shapes the same as the input XYZ.

Return type:

Tuple

gbgpu.utils.utility.get_fGW(f0, fdot, fddot, t, xp=None)

Get instantaneous frequency of gravitational wave

Computes \(f(t)\approx f_0 + \dot{f}_0 t + \frac{1}{2}\ddot{f}_0 t^2.\) This assumes the initial time is 0.

Parameters:
  • f0 (1D xp.ndarray) – Initial frequency of source in Hz. Shape is (num_bin_all,).

  • fdot (1D xp.ndarray) – Initial frequency derivative of source in Hz/s. Shape is (num_bin_all,).

  • fddot (1D xp.ndarray) – Initial second derivative of the frequency of source in Hz/s^2. Shape is (num_bin_all,).

  • t (xp.ndarray) – Time values at which to evaluate the frequencies. If t.ndim > 1, it will cast the frequency information properly. In this case, t.shape[0] must be equal to num_bin_all.

Returns:

All frequencies evaluated at the given times.

Return type:

xp.ndarray

Raises:

AssertionErrort.shape[0] != num_bin_all and t.shape[0] != 1.

gbgpu.utils.utility.get_chirp_mass(m1, m2)

Get chirp mass

Parameters:
  • m1 (xp.ndarray) – Mass 1.

  • m2 (xp.ndarray) – Mass 2.

Returns:

Chirp mass.

Return type:

xp.ndarray

gbgpu.utils.utility.get_eta(m1, m2)

Get symmetric mass ratio

Parameters:
  • m1 (xp.ndarray) – Mass 1.

  • m2 (xp.ndarray) – Mass 2.

Returns:

Symetric mass ratio.

Return type:

xp.ndarray

gbgpu.utils.utility.get_amplitude(m1, m2, f, d)

Get amplitude of GW

Parameters:
  • m1 (xp.ndarray) – Mass 1 in solar masses.

  • m2 (xp.ndarray) – Mass 2 in solar masses.

  • f (xp.ndarray) – Frequency of gravitational wave in Hz.

  • d (xp.ndarray) – Luminosity distance in kpc.

Returns:

Amplitude.

Return type:

xp.ndarray

gbgpu.utils.utility.get_fdot(f, m1=None, m2=None, Mc=None)

Get fdot of GW

Must provide either m1 and m2 or Mc.

Parameters:
  • f (xp.ndarray) – Frequency of gravitational wave in Hz.

  • m1 (xp.ndarray, optional) – Mass 1 in solar masses.

  • m2 (xp.ndarray, optional) – Mass 2 in solar masses.

  • Mc (xp.ndarray, optional) – Chirp mass in solar masses.

Returns:

fdot.

Return type:

xp.ndarray

Raises:
  • ValueError – Inputs are incorrect.

  • AssertionError – Inputs are incorrect.

gbgpu.utils.utility.get_chirp_mass_from_f_fdot(f, fdot)

Get chirp mass from f and fdot of GW

Parameters:
  • f (xp.ndarray) – Frequency of gravitational wave in Hz.

  • fdot (xp.ndarray) – Frequency derivative of gravitational wave in Hz/s.

Returns:

chirp mass.

Return type:

xp.ndarray

gbgpu.utils.utility.get_N(amp, f0, Tobs, oversample=1)

Determine sampling rate for slow part of FastGB waveform.

Parameters:
  • amp (xp.ndarray) – Amplitude of gravitational wave.

  • f0 (xp.ndarray) – Frequency of gravitational wave in Hz.

  • Tobs (double) – Observation time in seconds.

  • oversample (int, optional) – Oversampling factor. This function will return oversample * N, if N is the determined sample number. (Default: 1).

Returns:

N values for each binary entered.

Return type:

int xp.ndarray

Other utilities

gbgpu.utils.utility.cuda_set_device(dev)

Globally sets CUDA device

Parameters:

dev (int) – CUDA device number.