bahamas.psd_response

Submodules

bahamas.psd_response.average_envelope

This module contains the function envelopes_gaussian, which computes the envelopes of the A and E signals for sources centered at a given sky position, averaged over inclination and polarization, with a Gaussian distribution with given standard deviations along two principal axes rotated with respect to the latitude and longitude. The function takes as input the ecliptic latitude and longitude, the standard deviations along the two principal axes, the rotation angle between the ecliptic longitude/latitude and the principal axes, the orbital frequency of LISA barycenter, the time, the initial phase of LISA barycenter, the initial rotation of satellites in the detector plane, and a flag for TDI. It returns the envelopes of the A and E signals.

bahamas.psd_response.average_envelope.average_envelopes_gaussian(SinEclipticLatitude, EclipticLongitude, Sigma1, Sigma2, sinPsi, t1, t2, LISA_Orbital_Freq, alpha0=0.0, beta0=0.0, tdi=0)

Returns the envelopes of the A and E signals for sources centered at the given sky position, averaged over inclination and polarization, with some gaussian distribution with given standard deviations along two principal axes rotated with respect to the latitude and longitude

Parameters:
  • SinEclipticLatitude – Sine sky position param

  • EclipticLongitude – Sky position param

  • Sigma1 – squared of Standard deviation along the first principal axis

  • Sigma2 – squared of Standard deviation along the second principal axis

  • sinPsi – sine of the angle between the two principal axes

  • LISA_Orbital_Freq – orbital frequency of LISA barycenter (1 / year)

  • t – time

  • alpha0 – initial phase of LISA barycenter

  • beta0 – initial rotation of satellites in detector plane

Returns:

A(t), E(t)

bahamas.psd_response.modulation

This module contains the function to compute the envelopes of the A and E signals as functions of time for sources centered at a given sky position, averaged over inclination and polarization. It uses a Gaussian distribution with specified standard deviations along two principal axes rotated with respect to the latitude and longitude. The function envelopes_gaussian computes the envelopes based on the provided parameters.

bahamas.psd_response.modulation.envelopes_gaussian(EclipticLatitude, EclipticLongitude, Sigma1, Sigma2, sinPsi, LISA_Orbital_Freq, t, alpha0=0.0, beta0=0.0)

Returns the envelopes of the A and E signals for sources centered at the given sky position, averaged over inclination and polarization, with some gaussian distribution with given standard deviations along two principal axes rotated with respect to the latitude and longitude

Parameters:
  • SinEclipticLatitude – Sine sky position param

  • EclipticLongitude – Sky position param

  • Sigma1 – squared of Standard deviation along the first principal axis

  • Sigma2 – squared of Standard deviation along the second principal axis

  • sinPsi – Sine of the angle between the two principal axes

  • LISA_Orbital_Freq – orbital frequency of LISA barycenter (1 / year)

  • t – time

  • alpha0 – initial phase of LISA barycenter

  • beta0 – initial rotation of satellites in detector plane

Returns:

A(t), E(t)

bahamas.psd_response.orbits

This module contains the class SpacecraftOrbit, which is used to compute the positions of spacecraft in a LISA-like formation. The class is initialized with the following parameters: - L_init: arm length (default: 8.3) - phi_init: initial phase (default: 0) - lambda_init: initial angle (default: 0) - R_init: distance from the Sun (default: 1 AU) - orbitFreq_init: orbital frequency (default: 1.99106488756578923121e-7) - ecc_order_init: order of the eccentricity expansion (default: 2) - The class has methods to compute the positions of the spacecraft at a given time and to compute the versor of the links between spacecraft.

class bahamas.psd_response.orbits.SpacecraftOrbit(L_init=8.3, phi_init=0.0, lambda_init=0.0, R_init=499.00478383615643, orbitFreq_init=1.9910648875657891e-07, ecc_order_init=2)

Bases: object

Class to compute the positions of spacecraft in a LISA-like formation. The class is initialized with the following parameters: - L_init: arm length (default: 8.3) - phi_init: initial phase (default: 0) - lambda_init: initial angle (default: 0) - R_init: distance from the Sun (default: 1 AU) - orbitFreq_init: orbital frequency (default: 1.99106488756578923121e-7) - ecc_order_init: order of the eccentricity expansion (default: 2)

SC_positions(t)

Compute the positions of the spacecraft at a given time. :param t: Time in seconds. :type t: float

Returns:

Positions of the spacecraft in a 3x3 array.

Return type:

np.ndarray

compute_factors()

Precompute the factors for the spacecraft positions.

Compute the versor of the link between two spacecraft. :param t: Time in seconds. :type t: float :param link: Link number (-1, -2, -3 for opposite direction). :type link: int

Returns:

(versor, distance)

Return type:

tuple

bahamas.psd_response.response

This module provides functions and classes to compute the response of LISA (Laser Interferometer Space Antenna) to gravitational waves, including TDI (Time-Delay Interferometry) responses and simplified response functions.

Functions:

cartesian_to_spherical(vec): Converts a 3D Cartesian vector to spherical coordinates. sinc(SC, freqs, t, khat, link): Computes the sinc function for LISA’s single-arm response. phase(SC, freqs, t, khat, link): Computes the phase response for a given link. antenna_pattern(SC, t, khat, link, polarization): Computes the antenna pattern for a given polarization. get_response(freq, tdi): Computes the response for a specific TDI channel (A, E, or T). raa(freqs, L): Simplified response function for isotropic, stationary SGWB (A channel). rtt(freqs, L): Simplified response function for isotropic, stationary SGWB (T channel).

Classes:

SGWBResponseStationary: Computes the stationary response of LISA to an isotropic SGWB. Mtdi: Handles TDI matrix computations for different generations (1 or 2). TDImatrix: Combines TDI matrices with response functions to compute the full response matrix.

Dependencies:
  • NumPy

  • Healpy

  • SciPy

  • orbits (custom module)

class bahamas.psd_response.response.Mtdi(freq, gen2=1, L_map=None)

Bases: object

Handles TDI matrix computations for different generations (1 or 2).

Maet(f, gen2=None)

Converts the TDI matrix from XYZ to AET coordinates.

Parameters:
  • f (float) – Frequency in Hz.

  • gen2 (int, optional) – TDI gen2eration. If None, uses self.gen2.

Returns:

3x6 complex matrix for AET channels.

Return type:

np.ndarray

Mwrap(type='AET')

Computes the TDI transfer matrix for all frequencies.

Parameters:

type (str) – TDI type (‘AET’ or ‘XYZ’).

Returns:

A (3, 6, Nf) complex array where Nf = len(self.freq),

representing the TDI matrix at all frequencies.

Return type:

np.ndarray

Mxyz(f, gen2=False)

Returns the TDI matrix (X, Y, Z) for the specified gen2eration.

Parameters:
  • f (float) – Frequency in Hz.

  • gen2 (int) – gen2eration of TDI (1 or 2).

Returns:

A 3x6 complex matrix mapping link measurements to TDI variables.

Return type:

np.ndarray

delay(f, *link_labels)

Compute compound delay operator D_{i…}(f) = exp(-2πif (L1 + L2 + …)). :param f: Frequency. :type f: float :param link_labels: List of link labels. :type link_labels: list

Returns:

Compound delay operator.

Return type:

complex

get_M_TDI1(f)

Build the 3x6 M_TDI(f) matrix for Michelson observables (X, Y, Z). :param f: Frequency. :type f: float

Returns:

TDI matrix.

Return type:

np.ndarray

get_M_TDI2(f)

Build the 3x6 M_TDI(f) matrix for second-gen2eration Michelson observables (X2, Y2, Z2).

Parameters:

f (float) – Frequency.

Returns:

Second-gen2eration TDI matrix.

Return type:

np.ndarray

class bahamas.psd_response.response.SGWBResponseStationary(freqs, t=21037939, nside=4, nest=False)

Bases: object

Initialize the SGWBResponseStationary class.

Parameters:
  • freqs (array-like) – Frequency array.

  • t (float) – Time at which the response is calculated.

  • nside (int) – Healpy nside parameter for pixelization.

  • nest (bool) – Whether to use nested pixel ordering.

  • equal_arm (float, optional) – Length of the arm if not using the spacecraft orbit. Defaults to False.

GbarGbarConj(l, lp, p)

