Skip to content

TCDSolar/MultiLatPy

Repository files navigation

MultiLatPy

License: MIT DOI

This package contains the Python tools/algorithms to perform and/or aid multilateration techniques of their choice. These methods are purely algerbraic and only require the spacecraft positions used for analysis (as long as each position is in the same corrdinate system) and the Time Differnce of Arrival (TODA) for each reciever. The code is set up to process and compute the estimated position of a source using the Bancroft (bcroft) Method - one of many different techniques and provide useful aids (such as the Geometric Dilution of Precision or GDOP) to elimate regions of high uncertainty which will likely provide erroneous results.

Using the data

Both the GDOP and bancroft algorithms require satellite positions (x,y,z) in the same coordinate system. Default system is Heliocentric Earth Eclitpic (HEE). The positions should be in units of solar radii (Rsun).

TDOA for each spacecraft can be determined from timestamped datasets and have units of seconds.

GDOP calculator

Uses the satellite positions to create a normalised psuedorange matrix for each reciever. From this, the user selects the scale of their GDOP grid of length nx x ny (defaulted to 1000 points) to evaluate the GDOP value at each position.

python gdop.py

gdop.py contains the gdop2D function which calualtes the GDOP in a 2D system. This algorithm uses matrix algerba to determine the covariance matrix of the pseudoranges. The GDOP is then the trace of this covariance matrix. Other values can be computed such as the Time Dilution of Precision (the final diagonal entry).

Input: scale (size of grid in units of AU); stations_pos (positions of N-satellites used in calculation, where N >= 2); nx (size of grid in x-direction; ny size of grid in y-direction.

Output: sat_err (array of GDOP values for each position on grid); tim_err (array of TDOP calues for each position on grid); cov_Q (covariance matrix used for each posiiton, may be of use for further analysis)

Note: GDOP values > 20 are considered to be regions of high uncertainty and should be eliminated from further analysis

The GDOP values can be plotted onto the grid using:

python gdop_plot.py

This script contains two functions for plotting:

  1. gdop2D_plotter: plot GDOP unitless values from given satellite positions used in gdop2D function
  2. gdop2D_unc: plot errors in location in terms of total radial uncertianty from GDOP (assuming spherical symmetry) and time cadence of the observations given statellite positions used in gdop2D function

Both require the same scaling used for the initial grid to compute the GDOP values, the resulting array of GDOPs and the satellite positions used. NOTE: the plotting tool assumes that the grd is square, i.e. nx = ny

gdop2D_unc also require inputs prop_v (propagation velocity of the source) and delta_t (time cadence of observations) to compute the total uncertainty at each grid point.

Both functions out the resulting figure and axes objects for further editing if required. gdop2D_unc also provides an array of the total uncertainty calulated at each point: zvals_r.

Authors: Dale Weigt, Shane Maloney, Alberto Canizares, Sophie Murray, Peter Gallagher

Bancroft multilateration

The Bancroft method uses linear algerba to obtain a direct solution of the source/reciever position (and clock offset), without the need for any priori knowledge of source/reciever location [1]. A quick and efficient algorithm to find a souce location from 4+ satellites using psuedorange matrix of satellites. The code can be adapted to account for fewer recievers. Mathematical derivation found here: https://gssc.esa.int/navipedia/index.php/

NOTE: calculation here does not include ionospheric and tropospheric terms and assumes the emission is emitted isotropically. The location calulated can be made frequency dependent if you specify times at a certain frequency

The Bancroft algorithm here is adaped from code provided by 10GeV: https://codereview.stackexchange.com/questions/253982/bancrofts-method-implementation and can be accesed using:

python bcroft.py

The function tdoa_ban is inisde this script and utilises the 4x4 Minkowski matrix diag(1,1,1,-1) and Lorentz Inner product to calculate the positions.

Inputs:

  • stations_pos : array of N elements of shape (1, 3); where N >= 4 is the number of recievers (x,y,z) coordinates of satellite/reciever positions. Units of R_sun
  • .
  • alpha: scalar; scaling used to adapt speed of light (2.99792458e8/sol_2_m)*alpha. Speed in units of R_sun/s
  • tdoa: array of length (1,n) ; Array of determiend TDOAs to be used for Bancroft algorithm in units of seconds.

Outputs:

Vertexer class used to calculate Bancroft location of source. Creates a class once the matrix equation has been solved. 'Vertexer' class first used to find:

  1. Solve Bancroft formulation using N satelite geometry of the form (for N >= 4):

    [variable] = Vertexer(np.array([[x_1, y_1, z_1],[x_2, y_2, z_2],[x_3, y_3,z_3], [x_4, y_4,z_4],...,[x_N, y_N, z_N]]))

  2. Inset given TDOA to establish source location:
    [variable].find(np.array([[t_1], [t_2], [t_3], [t_4],...,[t_N]]))
    
Using these, the final output is the location of the source. Algorithm produces 2 solutions: correct/most optimum solution ia taken to be one of the smallest Residiual sum of squares (RSS) error.

The output is therefore the position of the source in (x,y,z) coordinates in the system used for the satellite positions. In units of Rsun.

The remaining 'bcroft' files consisit of unit tests to evaluate the accuracy of tdoa_ban:

  1. bcroft_static_test.py: evaluates accuracy of algorithm using various source/satellite positions. No noise is added to TDOAs
  2. bcroft_sc_noise_test.py and bcroft_source_noise_test.py: identical to previous test must adds Gaussian noise of varying degrees to the calculated TDOAs

All tests use pytest module to run.

Authors: Dale Weigt, Shane Maloney, Alberto Canizares, Sophie Murray, Peter Gallagher

Requirements

  • python 3.9.13
  • dataclasses
  • matplotlib 3.5.2
  • numpy 1.23.1
  • pandas 1.4.3
  • pytest 7.1.2

References

  • [1] Bancroft, S. (1985), An Algebraic Solution of the GPS Equations , IEEE Transactions on Aerospace Electronic Systems, 21, 1, 56-59, doi: 10.1109/TAES.1985.310538

About

A set of tools/algorithms to perform and/or aid multilateration techniques of their choice.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages