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

Gibb’s Method

class orbitdeterminator.kep_determination.gibbsMethod.Gibbs[source]
classmethod convert_list(vec)[source]

Type casts the input data for the ease of use.

Converts the values of the input list with string datatype into float for the ease of furthur computation.

Parameters:vec (list) – input vector
Returns:vector converted to float values
Return type:list
classmethod cross_product(a, b)[source]

Computes cross product of the given vectors. Returns a vector.

Parameters:
  • a (list/array) – first vector
  • b (list/array) – second vector
Returns:

cross product of given vectors

Return type:

list/array

classmethod dot_product(a, b)[source]

Computes dot product of two vectors. Multiplies corresponding axis with each other and then adds them. Returns a single value.

Parameters:
  • a (list/array) – first vector
  • b (list/array) – second vector
Returns:

dot product of given vectors

Return type:

float

classmethod find_length(path)[source]

Finds the length of the input file.

Calculates the length of the file with the given path containing all the position vectors. File should contain a header line describing all of its attributes in a single line only. This function removes the header line before it calculates file length. If the file does not contains the header line then the first line of data will get removed and you have to add 1 to the output after it returns the result.

Parameters:path (str) – file path
Returns:length of file
Return type:int
classmethod gibbs(r1, r2, r3)[source]

Computes state vector from the given set of three position vectors using Gibb’s implementation.

Computes velocity vector (part of state vector) using Gibb’s Method and takes r2 (input argument) as its position vector (part of state vector). Both combined forms state vector.

Parameters:
  • r1 (list) – first position vector
  • r2 (list) – second position vector
  • r3 (list) – third position vector
Returns:

velocity vector

Return type:

list

classmethod magnitude(vec)[source]

Computes magnitude of the input vector.

Parameters:vec (list) – vector
Returns:magnitude of vector
Return type:float
classmethod operate_vector(a, b, flag)[source]

Adds or subtracts input vectors based on the flag value.

If flag is 1 then add both vectors with corresponding values else if flag is 0 (zero) then subtract two vectors with corresponding values. Returns a vector.

Parameters:
  • a (list/array) – first vector
  • b (list/array) – second vector
  • flag (int) – checks for operation (addition/subtraction)
Returns:

sum/difference of vector based on flag value

Return type:

list/array

classmethod orbital_elements(r, v)[source]

Computes orbital elements from state vector.

Orbital elements is a set of six parameters which are semi-major axis, inclination, right ascension of the ascending node, eccentricity, argument of perigee and mean anomaly.

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

set of six orbital elements

Return type:

list

read_file(path)[source]

Invokes the Gibb’s implementation and stores the result in a list.

Read the file with the given path and forms a set of three position vectors then applies Gibb’s Method on that set and computes state vector for every set. After computing state vectors it stores the result into a list. Now, these state vectors can be used to find orbital elements.

Parameters:path (str) – path to input file
Returns:list of all pair of position and velocity vector
Return type:numpy.ndarray
classmethod unit(vec)[source]

Finds unit vector of the given vector. Divides each value of vector by its magnitude. Returns a vector.

Parameters:vec (list) – input vector
Returns:unit vector
Return type:list

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

Ellipse Fit

Finds out the ellipse that best fits to a set of data points and calculates its keplerian elements.

orbitdeterminator.kep_determination.ellipse_fit.determine_kep(data)[source]

Determines keplerian elements that fit a set of points.

Parameters:data (nx3 numpy array) – A numpy array of points in the format [x y z].
Returns:(kep,res) - The keplerian elements and the residuals as a tuple. kep: 1x6 numpy array res: nx3 numpy array

For the keplerian elements: kep[0] - semi-major axis (in whatever units the data was provided in) kep[1] - eccentricity kep[2] - inclination (in degrees) kep[3] - argument of periapsis (in degrees) kep[4] - right ascension of ascending node (in degrees) kep[5] - true anomaly of the first row in the data (in degrees)

For the residuals: (in whatever units the data was provided in) res[0] - residuals in x axis res[1] - residuals in y axis res[2] - residuals in z axis

orbitdeterminator.kep_determination.ellipse_fit.plot_kep(kep, data)[source]

Plots the original data and the orbit defined by the keplerian elements.

Parameters:
  • kep (1x6 numpy array) – keplerian elements
  • data (nx3 numpy array) – original data
Returns:

nothing

Propagation:

Propagation Model

class orbitdeterminator.propagation.sgp4.SGP4[source]
__init__()[source]

Initializes flag variable to check for FlagCheckError (custom exception).

compute_necessary_kep(kep, b_star=2.1109e-05)[source]

Initializes the necessary class variables using keplerian elements which are needed in the computation of the propagation model.

Parameters:
  • kep (list) – kep elements in order [axis, inclination, ascension, eccentricity, perigee, anomaly]
  • b_star (float) – bstar drag term
Returns:

NIL

compute_necessary_tle(line1, line2)[source]

Initializes the necessary class variables using TLE which are needed in the computation of the propagation model.

Parameters:
  • line1 (str) – line 1 of the TLE
  • line2 (str) – line 2 of the TLE
Returns:

NIL

propagate(t1, t2)[source]

Invokes the function to compute state vectors and organises the final result.

The function first checks if compute_necessary_xxx() is called or not if not then a custom exception is raised stating that call this function first. Then it computes the state vector for the next 8 hours (28800 seconds in 8 hours) at every time epoch (28800 time epcohs) using the sgp4 propagation model. The values of state vector is formatted upto five decimal points and then all the state vectors got appended in a list which stores the final output.

Parameters:
  • t1 (int) – start time epoch
  • t2 (int) – end time epoch
Returns:

vector containing all state vectors

Return type:

numpy.ndarray

propagation_model(tsince)[source]

From the time epoch and information from TLE, applies SGP4 on it.

The function applies the Simplified General Perturbations algorithm SGP4 on the information extracted from the TLE at the given time epoch ‘tsince’ and computes the state vector from it.

Parameters:tsince (int) – time epoch
Returns:position and velocity vector
Return type:tuple
classmethod recover_tle(pos, vel)[source]

Recovers TLE back from state vector.

First of all, only necessary information (which are inclination, right ascension of the ascending node, eccentricity, argument of perigee, mean anomaly, mean motion and bstar) that are needed in the computation of SGP4 propagation model are recovered. It is using a general format of TLE. State vectors are used to find orbital elements which are then inserted into the TLE format at their respective positions. Mean motion and bstar is calculated separately as it is not a part of orbital elements. Format of TLE: x denotes that there is a digit, c denotes a character value, underscore(_) denotes a plus/minus(+/-) sign value and period(.) denotes a decimal point.

Parameters:
  • pos (list) – position vector
  • vel (list) – velocity vector
Returns:

line1 and line2 of TLE

Return type:

list

class orbitdeterminator.propagation.sgp4.FlagCheckError[source]

Raised when compute_necessary_xxx() function is not called.

Cowell Method

Numerical orbit propagator based on RK4. Takes into account J2 and drag perturbations.

orbitdeterminator.propagation.cowell.drag(s)[source]

Returns the drag acceleration for a given state.

Parameters:s (1x6 numpy array) – the state vector [rx,ry,rz,vx,vy,vz]
Returns:the drag acceleration [ax,ay,az]
Return type:1x3 numpy array
orbitdeterminator.propagation.cowell.j2_pert(s)[source]

Returns the J2 acceleration for a given state.

Parameters:s (1x6 numpy array) – the state vector [rx,ry,rz,vx,vy,vz]
Returns:the J2 acceleration [ax,ay,az]
Return type:1x3 numpy array
orbitdeterminator.propagation.cowell.propagate_state(s, t0, tf)[source]

Equivalent to the rk4 function.

orbitdeterminator.propagation.cowell.rk4(s, t0, tf, h=30)[source]

Runge-Kutta 4th Order Numerical Integrator

Args:
s(1x6 numpy array): the state vector [rx,ry,rz,vx,vy,vz] t0(float) : initial time tf(float) : final time h(float) : step-size
Returns:the state at time tf
Return type:1x6 numpy array
orbitdeterminator.propagation.cowell.rkf45(s, t0, tf, h=10, tol=1e-06)[source]

Runge-Kutta Fehlberg 4(5) Numerical Integrator

Args:
s(1x6 numpy array): the state vector [rx,ry,rz,vx,vy,vz] t0(float) : initial time tf(float) : final time h(float) : step-size tol(float) : tolerance of error
Returns:the state at time tf
Return type:1x6 numpy array
orbitdeterminator.propagation.cowell.sdot(s)[source]

Returns the time derivative of a given state.

Parameters:s (1x6 numpy array) – the state vector [rx,ry,rz,vx,vy,vz]
Returns:the time derivative of s [vx,vy,vz,ax,ay,az]
Return type:1x6 numpy array
orbitdeterminator.propagation.cowell.time_period(s, h=30)[source]

Returns the nodal time period of an orbit.

Parameters:
  • s (1x6 numpy array) – the state vector [rx,ry,rz,vx,vy,vz]
  • h (float) – step-size
Returns:

the nodal time period of the orbit

Return type:

float

Simulator

class orbitdeterminator.propagation.simulator.Simulator(params)[source]

A class for the simulator.

__init__(params)[source]

Initializes the simulator.

Parameters:params – A SimParams object containing kep,t0,t,period,speed, and op_writer
Returns:nothing
calc()[source]

Calculates the satellite state at current time and calls itself after a certain amount of time.

simulate()[source]

