eccentricity_and_omega

ell1fit.eccentricity.eccentricity_and_omega(eps1, eps2)[source]

Convert EPS1/EPS2 samples into eccentricity and periastron angle.

Parameters:
eps1, eps2array-like

Paired posterior samples of \(e\sin\omega\) and \(e\cos\omega\). Pairing matters: entry i of both must come from the same step of the chain.

Returns:
eccentricitynp.ndarray

\(\sqrt{\epsilon_1^2 + \epsilon_2^2}\), one value per sample.

omega_degnp.ndarray

\(\mathrm{atan2}(\epsilon_1, \epsilon_2)\) in degrees, wrapped to [0, 360).

Examples

>>> ecc, om = eccentricity_and_omega([0.0, 3e-3], [2e-3, 0.0])
>>> np.allclose(ecc, [2e-3, 3e-3])
True
>>> np.allclose(om, [0.0, 90.0])
True