sage.core.conversions
Filename : conversions.py Description : Short description of the file
Created on 2026-01-20 16:26:05
__author__ = Narenraju Nagarajan __copyright__ = Copyright 2026, ProjectName __license__ = MIT Licence __version__ = 0.0.1 __maintainer__ = Narenraju Nagarajan __affiliation__ = N/A __email__ = N/A __status__ = [‘inProgress’, ‘Archived’, ‘inUsage’, ‘Debugging’]
GitHub Repository: NULL
Documentation: NULL
Functions
|
Convert a duration in seconds to a sample count. |
|
Convert a sample count to a duration in seconds. |
|
Convert chirp mass and symmetric mass ratio to individual component masses. |
|
Returns the symmetric mass ratio from mass1 and mass2. |
|
Returns the chirp mass from mass1 and mass2. |
|
Convert component masses to chirp mass and symmetric mass ratio. |
Module Contents
- seconds_to_samples(nseconds, sample_rate, approx_mode=int, rounding=True)[source]
Convert a duration in seconds to a sample count.
- Parameters:
- Returns:
Number of samples corresponding to the given duration.
- Return type:
int (or approx_mode result)
- mchirp_eta_to_mass1_mass2(mchirp, eta)[source]
Convert chirp mass and symmetric mass ratio to individual component masses.
- Parameters:
mchirp (torch.Tensor) – Chirp mass of the binary (any units)
eta (torch.Tensor) – Symmetric mass ratio (dimensionless, 0 < eta <= 0.25)
- Returns:
m1 : Mass of the heavier component
m2 : Mass of the lighter component
- Return type:
Notes
The returned masses satisfy m1 >= m2.
Component masses are in the same units as the input chirp mass.
- mass1_mass2_to_mchirp_eta(mass1, mass2)[source]
Convert component masses to chirp mass and symmetric mass ratio.
- Parameters:
mass1 (array-like) – Component masses (any consistent units).
mass2 (array-like) – Component masses (any consistent units).
- Returns:
(mchirp, eta)— chirp mass and symmetric mass ratio.- Return type: