|
266 | 266 | "gt_data.rows" |
267 | 267 | ] |
268 | 268 | }, |
| 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 | + }, |
269 | 409 | { |
270 | 410 | "cell_type": "markdown", |
271 | 411 | "id": "eb016e74", |
|
542 | 682 | "from gnss_lib_py.utils.visualizations import plot_metric\n", |
543 | 683 | "fig = plot_metric(my_receiver_data,\"gps_millis\",\"corr_pr_m\",groupby=\"sv_id\")" |
544 | 684 | ] |
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 | | - ] |
684 | 685 | } |
685 | 686 | ], |
686 | 687 | "metadata": { |
|
0 commit comments