gwkokab.utils.transformations ============================= .. py:module:: gwkokab.utils.transformations Functions --------- .. autoapisummary:: gwkokab.utils.transformations.Mc_eta_to_m1_m2 gwkokab.utils.transformations.cart_to_polar gwkokab.utils.transformations.cart_to_spherical gwkokab.utils.transformations.chi_costilt_to_chiz gwkokab.utils.transformations.chi_p_from_components gwkokab.utils.transformations.chieff gwkokab.utils.transformations.chirp_mass gwkokab.utils.transformations.chirp_mass_from_m1_q gwkokab.utils.transformations.delta_m gwkokab.utils.transformations.delta_m_to_symmetric_mass_ratio gwkokab.utils.transformations.eta_from_q gwkokab.utils.transformations.log_chirp_mass gwkokab.utils.transformations.m1_m2_chi1_chi2_costilt1_costilt2_to_chieff gwkokab.utils.transformations.m1_m2_chi1_chi2_costilt1_costilt2_to_chiminus gwkokab.utils.transformations.m1_m2_chi1z_chi2z_to_chiminus gwkokab.utils.transformations.m1_m2_chieff_chiminus_to_chi1z_chi2z gwkokab.utils.transformations.m1_q_to_m2 gwkokab.utils.transformations.m1_times_m2 gwkokab.utils.transformations.m2_q_to_m1 gwkokab.utils.transformations.m_det_z_to_m_source gwkokab.utils.transformations.m_source_z_to_m_det gwkokab.utils.transformations.mass_ratio gwkokab.utils.transformations.polar_to_cart gwkokab.utils.transformations.q_from_eta gwkokab.utils.transformations.reduced_mass gwkokab.utils.transformations.sin_tilt gwkokab.utils.transformations.spherical_to_cart gwkokab.utils.transformations.spin_costilt_from_components gwkokab.utils.transformations.spin_magnitude_from_components gwkokab.utils.transformations.symmetric_mass_ratio gwkokab.utils.transformations.symmetric_mass_ratio_to_delta_m gwkokab.utils.transformations.total_mass Module Contents --------------- .. py:function:: Mc_eta_to_m1_m2(Mc: jaxtyping.ArrayLike, eta: jaxtyping.ArrayLike) -> tuple[jaxtyping.ArrayLike, jaxtyping.ArrayLike] .. math:: \begin{align*} m_1(M_c, \eta) &= \frac{M_c}{2} \eta^{-0.6} (1 + \sqrt{1 - 4\eta}) \\ m_2(M_c, \eta) &= \frac{M_c}{2} \eta^{-0.6} (1 - \sqrt{1 - 4\eta}) \end{align*} .. py:function:: cart_to_polar(x: jaxtyping.ArrayLike, y: jaxtyping.ArrayLike) -> tuple[jaxtyping.ArrayLike, jaxtyping.ArrayLike] .. math:: \begin{align*} r(x, y) &= \sqrt{x^2 + y^2} \\ \theta(x, y) &= \arctan(y/x) \end{align*} .. py:function:: cart_to_spherical(x: jaxtyping.ArrayLike, y: jaxtyping.ArrayLike, z: jaxtyping.ArrayLike) -> tuple[jaxtyping.ArrayLike, jaxtyping.ArrayLike, jaxtyping.ArrayLike] .. math:: \begin{align*} r(x, y, z) &= \sqrt{x^2 + y^2 + z^2} \\ \theta(x, y, z) &= \arccos\left(\frac{z}{r}\right) \\ \phi(x, y, z) &= \arctan\left(\frac{y}{x}\right) \end{align*} .. py:function:: chi_costilt_to_chiz(chi: jaxtyping.ArrayLike, costilt: jaxtyping.ArrayLike) -> jaxtyping.ArrayLike .. math:: \chi_z(\chi, \cos(\theta)) = \chi \cos(\theta) .. py:function:: chi_p_from_components(a_1: jaxtyping.ArrayLike, cos_tilt_1: jaxtyping.ArrayLike, a_2: jaxtyping.ArrayLike, cos_tilt_2: jaxtyping.ArrayLike, mass_ratio: jaxtyping.ArrayLike) -> jaxtyping.ArrayLike .. math:: \chi_p(a_1, \cos(\theta_1), a_2, \cos(\theta_2), q) = \max \left( a_1 \sin(\theta_1), \frac{3 + 4q}{4 + 3q} q a_2 \sin(\theta_2) \right) .. py:function:: chieff(m1: jaxtyping.ArrayLike, m2: jaxtyping.ArrayLike, chi1z: jaxtyping.ArrayLike, chi2z: jaxtyping.ArrayLike) -> jaxtyping.ArrayLike .. math:: \chi_{\text{eff}}(m_1, m_2, \chi_{1z}, \chi_{2z}) = \frac{m_1\chi_{1z} + m_2\chi_{2z}}{m_1 + m_2} .. py:function:: chirp_mass(m1: jaxtyping.ArrayLike, m2: jaxtyping.ArrayLike) -> jaxtyping.ArrayLike .. math:: M_c(m_1, m_2) = \frac{(m_1m_2)^{3/5}}{(m_1 + m_2)^{1/5}} .. py:function:: chirp_mass_from_m1_q(m1: jaxtyping.ArrayLike, q: jaxtyping.ArrayLike) -> jaxtyping.ArrayLike .. math:: M_c(m_1, q) = \frac{(m_1^3 q^3)^{1/5}}{(m_1 + m_1 q)^{1/5}} = m_1 \frac{q^{3/5}}{(1 + q)^{1/5}} .. py:function:: delta_m(m1: jaxtyping.ArrayLike, m2: jaxtyping.ArrayLike) -> jaxtyping.ArrayLike .. math:: \delta_m(m_1, m_2) = \frac{m_1 - m_2}{m_1 + m_2} .. py:function:: delta_m_to_symmetric_mass_ratio(delta_m: jaxtyping.ArrayLike) -> jaxtyping.ArrayLike .. math:: \eta(\delta_m) = \frac{1 - \delta_m^2}{4} .. py:function:: eta_from_q(q: jaxtyping.ArrayLike) -> jaxtyping.ArrayLike .. math:: \eta(q) = \frac{q}{(1 + q)^2} .. py:function:: log_chirp_mass(m1: jaxtyping.ArrayLike, m2: jaxtyping.ArrayLike) -> jaxtyping.ArrayLike .. math:: \log(M_c(m_1, m_2)) = 3/5\times (\log(m_1) + \log(m_2)) - \log(m_1 + m_2)/5 .. py:function:: m1_m2_chi1_chi2_costilt1_costilt2_to_chieff(*, m1: jaxtyping.ArrayLike, m2: jaxtyping.ArrayLike, chi1: jaxtyping.ArrayLike, chi2: jaxtyping.ArrayLike, costilt1: jaxtyping.ArrayLike, costilt2: jaxtyping.ArrayLike) -> jaxtyping.ArrayLike .. math:: \chi_{\text{eff}}(m_1, m_2, \chi_1, \chi_2, \cos(\theta_1), \cos(\theta_2)) = \frac{m_1\chi_1\cos(\theta_1) + m_2\chi_2\cos(\theta_2)}{m_1 + m_2} .. py:function:: m1_m2_chi1_chi2_costilt1_costilt2_to_chiminus(*, m1: jaxtyping.ArrayLike, m2: jaxtyping.ArrayLike, chi1: jaxtyping.ArrayLike, chi2: jaxtyping.ArrayLike, costilt1: jaxtyping.ArrayLike, costilt2: jaxtyping.ArrayLike) -> jaxtyping.ArrayLike .. math:: \chi_{\text{minus}}(m_1, m_2, \chi_1, \chi_2, \cos(\theta_1), \cos(\theta_2)) = \frac{m_1\chi_1\cos(\theta_1) - m_2\chi_2\cos(\theta_2)}{m_1 + m_2} .. py:function:: m1_m2_chi1z_chi2z_to_chiminus(m1: jaxtyping.ArrayLike, m2: jaxtyping.ArrayLike, chi1z: jaxtyping.ArrayLike, chi2z: jaxtyping.ArrayLike) -> jaxtyping.ArrayLike .. math:: \chi_{\text{minus}}(m_1, m_2, \chi_{1z}, \chi_{2z}) = \frac{m_1\chi_{1z} - m_2\chi_{2z}}{m_1 + m_2} .. py:function:: m1_m2_chieff_chiminus_to_chi1z_chi2z(m1: jaxtyping.ArrayLike, m2: jaxtyping.ArrayLike, chieff: jaxtyping.ArrayLike, chiminus: jaxtyping.ArrayLike) -> tuple[jaxtyping.ArrayLike, jaxtyping.ArrayLike] .. math:: \begin{align*} \chi_{1z}(m_1, m_2, \chi_{\text{eff}}, \chi_{\text{minus}}) &= \frac{m_1+m_2}{2m_1} \left( \chi_{\text{eff}} + \chi_{\text{minus}} \right)\\ \chi_{2z}(m_1, m_2, \chi_{\text{eff}}, \chi_{\text{minus}}) &= \frac{m_1+m_2}{2m_2} \left( \chi_{\text{eff}} - \chi_{\text{minus}} \right) \end{align*} .. py:function:: m1_q_to_m2(m1: jaxtyping.ArrayLike, q: jaxtyping.ArrayLike) -> jaxtyping.ArrayLike .. math:: m_2(m_1, q) = m_1q .. py:function:: m1_times_m2(m1: jaxtyping.ArrayLike, m2: jaxtyping.ArrayLike) -> jaxtyping.ArrayLike .. math:: m_1m_2(m_1, m_2) = m_1 m_2 .. py:function:: m2_q_to_m1(m2: jaxtyping.ArrayLike, q: jaxtyping.ArrayLike) -> jaxtyping.ArrayLike .. math:: m_1(m_2, q) = \frac{m_2}{q} .. py:function:: m_det_z_to_m_source(m_det: jaxtyping.ArrayLike, z: jaxtyping.ArrayLike) -> jaxtyping.ArrayLike .. math:: m_{\text{source}}(m_{\text{det}}, z) = \frac{m_{\text{det}}}{1 + z} .. py:function:: m_source_z_to_m_det(m_source: jaxtyping.ArrayLike, z: jaxtyping.ArrayLike) -> jaxtyping.ArrayLike .. math:: m_{\text{det}}(m_{\text{source}}, z) = m_{\text{source}}(1 + z) .. py:function:: mass_ratio(m1: jaxtyping.ArrayLike, m2: jaxtyping.ArrayLike) -> jaxtyping.ArrayLike .. math:: q(m_1, m_2) = \frac{m_2}{m_1} .. py:function:: polar_to_cart(r: jaxtyping.ArrayLike, theta: jaxtyping.ArrayLike) -> tuple[jaxtyping.ArrayLike, jaxtyping.ArrayLike] .. math:: \begin{align*} x(r, \theta) &= r \cos(\theta) \\ y(r, \theta) &= r \sin(\theta) \end{align*} .. py:function:: q_from_eta(eta: jaxtyping.ArrayLike) -> jaxtyping.ArrayLike .. math :: q(\eta) = \frac{1 - 2\eta - \sqrt{1 - 4\eta}}{2\eta} :param eta: Symmetric mass ratio :type eta: ArrayLike :returns: Mass ratio :rtype: ArrayLike .. py:function:: reduced_mass(m1: jaxtyping.ArrayLike, m2: jaxtyping.ArrayLike) -> jaxtyping.ArrayLike .. math:: M_r(m_1, m_2) = \frac{m_1m_2}{m_1 + m_2} .. py:function:: sin_tilt(costilt: jaxtyping.ArrayLike) -> jaxtyping.ArrayLike .. math:: \sin(\theta) = \sqrt{1 - \cos^2(\theta)} .. py:function:: spherical_to_cart(r: jaxtyping.ArrayLike, theta: jaxtyping.ArrayLike, phi: jaxtyping.ArrayLike) -> tuple[jaxtyping.ArrayLike, jaxtyping.ArrayLike, jaxtyping.ArrayLike] .. math:: \begin{align*} x(r, \theta, \phi) &= r \sin(\theta) \cos(\phi) \\ y(r, \theta, \phi) &= r \sin(\theta) \sin(\phi) \\ z(r, \theta, \phi) &= r \cos(\theta) \end{align*} .. py:function:: spin_costilt_from_components(chi_x: jaxtyping.ArrayLike, chi_y: jaxtyping.ArrayLike, chi_z: jaxtyping.ArrayLike) -> jaxtyping.ArrayLike .. math:: \cos(\theta)(\chi_x, \chi_y, \chi_z) = \frac{\chi_z}{\sqrt{\chi_x^2 + \chi_y^2 + \chi_z^2}} .. py:function:: spin_magnitude_from_components(chi_x: jaxtyping.ArrayLike, chi_y: jaxtyping.ArrayLike, chi_z: jaxtyping.ArrayLike) -> jaxtyping.ArrayLike .. math:: \chi(\chi_x, \chi_y, \chi_z) = \sqrt{\chi_x^2 + \chi_y^2 + \chi_z^2} .. py:function:: symmetric_mass_ratio(m1: jaxtyping.ArrayLike, m2: jaxtyping.ArrayLike) -> jaxtyping.ArrayLike .. math:: \eta(m_1, m_2) = \frac{m_1m_2}{(m_1 + m_2)^2} .. py:function:: symmetric_mass_ratio_to_delta_m(eta: jaxtyping.ArrayLike) -> jaxtyping.ArrayLike .. math:: \delta_m(\eta) = \sqrt{1 - 4\eta} .. py:function:: total_mass(m1: jaxtyping.ArrayLike, m2: jaxtyping.ArrayLike) -> jaxtyping.ArrayLike .. math:: M(m_1, m_2) = m_1 + m_2