Python GNSS processing package
Project description
GnssToolbox - Python package for GNSS learning
Installation
This package requires Python 3
Required packages :
- gpsdatetime - https://pypi.org/project/gpsdatetime/ (J. Beilin - ENSG)
- re
- math
- numpy
- copy
- time
- os
- json
- from operator import attrgetter
Installation is accomplished from the command line.
- From pypi
user@desktop$pip3 install pygnsstoolbox
- From package source directory
user@desktop$~/gnsstoolbox$ python3 setup.py install
For usage see gnsstoolbox cheatsheet and beamer slides shipped with the package.
Import modules
""" Ephemerides management """
import gnsstoolbox.orbits as orb
""" GNSS data (rinex "o" files) """
import gnsstoolbox.rinex_o as rx
""" Processing tools (rotations, coordinate conversions...) """
import gnsstoolbox.gnsstools as tools
""" Code processing """
import gnsstoolbox.gnss_process as proc
""" Constantes utiles """
import gnsstoolbox.gnss_const as const
""" Corrections (troposphere, antennas...) """
import gnsstoolbox.gnss_corr as corr
gnss_const
Constant | Description | Unit |
---|---|---|
c | celerity | 299792458.0 m/s |
f1 | frequency L1 gps | 1.57542 GHz |
f2 | frequency L2 gps | 1.22760 GHz |
f5 | frequency L5 gps | 1.17645 GHz |
orbits
Structure
Orbit class contains all orbits informations :
Attribute | Definition |
---|---|
leap_seconds | |
ion_alpha_gps | |
ion_beta_gps | |
ion_gal | |
delta_utc | |
NAV_dataG | list of GPS navigation message |
NAV_dataE | list of Galileo navigation message |
NAV_dataR | list of Glonass navigation message |
G | list of Sp3Pos objects with GPS precise orbits |
E | list of Sp3Pos objects with Galileo precise orbits |
R | list of Sp3Pos objects with Glonass precise orbits |
GPS/Galileo nav element (nav_element)
Attribute | Definition | Unit |
---|---|---|
tgps | date/time of ephemeris | gpsdatetime |
mjd | date/time of ephemeris | |
gps_wk | GPS week | I4 |
TOE | Time of ephemeris | second of week |
TOC | TIme of clock | |
const | Constellation | G or E |
PRN | Pseudo-random noise | # |
e | Orbit excentricity | |
sqrt_a | Square-root of semi-major axis | |
M0 | Mean anomaly at at reference time | |
delta_n | Mean motiondifference from computed value | |
i0 | Inclination à TOE | |
IDOT | Rate of change of inclination | |
crc | Amplitude of the cosine harmonic correction term to the orbit radius | |
crs | Amplitude of the sine harmonic correction term to the orbit radius | |
cuc | Amplitude of cosine harmonic correction term to the argument of latitude | |
cus | Amplitude of sine harmonic correction term to the argument of latitude | |
cic | Amplitude of the cosine harmonic correction term to the angle of inclination | |
cis | Amplitude of the sine harmonic correction term to the angle of inclination | |
omega | Argument of perigee | |
OMEGA0 | Longitude of ascending node of orbit plane at weekly epoch | |
OMEGA_DOT | Rate of Right Ascension | |
L2_P | ||
sv_acc | ||
sv_health | Space vehicle health | |
TGD | Time group delay | |
alpha0 | Clock bias | s |
alpha1 | Clock drift coefficient | s**-1 |
alpha2 | Clock drift rate coefficient | s**-2 |
IODC | Issue of data, clock | |
IODE | Issue of data, ephemeris |
Glonass nav element (nav_element)
Attribute | Definition | Unit |
---|---|---|
tgps | date/time of ephemeris | gpsdatetime |
mjd | date/time of ephemeris | |
gps_wk | GPS week | I4 |
const | Constellation | R |
PRN | Pseudo-random noise | # |
SV_clock_offset | ||
SV_relat_freq_offset | ||
Message_frame_time | ||
X | ||
X_dot | ||
MS_X_acc | ||
Y | ||
Y_dot | ||
MS_Y_acc | ||
Z | ||
Z_dot | ||
MS_Z_acc | ||
freq_num | ||
sv_health | ||
age_op_inf |
Sp3 precise orbit (Sp3Pos class)
Attribute | Definition | Unit |
---|---|---|
mjd | date/time of ephemeris | modified julian date |
X | X coordinate ECEF | m |
Y | Y coordinate ECEF | m |
Z | Z coordinate ECEF | m |
dte | Satellite clock bias | µs |
Data loading
- Broadcast ephemerides loading (*.yyn ou *.yyg)
Orb = orbits.orbit()
Orb.loadRinexN('brdm1500.13p')
- Precise ephemerides loading (*.sp3)
Orb = orbits.orbit()
Orb.loadSp3(['igs17424.sp3','igl17424.sp3','grm17424.sp3'])
or
Orb.loadSp3('igs17424.sp3')
Data access
- Get broadcast ephemerides for a satellite at an instant mjd
Eph = Orb.getEphemeris(constellation,PRN,mjd)
try:
print("TOC : ",Eph.tgps.st_iso_epoch())
except:
print("Unable to find satellite")
- Get all precise ephemerides for a satellite
(orb,nl) = Orb.getSp3('G',5)
# Satellite GPS, PRN 5
# 'G' : GPS, 'E' : Galileo, 'R' : Glonass
X = orb[:,1] # X coordinates at all sp3 epochs
Y = orb[:,2]
Z = orb[:,3]
Satellite coordinates processing
Process of ECEF coordinates and clock error (dte) for a satellite given by its constellation ('G','E','R'), its PRN, an instant mjd and et possibly a degree for Lagrange processing (precise orbits).
X, Y, Z, dte = Orb.calcSatCoord(const,PRN,mjd,degree)
A debug class object is implemented during coordinate processing. It contains all intermediaries results.
In order to get its attributes :
print(Orb.debug.__dict__)
Rinex_o
Structure
class rinex_o
Attribute | Definition |
---|---|
type | rinex type, always "o" |
headers | list of header objects |
class header
Attribute | Definition |
---|---|
VERSION | |
TYPE | |
PGM | |
RUN_BY | |
OBSERVER | |
AGENCY | |
MARKER_NAME | marker name |
MARKER_NUMBER | marker number |
REC_N | receiver number |
REC_TYPE | receiver type |
REC_VERS | receiver version |
ANT_N | antenna number |
ANT_TYPE | antenna type |
X | X approximate coordinate (m) |
Y | Y approximate coordinate (m) |
Z | Z approximate coordinate (m) |
dH | up offset |
dE | east offset |
dN | north offset |
WAVELENGTH_FACTOR | |
TYPE_OF_OBS | dictionary |
TIME_OF_FIRST_OBS | time of first observation (gpsdatetime) |
TIME_OF_LAST_OBS | time of last observation (gpsdatetime) |
EPOCH_FLAG | |
epochs | list of epoch objects |
class epoch
Attribute | Definition |
---|---|
tgps | epoch date/time (gpsdatetime) |
satellites | list of sat objects |
class sat
Attribute | Definition |
---|---|
type | |
const | constellation, in [G;R;E] |
PRN | Pseudo Random Noise |
obs | dictionnary of observables |
Data loading
Loading observation Rinex file (*.yyo)
Rnx = rx.rinex_o()
Rnx.loadRinexO('smne1500.13o')
Data access
- Get epoch object for a given MJD :
t=gpst.gpsdatetime()
t.rinex_t('13 5 30 1 0 30.0000000')
Ep = Rnx.getEpochByMjd(t.mjd)
- Get header object for a given MJD :
Hd = Rnx.getHeaderByMjd(t.mjd)
- Get attribute from any header
X0 = Hd.X
- Print all header or epoch informations
print(Hd)
print(Ep)
- Get any observable from an epoch :
C1 = Ep.getObs("C1","G", 31)
or
S = Ep.getSat("G", 31)
C1 = S.getObs("C1")
or (only for C/A code)
C1 = Ep.getSat("G", 31).C1
- Get all common data for 2 datasets at a given MJD
Ep_base,Ep_rover = rinex_base.getCommonEpochs(rinex_rover, 56442)
gnsstools
- toolGeoCartGRS80 : geographic to cartesian coordinates conversion. All angles should be given in radians.
X,Y,Z = tools.toolGeoCartGRS80(lon,lat,h)
- toolCartGeoGRS80 : cartesian to geographic coordinates conversion. All angles are given in radians.
lon,lat,h = tools.toolCartGeoGRS80(X,Y,Z)
- toolCartLocGRS80 : cartesian to topocentric coordinates conversion.
x, y, z = tools.toolCartLocGRS80(X0,Y0,Z0,X,Y,Z)
- toolAzEle : azimut and elevation (radians) for one or several satellites Xs,Ys,Zs (scalar or vector) seen from a point with X,Y,Z coordinates.
Az, Ele = tools.toolAzEle(X,Y,Z,Xs,Ys,Zs)
- toolRotX, toolRotY, toolRotZ : alpha radians rotation around X, Y ou Z axis.
X,Y,Z = tools.toolRotX(X,Y,Z,alpha)
gnss_process
- TrilatGps : trilateration with 4 parameters (X,Y,Z,cdtr)
X,Y,Z,cdtr,sigma0_2,V,Qxx = trilatGps(PosSat,Dobs,X0)
- TrilatGnss : trilateration with 4, 5 or 6 parameters (X,Y,Z,cdtr,[cGGTO,cGPGL])
X,Y,Z,cdtr,cGGTO,cGPGL,sigma0_2,V,Qxx = trilatGnss(PosSat,Dobs,X0,sat_index)
- TrilatGnssPonderationElev : trilateration with 4, 5 or 6 parameters (X,Y,Z,cdtr,[cGGTO,cGPGL]) avec with weighting given from elevation of each satellite.
X,Y,Z,cdtr,cGGTO,cGPGL,sigma0_2,V,Qxx = trilatGnssPonderationElev(PosSat,Dobs,X0,sat_index,ElevSat)
Licence
Copyright (C) 2014-2023, Jacques Beilin - ENSG-Geomatics
Distributed under terms of the CECILL-C licence.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
File details
Details for the file gnsstoolbox-1.2.17.tar.gz
.
File metadata
- Download URL: gnsstoolbox-1.2.17.tar.gz
- Upload date:
- Size: 65.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.8.0 colorama/0.4.4 importlib-metadata/7.1.0 keyring/23.5.0 pkginfo/1.8.2 readme-renderer/34.0 requests-toolbelt/0.9.1 requests/2.31.0 rfc3986/1.5.0 tqdm/4.66.2 urllib3/1.26.5 CPython/3.10.12
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | ad109b9fc8911ccbdca464757454f513c903638cdc5bea1d9bf1370c6fb33ef2 |
|
MD5 | 221351e140ffcab724e7f66153eb0db5 |
|
BLAKE2b-256 | 18c670c1101311c78d9b13b0fceeba0b71de1658d28b4456b67fbad0f8fda85a |