Skip to content

Commit 774c387

Browse files
Merge pull request #82 from Stanford-NavLab/ashwin/multignss_paths
Changed path names
2 parents ae2644a + b001268 commit 774c387

8 files changed

Lines changed: 164 additions & 141 deletions

File tree

.gitignore

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,12 @@ results/*
1616
*.csv
1717
!data/unit_test/*/*.csv
1818
!notebooks/tutorials/myreceiver.csv
19+
# Ignore downloaded precise ephimerides files by default
20+
*.sp3
21+
*.clk
22+
# Include unit test files for precise ephimerides
23+
!data/unit_test/*/*.sp3
24+
!data/unit_test/*/*.clk
1925

2026
#Excluding VS Code files
2127
.vscode/*

docs/source/reference/parsers/modules.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,4 @@ parsers
77
android
88
ephemeris
99
navdata
10+
precise_ephemerides
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
precise\_ephemerides module
2+
===========================
3+
4+
.. automodule:: precise_ephemerides
5+
:members:
6+
:undoc-members:
7+
:show-inheritance:

docs/source/reference/test_parsers/modules.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,4 @@ parsers
66

77
test_android
88
test_navdata
9+
test_precise_ephemerides
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
test\_precise\_ephemerides module
2+
=================================
3+
4+
.. automodule:: test_precise_ephemerides
5+
:members:
6+
:undoc-members:
7+
:show-inheritance:

docs/source/requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ requests==2.28.1; python_version >= "3.7" and python_version < "4"
102102
scipy==1.7.3; python_version >= "3.7" and python_version < "3.11"
103103
send2trash==1.8.0; python_version >= "3.7"
104104
setuptools-scm==6.4.2; python_version >= "3.7"
105-
six==1.16.0; python_full_version >= "3.7.1" and python_version >= "3.7"
105+
six==1.16.0; python_full_version >= "3.7.1" and python_version >= "3.7" and (python_version >= "3.7" and python_full_version < "3.0.0" or python_full_version >= "3.3.0" and python_version >= "3.7") and (python_version >= "2.7" and python_full_version < "3.0.0" or python_full_version >= "3.3.0")
106106
snowballstemmer==2.2.0; python_version >= "3.6"
107107
soupsieve==2.3.2.post1; python_full_version >= "3.6.0" and python_version >= "3.7"
108108
sphinx-rtd-theme==0.5.2

notebooks/tutorials/parsers.ipynb

Lines changed: 140 additions & 139 deletions
Original file line numberDiff line numberDiff line change
@@ -266,6 +266,146 @@
266266
"gt_data.rows"
267267
]
268268
},
269+
{
270+
"cell_type": "markdown",
271+
"id": "cf51b89e",
272+
"metadata": {},
273+
"source": [
274+
"# Precise Ephemerides Processing"
275+
]
276+
},
277+
{
278+
"cell_type": "markdown",
279+
"id": "3c5de62f",
280+
"metadata": {},
281+
"source": [
282+
"The data required to calculate with precise ephemerides uses .sp3 and .clk files, which can be downloaded from [CDDIS](https://cddis.nasa.gov/Data_and_Derived_Products/GNSS/gnss_mgex.html) or [CORS](https://geodesy.noaa.gov/UFCORS/).\n",
283+
"\n",
284+
"The .sp3 files provide post-processed, accurate, and precise information regarding 3-D satellite position in the Earth-Centered Earth-Fixed (ECEF) frame at intervals of 15mins each. \n",
285+
"\n",
286+
"Similarly, the .clk files provide post-processed, accurate and precise information on satellite clock errors at intervals of 30secs each. \n",
287+
"\n",
288+
"These .sp3 and .clk files are available for any GNSS constellation, and hence, provide a common processing platform for applications that involve multi-GNSS satellite signals (without requiring to parse the broadcast ephemeris from each constellation separately one at a time). Also, unlike broadcast ephemeris that can suffer from signal-in-space anomalies, the .sp3 and .clk files are guaranteed to provide accurate satellite information. However, note that, these files are only available in a post-processed manner, and not in real-time"
289+
]
290+
},
291+
{
292+
"cell_type": "markdown",
293+
"id": "67fc4f2e",
294+
"metadata": {},
295+
"source": [
296+
"We show how to analyze this precise ephemerides functionality for the Android derived dataset in the following cells, \n",
297+
"\n",
298+
"1. Load the derived data from AndroidDerived"
299+
]
300+
},
301+
{
302+
"cell_type": "code",
303+
"execution_count": null,
304+
"id": "364e7fb3",
305+
"metadata": {},
306+
"outputs": [],
307+
"source": [
308+
"from gnss_lib_py.parsers.precise_ephemerides import multi_gnss_from_precise_eph\n",
309+
"import numpy as np\n",
310+
"\n",
311+
"# load Android Google Challenge data\n",
312+
"!wget https://raw.githubusercontent.com/Stanford-NavLab/gnss_lib_py/main/data/unit_test/android_2021/Pixel4_derived_clkdiscnt.csv --quiet -O \"Pixel4_derived_clkdiscnt.csv\"\n",
313+
"derived_data = AndroidDerived2021(\"Pixel4_derived_clkdiscnt.csv\", remove_timing_outliers=False)"
314+
]
315+
},
316+
{
317+
"cell_type": "markdown",
318+
"id": "4e4ee7c8",
319+
"metadata": {},
320+
"source": [
321+
"2. Specify the paths to the .sp3 and .clk files, as well as the desired constellations from which one intends to extract satellite information"
322+
]
323+
},
324+
{
325+
"cell_type": "code",
326+
"execution_count": null,
327+
"id": "e62ed8ee",
328+
"metadata": {},
329+
"outputs": [],
330+
"source": [
331+
"# download .sp3 data file\n",
332+
"!wget https://raw.githubusercontent.com/Stanford-NavLab/gnss_lib_py/main/data/unit_test/precise_ephemeris/grg21553_short.sp3 --quiet -O \"grg21553_short.sp3\"\n",
333+
"# Specify .sp3 file path to extract precise ephemerides\n",
334+
"sp3_path = \"grg21553_short.sp3\"\n",
335+
"\n",
336+
"# download .clk data file\n",
337+
"!wget https://raw.githubusercontent.com/Stanford-NavLab/gnss_lib_py/main/data/unit_test/precise_ephemeris/grg21553_short.clk --quiet -O \"grg21553_short.clk\"\n",
338+
"# Specify .clk file path to extract precise ephemerides\n",
339+
"clk_path = \"grg21553_short.clk\"\n",
340+
"\n",
341+
"# Specify the GNSS constellations for which you want to extract precise ephemeris\n",
342+
"gnss_constellations = {'gps', 'glonass'}"
343+
]
344+
},
345+
{
346+
"cell_type": "markdown",
347+
"id": "2567ff0f",
348+
"metadata": {},
349+
"source": [
350+
"3. Remove the rows in NavData class that refer to satellite information (3-D satellite position, 3-D satellite velocity, clock bias and clock drift), \n",
351+
"\n",
352+
" i.e., `SV_KEYS =['x_sv_m', 'y_sv_m', 'z_sv_m', 'vx_sv_mps','vy_sv_mps','vz_sv_mps', 'b_sv_m', 'b_dot_sv_mps']`"
353+
]
354+
},
355+
{
356+
"cell_type": "code",
357+
"execution_count": null,
358+
"id": "3761b169",
359+
"metadata": {},
360+
"outputs": [],
361+
"source": [
362+
"# Define the keys relevant for satellite information, and remove the data within these fields\n",
363+
"SV_KEYS = ['x_sv_m', 'y_sv_m', 'z_sv_m', \\\n",
364+
" 'vx_sv_mps','vy_sv_mps','vz_sv_mps', \\\n",
365+
" 'b_sv_m', 'b_dot_sv_mps']\n",
366+
"\n",
367+
"for sv in SV_KEYS:\n",
368+
" derived_data[sv] = 0"
369+
]
370+
},
371+
{
372+
"cell_type": "markdown",
373+
"id": "458b0a46",
374+
"metadata": {},
375+
"source": [
376+
"4. Populate the columns of SV_KEYS with information extracted via precise ephemerides"
377+
]
378+
},
379+
{
380+
"cell_type": "code",
381+
"execution_count": null,
382+
"id": "f4e3f349",
383+
"metadata": {},
384+
"outputs": [],
385+
"source": [
386+
"# Update derived_data class with satellite information computed via precise ephemerides\n",
387+
"derived_multi_gnss = multi_gnss_from_precise_eph(derived_data, sp3_path, \\\n",
388+
" clk_path, gnss_constellations, verbose = False)"
389+
]
390+
},
391+
{
392+
"cell_type": "code",
393+
"execution_count": null,
394+
"id": "10563cec",
395+
"metadata": {},
396+
"outputs": [],
397+
"source": [
398+
"# Check that all the desired fields related to satellite information have useful\n",
399+
"# information, and norm of computed satellite position matches the altitude of GNSS constellation\n",
400+
"sat_alt = np.linalg.norm(np.transpose([derived_multi_gnss[SV_KEYS[0]][0:2],\n",
401+
" derived_multi_gnss[SV_KEYS[1]][0:2], \n",
402+
" derived_multi_gnss[SV_KEYS[2]][0:2]]), axis=1)\n",
403+
"print('Distance of two satellites from the center of the Earth (expected around 26000000 m):', derived_multi_gnss[\"gnss_id\"][0:2], sat_alt)\n",
404+
"print(\"Extracted values for same satellites: \")\n",
405+
"for sv in SV_KEYS:\n",
406+
" print(sv, ':', derived_multi_gnss[sv][0:2])"
407+
]
408+
},
269409
{
270410
"cell_type": "markdown",
271411
"id": "eb016e74",
@@ -542,145 +682,6 @@
542682
"from gnss_lib_py.utils.visualizations import plot_metric\n",
543683
"fig = plot_metric(my_receiver_data,\"gps_millis\",\"corr_pr_m\",groupby=\"sv_id\")"
544684
]
545-
},
546-
{
547-
"cell_type": "markdown",
548-
"id": "cf51b89e",
549-
"metadata": {},
550-
"source": [
551-
"# Precise Ephemerides Processing"
552-
]
553-
},
554-
{
555-
"cell_type": "markdown",
556-
"id": "3c5de62f",
557-
"metadata": {},
558-
"source": [
559-
"The data required to calculate with precise ephemerides uses .sp3 and .clk files, which can be downloaded from [CDDIS](https://cddis.nasa.gov/Data_and_Derived_Products/GNSS/gnss_mgex.html) or [CORS](https://geodesy.noaa.gov/UFCORS/).\n",
560-
"\n",
561-
"The .sp3 files provide post-processed, accurate, and precise information regarding 3-D satellite position in the Earth-Centered Earth-Fixed (ECEF) frame at intervals of 15mins each. \n",
562-
"\n",
563-
"Similarly, the .clk files provide post-processed, accurate and precise information on satellite clock errors at intervals of 30secs each. \n",
564-
"\n",
565-
"These .sp3 and .clk files are available for any GNSS constellation, and hence, provide a common processing platform for applications that involve multi-GNSS satellite signals (without requiring to parse the broadcast ephemeris from each constellation separately one at a time). Also, unlike broadcast ephemeris that can suffer from signal-in-space anomalies, the .sp3 and .clk files are guaranteed to provide accurate satellite information. However, note that, these files are only available in a post-processed manner, and not in real-time"
566-
]
567-
},
568-
{
569-
"cell_type": "markdown",
570-
"id": "67fc4f2e",
571-
"metadata": {},
572-
"source": [
573-
"We show how to analyze this precise ephemerides functionality for the Android derived dataset in the following cells, \n",
574-
"1. Load the derived data from AndroidDerived"
575-
]
576-
},
577-
{
578-
"cell_type": "code",
579-
"execution_count": null,
580-
"id": "364e7fb3",
581-
"metadata": {},
582-
"outputs": [],
583-
"source": [
584-
"from gnss_lib_py.parsers.precise_ephemerides import multi_gnss_from_precise_eph\n",
585-
"import numpy as np\n",
586-
"\n",
587-
"# load Android Google Challenge data\n",
588-
"!wget https://raw.githubusercontent.com/Stanford-NavLab/gnss_lib_py/ramya/multiGNSS_sp3/data/unit_test/android_2021/Pixel4_derived_clkdiscnt.csv --quiet -O \"Pixel4_derived_clkdiscnt.csv\"\n",
589-
"derived_data = AndroidDerived2021(\"Pixel4_derived_clkdiscnt.csv\", remove_timing_outliers=False)"
590-
]
591-
},
592-
{
593-
"cell_type": "markdown",
594-
"id": "4e4ee7c8",
595-
"metadata": {},
596-
"source": [
597-
"2. Specify the paths to the .sp3 and .clk files, as well as the desired constellations from which one intends to extract satellite information"
598-
]
599-
},
600-
{
601-
"cell_type": "code",
602-
"execution_count": null,
603-
"id": "e62ed8ee",
604-
"metadata": {},
605-
"outputs": [],
606-
"source": [
607-
"# download .sp3 data file\n",
608-
"!wget https://raw.githubusercontent.com/Stanford-NavLab/gnss_lib_py/ramya/multiGNSS_sp3/data/unit_test/precise_ephemeris/grg21553_short.sp3 --quiet -O \"grg21553_short.sp3\"\n",
609-
"# Specify .sp3 file path to extract precise ephemerides\n",
610-
"sp3_path = \"grg21553_short.sp3\"\n",
611-
"\n",
612-
"# download .clk data file\n",
613-
"!wget https://raw.githubusercontent.com/Stanford-NavLab/gnss_lib_py/ramya/multiGNSS_sp3/data/unit_test/precise_ephemeris/grg21553_short.clk --quiet -O \"grg21553_short.clk\"\n",
614-
"# Specify .clk file path to extract precise ephemerides\n",
615-
"clk_path = \"grg21553_short.clk\"\n",
616-
"\n",
617-
"# Specify the GNSS constellations for which you want to extract precise ephemeris\n",
618-
"gnss_constellations = {'gps', 'glonass'}"
619-
]
620-
},
621-
{
622-
"cell_type": "markdown",
623-
"id": "2567ff0f",
624-
"metadata": {},
625-
"source": [
626-
"3. Remove the rows in NavData class that refer to satellite information (3-D satellite position, 3-D satellite velocity, clock bias and clock drift), \n",
627-
"\n",
628-
" i.e., `SV_KEYS =['x_sv_m', 'y_sv_m', 'z_sv_m', 'vx_sv_mps','vy_sv_mps','vz_sv_mps', 'b_sv_m', 'b_dot_sv_mps']`"
629-
]
630-
},
631-
{
632-
"cell_type": "code",
633-
"execution_count": null,
634-
"id": "3761b169",
635-
"metadata": {},
636-
"outputs": [],
637-
"source": [
638-
"# Define the keys relevant for satellite information, and remove the data within these fields\n",
639-
"SV_KEYS = ['x_sv_m', 'y_sv_m', 'z_sv_m', \\\n",
640-
" 'vx_sv_mps','vy_sv_mps','vz_sv_mps', \\\n",
641-
" 'b_sv_m', 'b_dot_sv_mps']\n",
642-
"\n",
643-
"for sv in SV_KEYS:\n",
644-
" derived_data[sv] = 0"
645-
]
646-
},
647-
{
648-
"cell_type": "markdown",
649-
"id": "458b0a46",
650-
"metadata": {},
651-
"source": [
652-
"4. Populate the columns of SV_KEYS with information extracted via precise ephemerides"
653-
]
654-
},
655-
{
656-
"cell_type": "code",
657-
"execution_count": null,
658-
"id": "f4e3f349",
659-
"metadata": {},
660-
"outputs": [],
661-
"source": [
662-
"# Update derived_data class with satellite information computed via precise ephemerides\n",
663-
"derived_multi_gnss = multi_gnss_from_precise_eph(derived_data, sp3_path, \\\n",
664-
" clk_path, gnss_constellations, verbose = False)"
665-
]
666-
},
667-
{
668-
"cell_type": "code",
669-
"execution_count": null,
670-
"id": "10563cec",
671-
"metadata": {},
672-
"outputs": [],
673-
"source": [
674-
"# Check that all the desired fields related to satellite information have useful\n",
675-
"# information, and norm of computed satellite position matches the altitude of GNSS constellation\n",
676-
"sat_alt = np.linalg.norm(np.transpose([derived_multi_gnss[SV_KEYS[0]][0:2],\n",
677-
" derived_multi_gnss[SV_KEYS[1]][0:2], \n",
678-
" derived_multi_gnss[SV_KEYS[2]][0:2]]), axis=1)\n",
679-
"print('Distance of two satellites from the center of the Earth (expected around 26000000 m):', derived_multi_gnss[\"gnss_id\"][0:2], sat_alt)\n",
680-
"print(\"Extracted values for same satellites: \")\n",
681-
"for sv in SV_KEYS:\n",
682-
" print(sv, ':', derived_multi_gnss[sv][0:2])"
683-
]
684685
}
685686
],
686687
"metadata": {

requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ reindent==3.5.1
9090
scipy==1.7.3; python_version >= "3.7" and python_version < "3.11"
9191
send2trash==1.8.0; python_version >= "3.7"
9292
setuptools-scm==6.4.2; python_version >= "3.7"
93-
six==1.16.0; python_full_version >= "3.7.1" and python_version >= "3.7"
93+
six==1.16.0; python_full_version >= "3.7.1" and python_version >= "3.7" and (python_version >= "3.7" and python_full_version < "3.0.0" or python_full_version >= "3.3.0" and python_version >= "3.7")
9494
soupsieve==2.3.2.post1; python_full_version >= "3.6.0" and python_version >= "3.7"
9595
tenacity==8.0.1; python_version >= "3.6"
9696
terminado==0.15.0; python_version >= "3.7"

0 commit comments

Comments
 (0)