N-body Backend

orbitize.nbody.calc_orbit(epochs, sma, ecc, inc, aop, pan, tau, plx, mtot, tau_ref_epoch=58849, m_pl=None, output_star=False)[source]

Solves for position for a set of input orbital elements using rebound.

  • epochs (np.array) – MJD times for which we want the positions of the planet

  • sma (np.array) – semi-major axis of orbit [au]

  • ecc (np.array) – eccentricity of the orbit [0,1]

  • inc (np.array) – inclination [radians]

  • aop (np.array) – argument of periastron [radians]

  • pan (np.array) – longitude of the ascending node [radians]

  • tau (np.array) – epoch of periastron passage in fraction of orbital period past MJD=0 [0,1]

  • plx (np.array) – parallax [mas]

  • mtot (np.array) – total mass of the two-body orbit (M_* + M_planet) [Solar masses]

  • tau_ref_epoch (float, optional) – reference date that tau is defined with respect to

  • m_pl (np.array, optional) – mass of the planets[units]

  • output_star (bool) – if True, also return the position of the star relative to the barycenter.


raoff (np.array): array-like (n_dates x n_orbs) of RA offsets between

the bodies (origin is at the other body) [mas]

deoff (np.array): array-like (n_dates x n_orbs) of Dec offsets between

the bodies [mas]

vz (np.array): array-like (n_dates x n_orbs) of radial velocity of

one of the bodies (see mass_for_Kamp description) [km/s]

Return type



return is in format [raoff[planet1, planet2,…,planetn], deoff[planet1, planet2,…,planetn], vz[planet1, planet2,…,planetn]