Modules documentation

Filters:

Triple Moving Average

Here we take the average of 3 terms x0, A, B where, x0 = The point to be estimated A = weighted average of n terms previous to x0 B = weighted avreage of n terms ahead of x0 n = window size

orbitdeterminator.filters.triple_moving_average.generate_filtered_data(filename, window)[source]

Apply the filter and generate the filtered data

Parameters:
  • filename (string) – the name of the .csv file containing the positional data
  • window (int) – window size applied into the filter
Returns:

the final filtered array

Return type:

numpy array

orbitdeterminator.filters.triple_moving_average.triple_moving_average(signal_array, window_size)[source]

Apply triple moving average to a signal

Parameters:
  • signal_array (numpy array) – the array of values on which the filter is to be applied
  • window_size (int) – the no. of points before and after x0 which should be considered for calculating A and B
Returns:

a filtered array of size same as that of signal_array

Return type:

numpy array

orbitdeterminator.filters.triple_moving_average.weighted_average(params)[source]

Calculates the weighted average of terms in the input

Parameters:params (list) – a list of numbers
Returns:weighted average of the terms in the list
Return type:list

Savintzky - Golay

Takes a positional data set (time, x, y, z) and applies the Savintzky Golay filter on it based on the polynomial and window parameters we input

orbitdeterminator.filters.sav_golay.golay(data, window, degree)[source]

Apply the Savintzky-Golay filter to a positional data set.

Parameters:
  • data (numpy array) – containing all of the positional data in the format of (time, x, y, z)
  • window (int) – window size of the Savintzky-Golay filter
  • degree (int) – degree of the polynomial in Savintzky-Golay filter
Returns:

filtered data in the same format

Return type:

numpy array

Interpolation:

Lamberts-Kalman Method

Takes a positional data set and produces sets of six keplerian elements using Lambert’s solution for preliminary orbit determination and Kalman filters

orbitdeterminator.kep_determination.lamberts_kalman.check_keplerian(kep)[source]

Checks all the sets of keplerian elements to see if they have wrong values like eccentricity greater that 1 or a negative number for semi major axis

Parameters:kep (numpy array) – all the sets of keplerian elements in [semi major axis (a), eccentricity (e), inclination (i), argument of perigee (ω), right ascension of the ascending node (Ω), true anomaly (v)] format
Returns:the final corrected set of keplerian elements that will be inputed in the kalman filter
Return type:numpy array
orbitdeterminator.kep_determination.lamberts_kalman.create_kep(my_data)[source]

Computes all the keplerian elements for every point of the orbit you provide using Lambert’s solution It implements a tool for deleting all the points that give extremely jittery state vectors

Parameters:data (numpy array) – contains the positional data set in (Time, x, y, z) Format
Returns:array containing all the keplerian elements computed for the orbit given in [semi major axis (a), eccentricity (e), inclination (i), argument of perigee (ω), right ascension of the ascending node (Ω), true anomaly (v)] format
Return type:numpy array
orbitdeterminator.kep_determination.lamberts_kalman.kalman(kep, R)[source]

Takes as an input lots of sets of keplerian elements and produces the fitted value of them by applying kalman filters

Parameters:
  • kep (numpy array) – containing keplerian elements in this format (a, e, i, ω, Ω, v)
  • R – estimate of measurement variance
Returns:

final set of keplerian elements describing the orbit based on kalman filtering

Return type:

numpy array

orbitdeterminator.kep_determination.lamberts_kalman.lamberts(x1, x2, traj)[source]

Takes two position points - numpy arrays with time,x,y,z as elements and produces two vectors with the state vector for both positions using Lamberts solution

Parameters:
  • x1 (numpy array) – time and position for point 1 [time1,x1,y1,z1]
  • x2 (numpy array) – time and position for point 2 [time2,x2,y2,z2]
Returns:

velocity vector for point 1 (vx, vy, vz)

Return type:

numpy array

orbitdeterminator.kep_determination.lamberts_kalman.orbit_trajectory(x1_new, x2_new, time)[source]

Tool for checking if the motion of the sallite is retrogade or counter - clock wise

Parameters:
  • x1 (numpy array) – time and position for point 1 [time1,x1,y1,z1]
  • x2 (numpy array) – time and position for point 2 [time2,x2,y2,z2]
  • time (float) – time difference between the 2 points
Returns:

true if we want to keep retrogade, False if we want counter-clock wise

Return type:

bool

Spline Interpolation

Interpolation using splines for calculating velocity at a point and hence the orbital elements

orbitdeterminator.kep_determination.interpolation.compute_velocity(spline, point)[source]

Calculate the derivative of spline at the point(on the points the given spline corresponds to). This gives the velocity at that point.

Parameters:
  • spline (list) – component wise cubic splines of orbit data points of the format [spline_x, spline_y, spline_z].
  • point (numpy array) – point at which velocity is to be calculated.
Returns:

velocity vector at the given point

Return type:

numpy array