Starts the calculation thread and waits for keyboard input. Press q or Ctrl-C to quit the simulator cleanly.

stop()[source]

Stops the simulator cleanly.

class orbitdeterminator.propagation.simulator.SimParams[source]

SimParams class. This is just a container for all the parameters required to start the simulation.

kep(1x6 numpy array): the intial osculating keplerian elements epoch(float): the epoch of the above kep period(float): maximum time period between observations t0(float): starting time of the simulation speed(float): speed of the simulation op_writer(OpWriter): output handling object

class orbitdeterminator.propagation.simulator.OpWriter[source]

Base output writer class. Inherit this class and override the methods.

close()[source]

Anything that has to be executed after finishing writing the output. Runs once.

Example: Closing connection to a database

open()[source]

Anything that has to be executed before starting to write output. Runs once.

Example: Establishing connection to database

static write(t, s)[source]

This method is called everytime the calc thread finishes a computation.

Parameters:
  • t – the current time of simulation
  • s – the state vector at t [rx,ry,rz,vx,vy,vz]
class orbitdeterminator.propagation.simulator.print_r[source]

Bases: orbitdeterminator.propagation.simulator.OpWriter

Prints the position vector

class orbitdeterminator.propagation.simulator.save_r(name)[source]

Bases: orbitdeterminator.propagation.simulator.OpWriter

Saves the position vector to a file

__init__(name)[source]

Initialize the class.

Parameters:name (string) – file name

DGSN Simulator

class orbitdeterminator.propagation.dgsn_simulator.DGSNSimulator(params)[source]

A class for the simulator.

__init__(params)[source]

Initializes the simulator.

Parameters:params – A SimParams object containing kep,t0,t,period,speed, op_writer, dgsn_period, and dgsn_thresh. For a description of the parameters, look at the documentation of the SimParams class.
Returns:nothing
calc()[source]

Calculates the satellite state at current time and calls itself after a certain amount of time.

simulate()[source]

Starts the calculation thread and waits for keyboard input. Press q or Ctrl-C to quit the simulator cleanly.

stop()[source]

Stops the simulator cleanly.

class orbitdeterminator.propagation.dgsn_simulator.SimParams[source]

SimParams class. This is just a container for all the parameters required to start the simulation.

kep(1x6 numpy array): the intial osculating keplerian elements epoch(float): the epoch of the above kep period(float): maximum time period between observations t0(float): starting time of the simulation speed(float): speed of the simulation op_writer(OpWriter): output handling object

r_jit(float): std of Gaussian noise applied to observations dgsn_period(float): average time period between gaps dgsn_thresh(float): used to control the duration of the gap.

it is a number between 0 and 1. a higher number means a bigger gap.
class orbitdeterminator.propagation.dgsn_simulator.OpWriter[source]

Base output writer class. Inherit this class and override the methods.

close()[source]

Anything that has to be executed after finishing writing the output. Runs once.

Example: Closing connection to a database

open()[source]

Anything that has to be executed before starting to write output. Runs once.

Example: Establishing connection to database

static write(t, r)[source]

This method is called everytime the calc thread finishes a computation.

Parameters:
  • t – the current time of simulation
  • s – the state vector at t [rx,ry,rz,vx,vy,vz]
class orbitdeterminator.propagation.dgsn_simulator.print_r[source]

Bases: orbitdeterminator.propagation.dgsn_simulator.OpWriter

Prints the position vector

class orbitdeterminator.propagation.dgsn_simulator.save_r(name)[source]

Bases: orbitdeterminator.propagation.dgsn_simulator.OpWriter

Saves the position vector to a file

__init__(name)[source]

Initialize the class.

Parameters:name (string) – file name

Kalman Filter

Kalman Filter to smoothen observations. It continuously reads a file where observations are being written and updates its estimate based on the observations and the cowell model.

class orbitdeterminator.propagation.kalman_filter.KalmanFilter[source]

Kalman Filter class wrapper.

process(s, t0, dgsn_file)[source]

The main Kalman Filter. Continuously reads an obervations file and updates the state estimate.

Parameters:
  • s (1x6 numpy array) – the state vector [rx,ry,rz,vx,vy,vz]
  • t0 (float) – epoch of s
  • dgsn_file (string) – path to the observations file
Returns:

nothing

sgp4_prop

SGP4 propagator. This is a wrapper around the PyPI SGP4 propagator. However, this does not generate an artificial TLE. So there is no string manipulation involved. Hence this is faster than sgp4_prop_string.

orbitdeterminator.propagation.sgp4_prop.kep_to_sat(kep, epoch, bstar=0.21109E-4, whichconst=wgs72, afspc_mode=False)[source]

Converts a set of keplerian elements into a Satellite object.

