@@ -66,6 +66,14 @@ def postprocess(self):
6666 "GPSSecondsOfWeek [s]"
6767 ],inplace = True )
6868
69+ # change all NLOS columns to be integers
70+ nlos_idx = 'NLOS (0 == no, 1 == yes, # == No Information)'
71+ nlos_new = 'NLOS (0 == no, 1 == yes, 2 == No Information)'
72+ if self .is_str (nlos_idx ) and '#' in np .unique (self [nlos_idx ]):
73+ # replace '#' values with 2 and convert to ints
74+ self [nlos_idx ] = np .where (self [nlos_idx ]== '#' ,
75+ '2' ,self [nlos_idx ]).astype (int )
76+ self .rename ({nlos_idx :nlos_new },inplace = True )
6977
7078 @staticmethod
7179 def _row_map ():
@@ -100,7 +108,28 @@ def _row_map():
100108 return row_map
101109
102110def remove_nlos (smartloc_raw ):
103- """Remove NLOS measurements from SmartLoc data instance.
111+ """Remove NLOS and 'no information' measurements from SmartLoc.
112+
113+ The dataset's paper[1]_ says the following about their NLOS
114+ classification process:
115+ "The NovAtel receiver is also able to provide raw measurement
116+ (pseudorange) information like the u-blox receiver. The
117+ u-blox receiver provide information about all received satellite
118+ signals. The NovAtel receiver seems to exclude some satellites
119+ in harsh environments, which might be affected by NLOS.
120+ NovAtel used for receiving a Pinwheel antenna and internally
121+ different algorithms. Hence, we use this information to build a
122+ NLOS detection based on different satellites availabilities in
123+ both receivers. Therefore, we remember the last received set
124+ of satellites from NovAtel and time of data. When we receive
125+ in next step a set of satellites from u-blox, we compare the
126+ availability of each satellite and time span since the last update
127+ from the NovAtel. If the time span is too high or the satellite
128+ was never seen before, the pseudorange measurement or satellite
129+ marked as NLOS. In the other case, the measurement marked
130+ as LOS. This approach gives a hint for the type of LOS or
131+ NLOS of a given measurement and we export this information
132+ to complete the datasets."
104133
105134 Parameters
106135 ----------
@@ -112,9 +141,17 @@ def remove_nlos(smartloc_raw):
112141 smartloc_los : gnss_lib_py.parsers.navdata.NavData
113142 Instance of NavData containing only LOS labeled measurements
114143
144+ References
145+ ----------
146+ .. [1] Reisdorf, Pierre, Tim Pfeifer, Julia Bressler, Sven Bauer,
147+ Peter Weissig, Sven Lange, Gerd Wanielik and Peter Protzel.
148+ The Problem of Comparable GNSS Results – An Approach for a
149+ Uniform Dataset with Low-Cost and Reference Data. Vehicular.
150+ 2016.
151+
115152 """
116- smartloc_los = smartloc_raw .where ('NLOS (0 == no, 1 == yes, # == No Information)' ,
117- 1 , 'eq' )
153+ smartloc_los = smartloc_raw .where ('NLOS (0 == no, 1 == yes, 2 == No Information)' ,
154+ 0 , 'eq' )
118155 return smartloc_los
119156
120157def calculate_gt_ecef (smartloc_raw ):
@@ -133,6 +170,7 @@ def calculate_gt_ecef(smartloc_raw):
133170 """
134171 llh = smartloc_raw [['lat_rx_gt_deg' , 'lon_rx_gt_deg' , 'alt_rx_gt_m' ]]
135172 rx_ecef = geodetic_to_ecef (llh )
173+ smartloc_raw = smartloc_raw .copy ()
136174 smartloc_raw ['x_rx_gt_m' ] = rx_ecef [0 , :]
137175 smartloc_raw ['y_rx_gt_m' ] = rx_ecef [1 , :]
138176 smartloc_raw ['z_rx_gt_m' ] = rx_ecef [2 , :]
@@ -176,6 +214,7 @@ def calculate_gt_vel(smartloc_raw):
176214 vel_acc ['ax_rx_gt_mps2' ].extend (np .repeat (acc_ecef [0 , 0 ], len (measure_frame )))
177215 vel_acc ['ay_rx_gt_mps2' ].extend (np .repeat (acc_ecef [1 , 0 ], len (measure_frame )))
178216 vel_acc ['az_rx_gt_mps2' ].extend (np .repeat (acc_ecef [2 , 0 ], len (measure_frame )))
217+ smartloc_raw = smartloc_raw .copy ()
179218 for row , values in vel_acc .items ():
180219 smartloc_raw [row ] = values
181220 return smartloc_raw
0 commit comments