orbitdeterminator.kep_determination.interpolation.cubic_spline(orbit_data)[source]

Compute component wise cubic spline of points of input data

Parameters:
  • orbit_data (numpy array) – array of orbit data points of the
  • [time, x, y, z] (format) –
Returns:

component wise cubic splines of orbit data points of the format [spline_x, spline_y, spline_z]

Return type:

list

orbitdeterminator.kep_determination.interpolation.main(data_points)[source]

Apply the whole process of interpolation for keplerian element computation

Parameters:data_points (numpy array) – positional data set in format of (x, y, z, time)
Returns:computed keplerian elements for every point of the orbit
Return type:numpy array

Utils:

kep_state

Takes a set of keplerian elements (a, e, i, ω, Ω, v) and transforms it into a state vector (x, y, z, vx, vy, vz) where v is the velocity of the satellite

orbitdeterminator.util.kep_state.kep_state(kep)[source]

Converts the keplerian elements to position and velocity vector

Parameters:kep (numpy array) – a 1x6 matrix which contains the following variables kep(0): semi major axis (km) kep(1): eccentricity (number) kep(2): inclination (degrees) kep(3): argument of perigee (degrees) kep(4): right ascension of the ascending node (degrees) kep(5): true anomaly (degrees)
Returns:1x6 matrix which contains the position and velocity vector r(0),r(1),r(2): position vector (x,y,z) km r(3),r(4),r(5): velocity vector (vx,vy,vz) km/s
Return type:numpy array

read_data

Reads the positional data set from a .csv file

orbitdeterminator.util.read_data.load_data(filename)[source]

Loads the data in numpy array for further processing in tab delimiter format

Parameters:filename (string) – name of the csv file to be parsed
Returns:array of the orbit positions, each point of the orbit is of the format (time, x, y, z)
Return type:numpy array
orbitdeterminator.util.read_data.save_orbits(source, destination)[source]

Saves objects returned from load_data

Parameters:
  • source – path to raw csv files.
  • destination – path where objects need to be saved.

state_kep

Takes a state vector (x, y, z, vx, vy, vz) where v is the velocity of the satellite and transforms it into a set of keplerian elements (a, e, i, ω, Ω, v)

orbitdeterminator.util.state_kep.state_kep(r, v)[source]

Converts state vector to orbital elements.

Parameters:
  • r (numpy array) – position vector
  • v (numpy array) – velocity vector
Returns:

array of the computed keplerian elements kep(0): semimajor axis (kilometers) kep(1): orbital eccentricity (non-dimensional)

(0 <= eccentricity < 1)

kep(2): orbital inclination (degrees) kep(3): right ascension of ascending node (degrees) kep(4): argument of perigee (degress) kep(5): true anomaly (degrees)

Return type:

numpy array

input_transf

Converts cartesian co-ordinates to spherical co-ordinates and vice versa

orbitdeterminator.util.input_transf.cart_to_spher(data)[source]

Takes as an input a data set containing points in cartesian format (time, x, y, z) and returns the computed spherical coordinates (time, azimuth, elevation, r)

Parameters:data (numpy array) – containing the cartesian coordinates in format of (time, x, y, z)
Returns:array of spherical coordinates in format of (time, azimuth, elevation, r)
Return type:numpy array
orbitdeterminator.util.input_transf.spher_to_cart(data)[source]

Takes as an input a data set containing points in spherical format (time, azimuth, elevation, r) and returns the computed cartesian coordinates (time, x, y, z).

Parameters:data (numpy array) – containing the spherical coordinates in format of (time, azimuth, elevation, r)
Returns:array of cartesian coordinates in format of (time, x, y, z)
Return type:numpy array

rkf78

Uses Runge Kutta Fehlberg 7(8) numerical integration method to compute the state vector in a time interval tf

orbitdeterminator.util.rkf78.rkf78(neq, ti, tf, h, tetol, x)[source]

Runge-Kutta-Fehlberg 7[8] method, solve first order system of differential equations

Parameters:
  • neq (int) – number of differential equations
  • ti (float) – initial simulation time
  • tf (float) – final simulation time
  • h (float) – initial guess for integration step size
  • tetol (float) – truncation error tolerance [non-dimensional]
  • x (numpy array) – integration vector at time = ti
Returns:

array of state vector at time tf

Return type:

numpy array

orbitdeterminator.util.rkf78.ypol_a(y)[source]

Computes velocity and acceleration values by using the state vector y and keplerian motion

Parameters:y (numpy array) – state vector (position + velocity)
Returns:derivative of the state vector (velocity + acceleration)
Return type:numpy array

golay_window

orbitdeterminator.util.golay_window.window(error, data)[source]

Calculates the constant c which is needed to determine the savintzky - golay filter window window = len(data) / c ,where c is a constant strongly related to the error contained in the data set

Parameters:
  • error (float) – the a-priori error estimation for each measurment
  • data (numpy array) – the positional data set
Returns:

constant which describes the window that needs to be inputed to the savintzky - golay filter

Return type:

float