Computes the conjugate of the GbarGbar response.

Parameters:
  • l (int) – Link index.

  • lp (int) – Link index for the second arm.

  • polarization (str) – Polarization type (‘plus’ or ‘cross’).

Returns:

Conjugate response array.

Return type:

np.ndarray

Response(polarization='plus')

Computes the response matrix for a given polarization.

Parameters:

polarization (str) – Polarization type (‘plus’ or ‘cross’).

Returns:

Response matrix.

Return type:

np.ndarray

get_khats()

Generates all khats in Cartesian coordinates based on Healpy pixelization.

Returns:

Array of khats in Cartesian coordinates.

Return type:

np.ndarray

class bahamas.psd_response.response.TDImatrix(freq, gen2=1, nside=4, type='AET', equal_arm=False)

Bases: object

Combines TDI matrices with response functions to compute the full response matrix.

matrix()
bahamas.psd_response.response.antenna_pattern(SC, t, khat, link, polarization)

Computes the antenna pattern for a given polarization.

Parameters:
  • SC (SpacecraftOrbit) – Object containing the spacecraft orbit description.

  • t (float) – Time at which the response is calculated.

  • khat (array-like) – Unit vector in the direction of the source.

  • link (int) – Link number (1, 2, 3, -1, -2, -3).

  • polarization (str) – Polarization type (‘plus’ or ‘cross’).

Returns:

Antenna pattern value.

Return type:

float

bahamas.psd_response.response.cartesian_to_spherical(vec)

Converter from 3D cartesian coordinates to 2D spherical coordinates (assuming unitary radius)

Parameters:

vec (float) – 3D vector in cartesian coordinates

Returns:

2D vector in spherical coordinates

Return type:

numpy.array

bahamas.psd_response.response.fract_freq(SC, freqs, t, khat, link)

Computes the fractional frequency factor for a given link. :param SC: Object containing the spacecraft orbit description. :type SC: SpacecraftOrbit :param freqs: Frequencies at which the response is evaluated. :type freqs: array-like :param t: Time at which the response is calculated. :type t: float :param khat: Unit vector in the direction of the source. :type khat: array-like :param link: Link number (1, 2, 3, -1, -2, -3). :type link: int

Returns:

Fractional frequency factor as a function of frequency.

Return type:

array-like

bahamas.psd_response.response.get_response(freq, gen2=False, equal_arm=False, cross_term=False, tdi='AE')

Computes the response for a specific TDI channel (A, E, or T).

Parameters:
  • freq (array-like) – Frequency array.

  • tdi (str) – TDI channel (‘A’, ‘E’, or ‘T’).

  • gen2 (int) – TDI gen2eration (1 or 2).

  • equal_arm (float, optional) – Length of the arm if not using the spacecraft orbit. Defaults to False.

  • cross_term (bool, optional) – Whether to include cross terms in the response. Defaults to False.

  • tdi – TDI type (‘AE’ or ‘AET’).

Returns:

Response for the specified TDI channel.

Return type:

array-like

bahamas.psd_response.response.phase(SC, freqs, t, khat, link)

Computes the phase response for a given link.

Parameters:
  • SC (SpacecraftOrbit) – Object containing the spacecraft orbit description.

  • freqs (array-like) – Frequencies at which the response is evaluated.

  • t (float) – Time at which the response is calculated.

  • khat (array-like) – Unit vector in the direction of the source.

  • link (int) – Link number (1, 2, 3, -1, -2, -3).

  • equal_arm (float, optional) – Length of the arm if not using the spacecraft orbit. Defaults to False.

Returns:

Phase response as a function of frequency.

Return type:

array-like

bahamas.psd_response.response.sinc(SC, freqs, t, khat, link)

Sinc function for LISA single arm response given link, frequency, time, and unit vector in the direction of the source

Parameters:
  • SC (SpacecraftOrbit) – Object containing the spacecraft orbit description

  • freqs (numpy.array) – Frequencies at which the links unit vectors are evaluated

  • t (float) – Time at which the response is calculated

  • khat (numpy.array) – Unit vector in the direction of the source in cartesian coordinates

  • link (int) – Link number (1,2,3,-1,-2,-3)

Returns:

response as a function of frequency

Return type:

numpy.array