Skip to content

Commit 46e2b2a

Browse files
authored
Merge pull request #27 from paarnes/pypi2
Pypi2
2 parents 606119d + 27faeb9 commit 46e2b2a

37 files changed

+107505
-109573
lines changed

README.md

Lines changed: 102 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
# GNSS Multipath Analysis
22
[![Python application](https://github.com/paarnes/GNSS_Multipath_Analysis_Software/actions/workflows/run-tests.yml/badge.svg)](https://github.com/paarnes/GNSS_Multipath_Analysis_Software/actions/workflows/run-tests.yml)
3+
[![PyPI version](https://badge.fury.io/py/gnssmultipath.svg)](https://badge.fury.io/py/gnssmultipath)
4+
35

46
GNSS_MultipathAnalysis is a software for analyzing the multipath effect on Global Navigation Satellite Systems (GNSS). This software is largely based on the MATLAB software [GNSS_Receiver_QC_2020](https://gitlab.com/bjro/GNSS_reading_protocol/-/tree/main/GNSS_Receiver_QC_2020) made by Bjørn-Eirik Roald. Mainly it follows the same logic, just with Python syntax. However, there are added some other features like for instance:
57
* Possible to use broadcasted ephemerides (not only SP3 files)
6-
* Also support RINEX v2.xx observation files
8+
* Also support RINEX v2.xx observation files
79
* Makes polar plot of each satellite for each system
810
* Makes polar plot that shows the multipath effect as function of azimuth and elevation angle.
911
* Plots the Signal-To-Noise Ratio (SNR) wrt to time and elevation angle
@@ -16,79 +18,149 @@ A considerable part of the results has been validated by comparing the results w
1618

1719
The main function is called "GNSS_MultipathAnalysis.py" and takes in different arguments. Two arguments are mandatory:
1820
* A RINEX Observation file
19-
* A sp3/eph file containing precise satellite coordinates or a RINEX 3 navigation file
21+
* A sp3/eph file containing precise satellite coordinates or a RINEX 3 navigation file
2022

2123
The rest of the arguments are optional. Their default values are described in the function description. By default, this software will provide the results in forms of plots and an analysis report as a text file. In addition, it exports the results as a pickle file which can be imported as a dictionary in python for instance.
2224

23-
## Installation
24-
To install the required packages, run:
25-
`pip install -r requirements.txt`
26-
where the *requirements.txt* is located [here](https://github.com/paarnes/GNSS/blob/master/src/requirements.txt).
25+
## Installation
26+
27+
The software can be installed using `pip` in the terminal:
28+
```
29+
$ pip install gnssmultipath
30+
```
2731

2832
Note: In the example plots, TEX is used to get prettier text formatting. However, this requires TEX/LaTex to be installed on your computer. The program will first try to use TEX, and if it's not possible, standard text formatting will be used. So TEX/LaTex is not required to run the program and make plots.
2933

3034
## The steps are:
31-
1. Reads in the RINEX observation file
35+
1. Reads in the RINEX observation file
3236
2. Reads the RINEX navigation file or the precise satellite coordinates in SP3-format (depends on what’s provided)
33-
3. If a navigation file is provided, the satellite coordinates will be transformed from Kepler-elements to ECEF for GPS, Galileo and BeiDou. For GLONASS the navigation file is containing a state vector. The coordinates then get interpolated to the current epoch by solving the differential equation using a 4th order Runge-Kutta. If a SP3 file is provided, the interpolation is done by a barycentric Lagrange interpolation.
34-
4. Satellites elevation and azimuth angles get computed.
37+
3. If a navigation file is provided, the satellite coordinates will be transformed from Kepler-elements to ECEF for GPS, Galileo and BeiDou. For GLONASS the navigation file is containing a state vector. The coordinates then get interpolated to the current epoch by solving the differential equation using a 4th order Runge-Kutta. If a SP3 file is provided, the interpolation is done by a barycentric Lagrange interpolation.
38+
4. Satellites elevation and azimuth angles get computed.
3539
5. Cycle slip detection by using both ionospheric residuals and a code-phase combination. These linear combinations are given as
3640
$$\dot{I} = \frac{1}{\alpha-1}\left(\Phi_1 - \Phi_2\right)/\Delta t$$
3741
$$d\Phi_1R_1 = \Phi_1 - R_1$$
38-
The threshold values can be set by the user, and the default values are set to $0.0667 [\frac{m}{s}]$ and $6.67[\frac{m}{s}]$ for the ionospheric residuals and code-phase combination respectively.
42+
The threshold values can be set by the user, and the default values are set to $0.0667 [\frac{m}{s}]$ and $6.67[\frac{m}{s}]$ for the ionospheric residuals and code-phase combination respectively.
3943

40-
6. Multipath estimates get computed by making a linear combination of the code and phase observation. PS: A dual frequency receiver is necessary because observations from two different bands/frequency are needed.
44+
6. Multipath estimates get computed by making a linear combination of the code and phase observation. PS: A dual frequency receiver is necessary because observations from two different bands/frequency are needed.
4145
$$MP_1 = R_1 - \left(1+\frac{2}{\alpha - 1}\right)\Phi_1 + \left(\frac{2}{\alpha - 1}\right)\Phi_2$$
4246
where $R_1$ is the code observation on band 1, $\Phi_1$ and $\Phi_2$ is phase observation on band 1 and band 2 respectively. Furthermore $\alpha$ is the ratio between the two frequency squared $\alpha=\frac{{f}^2_1}{{f}^2_2}$
4347
7. Based on the multipath estimates computed in step 6, both weighted and unweighted RMS-values get computed. The RMS value has unit _meter_, and is given by
44-
$$RMS=\sqrt{\frac{\sum\limits_{i=1}^{N_{sat}}\sum\limits_{j=1}^{N_{epohcs}} MP_{ij}}{N_{est}}}$$
45-
For the weighted RMS value, the satellite elevation angle is used in a weighting function defined as $$w =\frac{1}{4sin^2\beta}$$ for every estimates with elevation angle $\beta$ is below $30^{\circ}$ and $w =1$ for $\beta > 30^{\circ}$.
46-
8. Several plot will be generated (if not set to FALSE):
48+
$$RMS=\sqrt{\frac{\sum\limits_{i=1}^{N_{sat}}\sum\limits_{j=1}^{N_{epohcs}} MP_{ij}}{N_{est}}}$$
49+
For the weighted RMS value, the satellite elevation angle is used in a weighting function defined as $$w =\frac{1}{4sin^2\beta}$$ for every estimates with elevation angle $\beta$ is below $30^{\circ}$ and $w =1$ for $\beta > 30^{\circ}$.
50+
8. Several plot will be generated (if not set to FALSE):
4751
* Ionospheric delay wrt time and zenith mapped ionospheric delay (combined)
4852
<p align="center">
49-
<img src="https://github.com/paarnes/GNSS/blob/master/Results_example/2022_30sec/Graphs/Galileo_ionospheric_delay_combined.png" width="630"/>
50-
</p>
53+
<img src="https://github.com/paarnes/GNSS_Multipath_Analysis_Software/blob/master/Results_example/2022_30sec/Graphs/Galileo_ionospheric_delay_combined.png?raw=true" width="630"/>
54+
</p>
5155
* The Multipath effect plotted wrt time and elevation angle (combined)
5256
<p align="center">
53-
<img src="https://github.com/paarnes/GNSS/blob/master/Results_example/2018_1sec/Graphs/GLONASS_C1C_C2P_MP_combined.png" width="630"/>
54-
</p>
57+
<img src="https://github.com/paarnes/GNSS_Multipath_Analysis_Software/blob/master/Results_example/2018_1sec/Graphs/GLONASS_C1C_C2P_MP_combined.png?raw=true" width="630"/>
58+
</p>
5559
* Barplot showing RMS values for each signal and system
5660
<p align="center">
57-
<img src="https://github.com/paarnes/GNSS/blob/master/Results_example/2022_30sec/Graphs/Barplot_RMS_all.png" width="630"/>
61+
<img src="https://github.com/paarnes/GNSS_Multipath_Analysis_Software/blob/master/Results_example/2022_30sec/Graphs/Barplot_RMS_all.png?raw=true" width="630"/>
5862
</p>
5963
* Polar plot of the multipath effect as function of elevation angle and azimuth
6064
<p align="center">
61-
<img src="https://github.com/paarnes/GNSS/blob/master/Results_example/2022_30sec/Graphs/MP_GPS_C1C.png" width="630"/>
65+
<img src="https://github.com/paarnes/GNSS_Multipath_Analysis_Software/blob/master/Results_example/2022_30sec/Graphs/MP_GPS_C1C.png?raw=true" width="630"/>
6266
</p>
6367
* Polar plot of each observed satellite in the system
6468
<p align="center">
65-
<img src="https://github.com/paarnes/GNSS/blob/master/Results_example/2022_30sec/Graphs/Skyplot_GLONASS.png" width="630"/>
69+
<img src="https://github.com/paarnes/GNSS_Multipath_Analysis_Software/blob/master/Results_example/2022_30sec/Graphs/Skyplot_GLONASS.png?raw=true" width="630"/>
6670
</p>
6771

68-
* Signal-To-Noise Ratio (SNR) plotted wrt time and elevation angle (combine)
72+
* Signal-To-Noise Ratio (SNR) plotted wrt time and elevation angle (combine)
6973
<p align="center">
70-
<img src="https://github.com/paarnes/GNSS/blob/master/Results_example/2022_30sec/Graphs/SNR_GPS_S1C.png" width="630"/>
74+
<img src="https://github.com/paarnes/GNSS_Multipath_Analysis_Software/blob/master/Results_example/2022_30sec/Graphs/SNR_GPS_S1C.png?raw=true" width="630"/>
7175
</p>
7276

7377
* Polar plot of Signal-To-Noise Ratio (SNR)
7478
<p align="center">
75-
<img src="https://github.com/paarnes/GNSS/blob/master/Results_example/2018_1sec/Graphs/SNR_Polar_GPS_S2W.png" width="630"/>
79+
<img src="https://github.com/paarnes/GNSS_Multipath_Analysis_Software/blob/master/Results_example/2018_1sec/Graphs/SNR_Polar_GPS_S2W.png?raw=true" width="630"/>
7680
</p>
7781
9. Exporting the results as a pickle file which easily can be imported into python as a dictionary
78-
10. The results in form of a report get written to a text file with the same name as the RINEX observation file.
82+
10. The results in form of a report get written to a text file with the same name as the RINEX observation file.
7983

8084

8185
## How to run it
8286
An example file on how to call the program is located [here](https://github.com/paarnes/GNSS_Multipath_Analysis_Software/blob/master/src/Examples_on_how_to_run_it.ipynb). This will show some examples
8387
on how to run the analysis with different user defined arguments, how to read in the resultfile (pickle file), and in addition it shows how to use only the RINEX
84-
reading routine. The most simple example on how to run the code is:
88+
reading routine.
89+
90+
### Some simple examples on how to use the software:
8591

92+
#### Run a multipath analysis using a SP3 file and only mandatory arguments
8693
```
87-
from GNSS_MultipathAnalysis import GNSS_MultipathAnalysis
94+
from gnssmultipath import GNSS_MultipathAnalysis
95+
96+
rinObs_file = 'OPEC00NOR_S_20220010000_01D_30S_MO_3.04'
97+
SP3_file = 'SP3_20220010000.eph'
98+
analysisResults = GNSS_MultipathAnalysis(rinex_obs_file, sp3NavFilename_1 = SP3_file)
99+
```
100+
101+
#### Run a multipath analysis using a RINEX navigation file with SNR and a defined datarate for ephemerides
102+
```
103+
from gnssmultipath import GNSS_MultipathAnalysis
104+
105+
# Input arguments
106+
rinObs_file = 'OPEC00NOR_S_20220010000_01D_30S_MO_3.04'
107+
rinNav_file = 'BRDC00IGS_R_20220010000_01D_MN.rnx
108+
output_folder = 'C:\Users\xxxx\Results_Multipath'
109+
cutoff_elevation_angle = 10 # drop satellites lower than 10 degrees
110+
nav_data_rate = 60 # desired datarate for ephemerides (to improve speed)
111+
112+
analysisResults = GNSS_MultipathAnalysis(rinex_obs_file,
113+
broadcastNav1=rinNav_file,
114+
include_SNR = True,
115+
outputDir = output_folder,
116+
nav_data_rate = nav_data_rate,
117+
cutoff_elevation_angle = cutoff_elevation_angle)
118+
```
119+
120+
#### Read a RINEX observation file
121+
```
122+
from gnssmultipath import readRinexObs
123+
124+
rinObs_file = 'OPEC00NOR_S_20220010000_01D_30S_MO_3.04'
125+
126+
GNSS_obs, GNSS_LLI, GNSS_SS, GNSS_SVs, time_epochs, nepochs, GNSSsystems,\
127+
obsCodes, approxPosition, max_sat, tInterval, markerName, rinexVersion, recType, timeSystem, leapSec, gnssType,\
128+
rinexProgr, rinexDate, antDelta, tFirstObs, tLastObs, clockOffsetsON, GLO_Slot2ChannelMap, success = \
129+
readRinexObs(rinObs_file)
130+
131+
```
132+
133+
134+
#### Read a RINEX navigation file (v.3)
135+
```
136+
from gnssmultipath import Rinex_v3_Reader
137+
138+
rinNav_file = 'BRDC00IGS_R_20220010000_01D_MN.rnx'
139+
140+
navdata = Rinex_v3_Reader().read_rinex_nav(rinNav_file, data_rate=60)
141+
142+
```
143+
144+
#### Read in the results from a uncompressed pickle file
145+
146+
```
147+
from gnssmultipath import PickleHandler
148+
149+
path_to_picklefile = 'analysisResults.pkl'
150+
151+
result_dict = PickleHandler.read_pickle(pickl_file)
152+
153+
154+
```
155+
156+
#### Read in the results from a compressed pickle file
157+
```
158+
from gnssmultipath import PickleHandler
159+
160+
path_to_picklefile = 'analysisResults.pkl'
161+
162+
result_dict = PickleHandler.read_zstd_pickle(pickl_file)
88163
89-
rinObs_file = 'OPEC00NOR_S_20220010000_01D_30S_MO_3.04'
90-
SP3_file = 'SP3_20220010000.eph'
91-
analysisResults = GNSS_MultipathAnalysis(rinex_obs_file, sp3NavFilename_1=SP3_file)
92164
```
93165

94166

-3.61 MB
Loading

0 commit comments

Comments
 (0)