Load gnss_lib_py
into the Python workspace
[1]:
import gnss_lib_py as glp
SP3 File Parsing
This tutorial shows how to load SP3 files.
[2]:
# download an example .sp3 data file
glp.make_dir("../data")
!wget https://raw.githubusercontent.com/Stanford-NavLab/gnss_lib_py/main/data/unit_test/sp3/COD0MGXFIN_20211180000_01D_05M_ORB.SP3 --quiet -nc -O "../data/COD0MGXFIN_20211180000_01D_05M_ORB.SP3"
# Specify .sp3 file path to extract precise ephemerides
sp3_path = "../data/COD0MGXFIN_20211180000_01D_05M_ORB.SP3"
Use the SP3 class loader to load in the SP3 file. The class can also optionally take multiple files as a list.
[3]:
sp3 = glp.Sp3(sp3_path)
sp3
[3]:
gps_millis gnss_sv_id gnss_id sv_id x_sv_m y_sv_m \
0 1.303668e+12 G01 gps 1 1.328768e+07 -1.549193e+07
1 1.303668e+12 G02 gps 2 -1.344951e+07 -9.668544e+06
2 1.303668e+12 G03 gps 3 2.258999e+07 -1.299617e+07
3 1.303668e+12 G04 gps 4 1.514119e+07 -6.442989e+06
4 1.303668e+12 G05 gps 5 -2.431371e+07 2.825648e+06
... ... ... ... ... ... ...
8463 1.303690e+12 C45 beidou 45 -2.192827e+07 1.712494e+06
8464 1.303690e+12 C46 beidou 46 -1.358145e+07 -1.945488e+07
8465 1.303690e+12 J01 qzss 1 -2.258361e+07 3.028899e+07
8466 1.303690e+12 J02 qzss 2 -2.462862e+07 2.266367e+07
8467 1.303690e+12 J03 qzss 3 -3.561799e+07 2.180851e+07
z_sv_m
0 1.654569e+07
1 -2.010071e+07
2 -4.880224e+06
3 -2.085329e+07
4 -1.069378e+07
... ...
8463 1.718806e+07
8464 -1.471351e+07
8465 -1.412461e+07
8466 3.050454e+07
8467 -1.175909e+06
[7 rows x 8468 columns]
To visualize the results, we’ll plot the ECEF x position of the first 10 GPS satellites.
[4]:
sp3_first_ten_gps = sp3.where("gnss_id","gps").where("sv_id",10,"leq")
fig = glp.plot_metric_by_constellation(sp3_first_ten_gps,"gps_millis","x_sv_m")