generate_component_spins

generate_component_spins(sample)[source]

Add Cartesian component spins to a copy of a sample.

For a precessing-spin sample, this function converts Bilby’s angular spin parameterisation with bilby.gw.conversion.bilby_to_lalsimulation_spins(). For an aligned-spin sample, it maps chi_1 and chi_2 directly onto the z-components and sets the in-plane components to zero.

Parameters:
sampledict or pandas.DataFrame

Sample containing either chi_1 and chi_2 for aligned spins, or all of the following parameters for a precessing-spin conversion:

  • theta_jn: zenith angle between the total angular momentum and the line of sight, in radians;

  • phi_jl: azimuthal angle of the Newtonian orbital angular momentum on its cone about the total angular momentum, in radians;

  • tilt_1, tilt_2: zenith angles between each spin and the Newtonian orbital angular momentum, in radians;

  • phi_12: difference between the spin azimuthal angles, in radians;

  • a_1, a_2: dimensionless spin magnitudes;

  • mass_1, mass_2: detector-frame component masses, in solar masses;

  • reference_frequency: non-zero reference gravitational-wave frequency, in Hz;

  • phase: orbital phase at reference_frequency, in radians.

Returns:
output_sampledict or pandas.DataFrame

A copy of sample. The precessing-spin conversion adds:

  • iota: zenith angle between the Newtonian orbital angular momentum and the line of sight, in radians;

  • spin_1x, spin_1y, spin_1z, spin_2x, spin_2y, and spin_2z: dimensionless Cartesian spin components in the frame used by lalsimulation waveform generators;

  • phi_1 and phi_2: azimuthal angles of the spin projections onto the Cartesian x-y plane, in radians.

The aligned-spin conversion adds only the six Cartesian spin components. If neither required parameter set is present, the copy is returned unchanged.