Skip to content

Commit 8c2c812

Browse files
committed
add sp3, clk tutorials
1 parent ff31e92 commit 8c2c812

1 file changed

Lines changed: 197 additions & 59 deletions

File tree

notebooks/tutorials/parsers.ipynb

Lines changed: 197 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -315,6 +315,203 @@
315315
"gt_data.rows"
316316
]
317317
},
318+
{
319+
"cell_type": "markdown",
320+
"id": "95e58b71",
321+
"metadata": {},
322+
"source": [
323+
"# TU Chemnitz SmartLoc\n",
324+
"This tutorial shows how to load data from TU Chemnitz's [smartLoc GNSS Dataset](https://www.tu-chemnitz.de/projekt/smartLoc/gnss_dataset.html.en#Datasets)."
325+
]
326+
},
327+
{
328+
"cell_type": "code",
329+
"execution_count": null,
330+
"id": "714dbb21",
331+
"metadata": {},
332+
"outputs": [],
333+
"source": [
334+
"import gnss_lib_py as glp"
335+
]
336+
},
337+
{
338+
"cell_type": "code",
339+
"execution_count": null,
340+
"id": "b369035d",
341+
"metadata": {},
342+
"outputs": [],
343+
"source": [
344+
"# download cropped SmartLoc data file\n",
345+
"!wget https://raw.githubusercontent.com/Stanford-NavLab/gnss_lib_py/main/data/unit_test/smartloc/tu_chemnitz_berlin_1_raw.csv --quiet -O \"smartloc.csv\"\n",
346+
" \n",
347+
"# load smartLoc data into NavData object\n",
348+
"smartloc_data = glp.SmartLocRaw(\"smartloc.csv\")"
349+
]
350+
},
351+
{
352+
"cell_type": "code",
353+
"execution_count": null,
354+
"id": "4dd67679",
355+
"metadata": {},
356+
"outputs": [],
357+
"source": [
358+
"# plot the pseudorange over time of each individual satellite\n",
359+
"# SBAS 120 is the outlier with its larger orbit\n",
360+
"fig = glp.plot_metric(smartloc_data, \"gps_millis\",\"raw_pr_m\", groupby=\"sv_id\")"
361+
]
362+
},
363+
{
364+
"cell_type": "code",
365+
"execution_count": null,
366+
"id": "fe8d92d7",
367+
"metadata": {
368+
"scrolled": true
369+
},
370+
"outputs": [],
371+
"source": [
372+
"# show the ground truth smartLoc data on a map\n",
373+
"fig = glp.plot_map(smartloc_data)\n",
374+
"fig.show()"
375+
]
376+
},
377+
{
378+
"cell_type": "markdown",
379+
"id": "1c7b4ed3",
380+
"metadata": {},
381+
"source": [
382+
"# SP3 File Parsing"
383+
]
384+
},
385+
{
386+
"cell_type": "markdown",
387+
"id": "9777add4",
388+
"metadata": {},
389+
"source": [
390+
"This tutorial shows how to load SP3 files."
391+
]
392+
},
393+
{
394+
"cell_type": "code",
395+
"execution_count": null,
396+
"id": "72f716de",
397+
"metadata": {},
398+
"outputs": [],
399+
"source": [
400+
"# download an example .sp3 data file\n",
401+
"!wget https://raw.githubusercontent.com/Stanford-NavLab/gnss_lib_py/main/data/unit_test/sp3/COD0MGXFIN_20211180000_01D_05M_ORB.SP3 --quiet -O \"COD0MGXFIN_20211180000_01D_05M_ORB.SP3\"\n",
402+
"# Specify .sp3 file path to extract precise ephemerides\n",
403+
"sp3_path = \"COD0MGXFIN_20211180000_01D_05M_ORB.SP3\""
404+
]
405+
},
406+
{
407+
"cell_type": "markdown",
408+
"id": "ef1ffeca",
409+
"metadata": {},
410+
"source": [
411+
"Use the SP3 class loader to load in the SP3 file. The class can also optionally take multiple files as a list."
412+
]
413+
},
414+
{
415+
"cell_type": "code",
416+
"execution_count": null,
417+
"id": "2f3d2d21",
418+
"metadata": {},
419+
"outputs": [],
420+
"source": [
421+
"sp3 = glp.Sp3(sp3_path)\n",
422+
"sp3"
423+
]
424+
},
425+
{
426+
"cell_type": "markdown",
427+
"id": "95e38bf1",
428+
"metadata": {},
429+
"source": [
430+
"To visualize the results, we'll plot the ECEF x position of the first 10 GPS satellites."
431+
]
432+
},
433+
{
434+
"cell_type": "code",
435+
"execution_count": null,
436+
"id": "6ffa98ab",
437+
"metadata": {
438+
"scrolled": false
439+
},
440+
"outputs": [],
441+
"source": [
442+
"sp3_first_ten_gps = sp3.where(\"gnss_id\",\"gps\").where(\"sv_id\",10,\"leq\")\n",
443+
"fig = glp.plot_metric_by_constellation(sp3_first_ten_gps,\"gps_millis\",\"x_sv_m\")"
444+
]
445+
},
446+
{
447+
"cell_type": "markdown",
448+
"id": "a8756760",
449+
"metadata": {},
450+
"source": [
451+
"# CLK File Parsing"
452+
]
453+
},
454+
{
455+
"cell_type": "markdown",
456+
"id": "7ca096db",
457+
"metadata": {},
458+
"source": [
459+
"This tutorial shows how to load CLK files."
460+
]
461+
},
462+
{
463+
"cell_type": "code",
464+
"execution_count": null,
465+
"id": "e0b24834",
466+
"metadata": {},
467+
"outputs": [],
468+
"source": [
469+
"# download an example .clk data file\n",
470+
"!wget https://raw.githubusercontent.com/Stanford-NavLab/gnss_lib_py/main/data/unit_test/clk/COD0MGXFIN_20211180000_01D_30S_CLK.CLK --quiet -O \"COD0MGXFIN_20211180000_01D_30S_CLK.CLK\"\n",
471+
"# Specify .clk file path to extract precise ephemerides\n",
472+
"clk_path = \"COD0MGXFIN_20211180000_01D_30S_CLK.CLK\""
473+
]
474+
},
475+
{
476+
"cell_type": "markdown",
477+
"id": "4213e749",
478+
"metadata": {},
479+
"source": [
480+
"Use the Clk class loader to load in the CLK file. The class can also optionally take multiple files as a list."
481+
]
482+
},
483+
{
484+
"cell_type": "code",
485+
"execution_count": null,
486+
"id": "52199b26",
487+
"metadata": {},
488+
"outputs": [],
489+
"source": [
490+
"clk = glp.Clk(clk_path)\n",
491+
"clk"
492+
]
493+
},
494+
{
495+
"cell_type": "markdown",
496+
"id": "72b2e23d",
497+
"metadata": {},
498+
"source": [
499+
"To visualize the results, we'll plot the clock bias of the first BeiDou satellites."
500+
]
501+
},
502+
{
503+
"cell_type": "code",
504+
"execution_count": null,
505+
"id": "147cdf01",
506+
"metadata": {
507+
"scrolled": true
508+
},
509+
"outputs": [],
510+
"source": [
511+
"clk_first_beidou = clk.where(\"gnss_id\",\"beidou\").where(\"sv_id\",16,\"leq\")\n",
512+
"fig = glp.plot_metric_by_constellation(clk_first_beidou,\"b_sv_m\")"
513+
]
514+
},
318515
{
319516
"cell_type": "markdown",
320517
"id": "b0a917b6",
@@ -436,65 +633,6 @@
436633
" rinex_obs_3.where('gps_millis', rinex_obs_3['gps_millis', 0], 'eq'))"
437634
]
438635
},
439-
{
440-
"cell_type": "markdown",
441-
"id": "95e58b71",
442-
"metadata": {},
443-
"source": [
444-
"# TU Chemnitz SmartLoc\n",
445-
"This tutorial shows how to load data from TU Chemnitz's [smartLoc GNSS Dataset](https://www.tu-chemnitz.de/projekt/smartLoc/gnss_dataset.html.en#Datasets)."
446-
]
447-
},
448-
{
449-
"cell_type": "code",
450-
"execution_count": null,
451-
"id": "714dbb21",
452-
"metadata": {},
453-
"outputs": [],
454-
"source": [
455-
"import gnss_lib_py as glp"
456-
]
457-
},
458-
{
459-
"cell_type": "code",
460-
"execution_count": null,
461-
"id": "b369035d",
462-
"metadata": {},
463-
"outputs": [],
464-
"source": [
465-
"# download cropped SmartLoc data file\n",
466-
"!wget https://raw.githubusercontent.com/Stanford-NavLab/gnss_lib_py/main/data/unit_test/smartloc/tu_chemnitz_berlin_1_raw.csv --quiet -O \"smartloc.csv\"\n",
467-
" \n",
468-
"# load smartLoc data into NavData object\n",
469-
"smartloc_data = glp.SmartLocRaw(\"smartloc.csv\")"
470-
]
471-
},
472-
{
473-
"cell_type": "code",
474-
"execution_count": null,
475-
"id": "4dd67679",
476-
"metadata": {},
477-
"outputs": [],
478-
"source": [
479-
"# plot the pseudorange over time of each individual satellite\n",
480-
"# SBAS 120 is the outlier with its larger orbit\n",
481-
"fig = glp.plot_metric(smartloc_data, \"gps_millis\",\"raw_pr_m\", groupby=\"sv_id\")"
482-
]
483-
},
484-
{
485-
"cell_type": "code",
486-
"execution_count": null,
487-
"id": "fe8d92d7",
488-
"metadata": {
489-
"scrolled": true
490-
},
491-
"outputs": [],
492-
"source": [
493-
"# show the ground truth smartLoc data on a map\n",
494-
"fig = glp.plot_map(smartloc_data)\n",
495-
"fig.show()"
496-
]
497-
},
498636
{
499637
"cell_type": "markdown",
500638
"id": "eb016e74",

0 commit comments

Comments
 (0)