Args:
kep(1x6 numpy array): the osculating keplerian elements at epoch epoch(float): the epoch bstar(float): bstar drag coefficient whichconst(float): gravity model. refer pypi sgp4 documentation afspc_mode(boolean): refer pypi sgp4 documentation
Returns:an sgp4 satellite object encapsulating the arguments
Return type:Satellite object
orbitdeterminator.propagation.sgp4_prop.propagate_kep(kep, t0, tf, bstar=2.1109e-05)[source]

Propagates a set of keplerian elements.

Parameters:
  • kep (1x6 numpy array) – osculating keplerian elements at epoch
  • t0 (float) – initial time (epoch)
  • tf (float) – final time
Returns:

the position at tf vel(1x3 numpy array): the velocity at tf

Return type:

pos(1x3 numpy array)

orbitdeterminator.propagation.sgp4_prop.propagate_state(r, v, t0, tf, bstar=2.1109e-05)[source]

Propagates a state vector

Parameters:
  • r (1x3 numpy array) – the position vector at epoch
  • v (1x3 numpy array) – the velocity vector at epoch
  • t0 (float) – initial time (epoch)
  • tf (float) – final time
Returns:

the position at tf vel(1x3 numpy array): the velocity at tf

Return type:

pos(1x3 numpy array)

sgp4_prop_string

SGP4 propagator. This is a wrapper around PyPI SGP4 propagator. It constructs an artificial TLE and passes it to the PyPI module.

orbitdeterminator.propagation.sgp4_prop_string.propagate(kep, init_time, final_time, bstar=2.1109e-05)[source]

Propagates a set of keplerian elements.

Parameters:
  • kep (1x6 numpy array) – osculating keplerian elements at epoch
  • init_time (float) – initial time (epoch)
  • final_time (float) – final time
  • bstar (float) – bstar drag coefficient
Returns:

the position at tf vel(1x3 numpy array): the velocity at tf

Return type:

pos(1x3 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): argument of perigee (degress) kep(4): right ascension of ascending node (degrees) 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

anom_conv

Vectorized anomaly conversion scripts

orbitdeterminator.util.anom_conv.ecc_to_mean(E, e)[source]

Converts eccentric anomaly to mean anomaly.

Parameters:
  • E (numpy array) – array of eccentric anomalies (in radians)
  • e (float) – eccentricity
Returns:

array of mean anomalies (in radians)

Return type:

numpy array

orbitdeterminator.util.anom_conv.mean_to_t(M, a)[source]

Converts mean anomaly to time elapsed.

Parameters:
  • M (numpy array) – array of mean anomalies (in radians)
  • a (float) – semi-major axis
Returns:

numpy array of time elapsed

Return type:

numpy array

orbitdeterminator.util.anom_conv.true_to_ecc(theta, e)[source]

Converts true anomaly to eccentric anomaly.

Parameters:
  • theta (numpy array) – array of true anomalies (in radians)
  • e (float) – eccentricity
Returns:

array of eccentric anomalies (in radians)

Return type:

numpy array

new_tle_kep_state

This module computes the state vector from keplerian elements.

orbitdeterminator.util.new_tle_kep_state.kep_to_state(kep)[source]

This function converts from keplerian elements to the position and velocity vector

Parameters:kep (1x6 numpy array) – kep contains the following variables kep[0] = semi-major axis (kms) kep[1] = eccentricity (number) kep[2] = inclination (degrees) kep[3] = argument of perigee (degrees) kep[4] = right ascension of ascending node (degrees) kep[5] = true anomaly (degrees)

Returns: r: 1x6 numpy array which contains the position and velocity vector

r[0],r[1],r[2] = position vector [rx,ry,rz] km r[3],r[4],r[5] = velocity vector [vx,vy,vz] km/s
orbitdeterminator.util.new_tle_kep_state.tle_to_state(tle)[source]

This function converts from TLE elements to position and velocity vector

Parameters:tle (1x6 numpy array) – tle contains the following variables tle[0] = inclination (degrees) tle[1] = right ascension of the ascending node (degrees) tle[2] = eccentricity (number) tle[3] = argument of perigee (degrees) tle[4] = mean anomaly (degrees) tle[5] = mean motion (revs per day)

Returns: r: 1x6 numpy array which contains the position and velocity vector

r[0],r[1],r[2] = position vector [rx,ry,rz] km r[3],r[4],r[5] = velocity vector [vx,vy,vz] km/s

teme_to_ecef

Converts coordinates in TEME frame to ECEF frame.

orbitdeterminator.util.teme_to_ecef.conv_to_ecef(coords)[source]

Converts coordinates in TEME frame to ECEF frame.

Parameters:coords (nx4 numpy array) – list of coordinates in the format [t,x,y,z]
Returns:
list of coordinates in the format
[t, latitude, longitude, altitude]

Note that these coordinates are with respect to the surface of the Earth. Latitude, longitude are in degrees.

Return type:nx4 numpy array