Backend Functions - B612-Asteroid-Institute/orb_it GitHub Wiki

This page explains the base backend functions and how to add your own integrator as a backend for orb_it.

Functions in backend.py

These are the base backend class functions.

backend._propagateOrbits()

Propagate orbits from t0 to t1.

THIS FUNCTION SHOULD BE DEFINED BY THE USER.

backend._generateEphemeris()

Generate ephemerides for the given orbits as observed by the observers.

THIS FUNCTION SHOULD BE DEFINED BY THE USER.

backend._orbitDetermination()

Fit ephemerides observations to determine orbit state.

THIS FUNCTION SHOULD BE DEFINED BY THE USER.

Modifying or Contributing New Integrator Support

These base backend functions serve as a groundwork for adding in a new backend class integrator. It acts as a super-class once you import Backend into your integrator.py file and use it in your class header. Example,

#importing Backend
from .backend import Backend

# Adding Backend into integrator class
class integrator(Backend):

It is necessary to call super().__init__(name="integratorname",**kwargs) in the class initializer function since the integrator needs a string name to work with orb_it.

If a function is not implemented in the backend, it will raise a NotImplementedError with the text "This backend does not have {function} implemented.".

In order to fully add in new integrator support, you must add the integrator backend class name to ./orb_it/orb_it/backend/__init__.py. This means it has to be in the ./backend/ directory in order for it to work.

Example,

# Adding new integrator to __init__.py
from .integrator import *

It should work just fine if the new integrator can take the same inputs and outputs as the ones currently supported. In general, new backends should be able to:

  • Handle Orbits Objects (Python Objects)
  • Read and Output Pandas DataFrames and .csv files
  • Can iterate over orbits (if given multiple orbits in one function call)