|
4 | 4 | "cell_type": "markdown", |
5 | 5 | "metadata": {}, |
6 | 6 | "source": [ |
7 | | - "This tutorial explains how to estimate SV states, both as estimation for\n", |
8 | | - "a single time instance and measurements and as a wrapper for an entire\n", |
9 | | - "set of received measurements." |
| 7 | + "Load `gnss_lib_py` into the Python workspace" |
| 8 | + ] |
| 9 | + }, |
| 10 | + { |
| 11 | + "cell_type": "code", |
| 12 | + "execution_count": null, |
| 13 | + "metadata": {}, |
| 14 | + "outputs": [], |
| 15 | + "source": [ |
| 16 | + "import gnss_lib_py as glp" |
10 | 17 | ] |
11 | 18 | }, |
12 | 19 | { |
13 | 20 | "cell_type": "markdown", |
14 | 21 | "metadata": {}, |
15 | 22 | "source": [ |
16 | | - "For this tutorial, we will work with the `AndroidDerived2022` dataset.\n", |
17 | | - "This serves the dual purpose of showing how each functionality works and\n", |
18 | | - "allowing us to compare the SV states estimated in `sv_models.py` to that\n", |
19 | | - "estimated by Google. The latter verifies state computation from our method." |
| 23 | + "# Adding SV States with Precise Ephemerides (SP3 & CLK)" |
| 24 | + ] |
| 25 | + }, |
| 26 | + { |
| 27 | + "cell_type": "markdown", |
| 28 | + "metadata": {}, |
| 29 | + "source": [ |
| 30 | + "This tutorial explains how to calculate satellite states using precise SP3 and CLK files.\n", |
| 31 | + "\n", |
| 32 | + "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", |
| 33 | + "\n", |
| 34 | + "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", |
| 35 | + "\n", |
| 36 | + "Similarly, the .clk files provide post-processed, accurate and precise information on satellite clock errors at intervals of 30secs each. \n", |
| 37 | + "\n", |
| 38 | + "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\n", |
| 39 | + "\n", |
| 40 | + "We show how to analyze this precise ephemerides functionality for the Android derived dataset in the following cells, \n", |
| 41 | + "\n", |
| 42 | + "1. Load the derived data from AndroidDerived and remove the rows in NavData class that refer to satellite information (3-D satellite position, 3-D satellite velocity, clock bias and clock drift)," |
| 43 | + ] |
| 44 | + }, |
| 45 | + { |
| 46 | + "cell_type": "code", |
| 47 | + "execution_count": null, |
| 48 | + "metadata": {}, |
| 49 | + "outputs": [], |
| 50 | + "source": [ |
| 51 | + "import numpy as np\n", |
| 52 | + "\n", |
| 53 | + "# load Android Google Challenge data\n", |
| 54 | + "!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", |
| 55 | + "derived_data = glp.AndroidDerived2021(\"Pixel4_derived_clkdiscnt.csv\", remove_timing_outliers=False)\n", |
| 56 | + "# Define the keys relevant for satellite information, and remove the data within these fields\n", |
| 57 | + "SV_KEYS = ['x_sv_m', 'y_sv_m', 'z_sv_m', \\\n", |
| 58 | + " 'vx_sv_mps','vy_sv_mps','vz_sv_mps', \\\n", |
| 59 | + " 'b_sv_m', 'b_dot_sv_mps']\n", |
| 60 | + "derived_data.remove(rows=SV_KEYS,inplace=True)" |
| 61 | + ] |
| 62 | + }, |
| 63 | + { |
| 64 | + "cell_type": "markdown", |
| 65 | + "metadata": {}, |
| 66 | + "source": [ |
| 67 | + "2. Specify the paths to the .sp3 and .clk files using the `file_path` variable. If files are not specified, they will be automatically downloaded using the ephemeris downloader." |
| 68 | + ] |
| 69 | + }, |
| 70 | + { |
| 71 | + "cell_type": "code", |
| 72 | + "execution_count": null, |
| 73 | + "metadata": {}, |
| 74 | + "outputs": [], |
| 75 | + "source": [ |
| 76 | + "# download .sp3 data file\n", |
| 77 | + "!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", |
| 78 | + "# Specify .sp3 file path to extract precise ephemerides\n", |
| 79 | + "sp3_path = \"COD0MGXFIN_20211180000_01D_05M_ORB.SP3\"\n", |
| 80 | + "\n", |
| 81 | + "# download .clk data file\n", |
| 82 | + "!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", |
| 83 | + "# Specify .clk file path to extract precise ephemerides\n", |
| 84 | + "clk_path = \"COD0MGXFIN_20211180000_01D_30S_CLK.CLK\"" |
| 85 | + ] |
| 86 | + }, |
| 87 | + { |
| 88 | + "cell_type": "markdown", |
| 89 | + "metadata": {}, |
| 90 | + "source": [ |
| 91 | + "3. Populate the columns of SV_KEYS with information extracted via precise ephemerides" |
| 92 | + ] |
| 93 | + }, |
| 94 | + { |
| 95 | + "cell_type": "code", |
| 96 | + "execution_count": null, |
| 97 | + "metadata": {}, |
| 98 | + "outputs": [], |
| 99 | + "source": [ |
| 100 | + "# Update derived_data class with satellite information computed via precise ephemerides\n", |
| 101 | + "derived_multi_gnss = glp.add_sv_states(derived_data, source=\"precise\", file_paths=[sp3_path, clk_path],\n", |
| 102 | + " verbose = False)" |
| 103 | + ] |
| 104 | + }, |
| 105 | + { |
| 106 | + "cell_type": "markdown", |
| 107 | + "metadata": {}, |
| 108 | + "source": [ |
| 109 | + "Check that all the desired fields related to satellite information have useful information and the norm of computed satellite position matches the altitude of GNSS constellations" |
| 110 | + ] |
| 111 | + }, |
| 112 | + { |
| 113 | + "cell_type": "code", |
| 114 | + "execution_count": null, |
| 115 | + "metadata": {}, |
| 116 | + "outputs": [], |
| 117 | + "source": [ |
| 118 | + "\n", |
| 119 | + "sat_alt = np.linalg.norm(derived_multi_gnss[[\"x_sv_m\",\"y_sv_m\",\"z_sv_m\"],9:12],axis=0)\n", |
| 120 | + "print('Distance of two satellites from the center of the Earth (expected around 26000000 m)')\n", |
| 121 | + "print(\"Three GPS SVs calculated to be at:\", sat_alt,\"\\n\")\n", |
| 122 | + "\n", |
| 123 | + "print(\"Small section of calculated positions:\")\n", |
| 124 | + "print(derived_multi_gnss.copy(cols=[2,3,4,5],rows=[\"gnss_id\"]+SV_KEYS))" |
20 | 125 | ] |
21 | 126 | }, |
22 | 127 | { |
|
30 | 135 | "cell_type": "markdown", |
31 | 136 | "metadata": {}, |
32 | 137 | "source": [ |
| 138 | + "This tutorial explains how to estimate SV states, both as estimation for\n", |
| 139 | + "a single time instance and measurements and as a wrapper for an entire\n", |
| 140 | + "set of received measurements.\n", |
| 141 | + "\n", |
| 142 | + "For this tutorial, we will work with the `AndroidDerived2022` dataset.\n", |
| 143 | + "This serves the dual purpose of showing how each functionality works and\n", |
| 144 | + "allowing us to compare the SV states estimated in `sv_models.py` to that\n", |
| 145 | + "estimated by Google. The latter verifies state computation from our method.\n", |
| 146 | + "\n", |
33 | 147 | "Load the test dataset for the Android Derived 2022 dataset" |
34 | 148 | ] |
35 | 149 | }, |
|
40 | 154 | "outputs": [], |
41 | 155 | "source": [ |
42 | 156 | "import numpy as np\n", |
43 | | - "import gnss_lib_py as glp\n", |
44 | 157 | "# download Android data file\n", |
45 | 158 | "!wget https://raw.githubusercontent.com/Stanford-NavLab/gnss_lib_py/main/data/unit_test/android_2022/device_gnss.csv --quiet -O \"device_gnss.csv\"\n", |
46 | 159 | "# load Android Google Challenge data\n", |
|
0 commit comments