Handling Orbits - B612-Asteroid-Institute/orb_it GitHub Wiki

This page will explain how to use Orbital States with orb_it!

Orbits Object ~raiden.Orbits()

Orbits class to handle state vector orbits for orb_it testing.

Parameters

  • data: str or ~pandas.DataFrame, Path to the .csv file or pandas DataFrame containing the orbit data. Must have the following columns:

    • x: float, x element of the state vector in Astronomical Units.
    • y: float, y element of the state vector in Astronomical Units.
    • z: float, z element of the state vector in Astronomical Units.
    • vx: float, x velocity element of the state vector in Astronomical Units per day.
    • vy: float, y velocity element of the state vector in Astronomical Units per day.
    • vz: float, z velocity element of the state vector in Astronomical Units per day.
    • epoch or mjd_tdb: float, also can be a ~astropy.time.core.Time object converted to float, Time of the state vector in mjd with a tdb scale.
  • epochs : List of ~astropy.time.core.Time, optional, Times corresponding to the state vectors given.

  • ids : list of strings, optional, Names or orbit ids of the objects/orbits given.

  • H : list of floats, optional, List of Magnitudes for the orbits given.

  • G : list of floats, optional, List of Magnitude Slopes for the orbits given.

Attributes

  • data : ~pandas.DataFrame, Unformatted DataFrame given at initialization.
  • df : ~pandas.DataFrame, Standard formatted DataFrame of data given.
  • epochs : List of ~astropy.time.core.Time, Astropy time object of all the times for every orbit. In mjd format and tdb scale.
  • num_orbits : int, Number of orbits contained in the object.
  • ids : ~numpy.ndrray, List of names of the objects/orbits given.
  • cartesian : 2D,~numpy.ndarray, List of the cartestian state vectors (x, y, z, vx, vy, vz) for each orbit.
  • cartesian_units : list of ~astropy.units, List of units used for the state vectors.
  • H : list of floats or None, List of Magnitudes for the orbits given.
  • G : list of floats or None, List of Magnitude Slopes for the orbits given.

Indexing

Orbits objects can be indexed so that many orbit states can be listed in one object. Every attribute also has the ability to be iterated over.

Initialization Methods

This is how you can create an orbits object.

loadOrb()

Load orbit data from a .csv file or pandas DataFrame.

Parameters

  • data: str or ~pandas.DataFrame Path to the .csv file or pandas DataFrame containing the orbit data. Must have the following columns:
    • x: float, x element of the state vector in Astronomical Units.
    • y: float, y element of the state vector in Astronomical Units.
    • z: float, z element of the state vector in Astronomical Units.
    • vx: float, x velocity element of the state vector in Astronomical Units per day.
    • vy: float, y velocity element of the state vector in Astronomical Units per day.
    • vz: float, z velocity element of the state vector in Astronomical Units per day.
    • epoch or mjd_tdb: float, also can be a astropy.time.core.Time object converted to float Time of the state vector in mjd with a tdb scale.

Returns

  • orbits : orbit object ~orb_it.raiden.Orbits

Example

# loading in a .csv file with the columns stated above
orbits = loadOrb("orbits.csv")

getOrbHorizons()

Gets the orbital state vector from JPL Horizons for a given target and time.

Parameters

  • target : str or list of str, Name(s) of the target to get the orbital state vector for.
  • t0 : ~astropy.time.core.Time, Time object with scale='tdb' format='mjd' for the time of the state vector.

Returns

  • orbits : orbit object, ~orb_it.raiden.Orbits

Example

# Querying for 202930 Ivezic (1998 SG172) at 59000 mjd
orbits = getOrbHorizons('202930', Time(59000, format='mjd', scale='tdb'))