Skip to content

Commit bd0da9a

Browse files
committed
pylint changes
1 parent efb264c commit bd0da9a

2 files changed

Lines changed: 88 additions & 92 deletions

File tree

gnss_lib_py/utils/dop.py

Lines changed: 28 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,9 @@ def get_enu_dop_labels():
2323
List of strings for the DOP labels.
2424
"""
2525

26-
dop_labels = ['ee', 'en', 'eu', 'et',
27-
'nn', 'nu', 'nt',
28-
'uu', 'ut',
26+
dop_labels = ['ee', 'en', 'eu', 'et',
27+
'nn', 'nu', 'nt',
28+
'uu', 'ut',
2929
'tt']
3030
return dop_labels
3131

@@ -42,18 +42,18 @@ def get_dop(navdata, **which_dop):
4242
4343
which_dop : dict
4444
Dictionary of which dop values are needed. Default is HDOP and VDOP.
45-
46-
Note that the dop matrix output is splatted across entries following
45+
46+
Note that the dop matrix output is splatted across entries following
4747
the behavior below:
4848
[[EE, EN, EU, ET],
4949
[NE, NN, NU, NT],
5050
[UE, UN, UU, UT],
5151
[TE, TN, TU, TT]] (16 values in 2D array)
5252
is stored as
53-
[EE, EN, EU, ET,
54-
NN, NU, NT,
55-
UU, UT,
56-
TT] (10 values in 1D array),
53+
[EE, EN, EU, ET,
54+
NN, NU, NT,
55+
UU, UT,
56+
TT] (10 values in 1D array),
5757
recognizing that the dop matrix is symmetric.
5858
5959
Returns
@@ -98,7 +98,7 @@ def get_dop(navdata, **which_dop):
9898
for dop_name, include_dop in which_dop.items():
9999
if include_dop:
100100
dop_out[dop_name].append(dop[dop_name])
101-
101+
102102
# Create a new NavData instance to store the DOP
103103
dop_navdata = NavData()
104104
dop_navdata['gps_millis'] = np.array(times)
@@ -107,17 +107,17 @@ def get_dop(navdata, **which_dop):
107107
# We need to handle the dop_matrix separately
108108
if include_dop and dop_name != 'dop_matrix':
109109
dop_navdata[dop_name] = np.array(dop_out[dop_name])
110-
110+
111111
# Special handling for splatting the dop_matrix
112112
if which_dop['dop_matrix']:
113113

114114
dop_labels = get_enu_dop_labels()
115-
115+
116116
dop_matrix_splat = []
117117

118118
for dop_matrix in dop_out['dop_matrix']:
119119
dop_matrix_splat.append(splat_dop_matrix(dop_matrix))
120-
120+
121121
# Convert entire array across time to numpy array
122122
dop_matrix_splat = np.array(dop_matrix_splat)
123123
assert dop_matrix_splat.shape == (len(times), len(dop_labels)), \
@@ -132,18 +132,18 @@ def get_dop(navdata, **which_dop):
132132

133133
def splat_dop_matrix(dop_matrix):
134134
"""
135-
Splat the DOP matrix into a 1D array. Note that the dop matrix output
136-
is splatted across entries following
135+
Splat the DOP matrix into a 1D array. Note that the dop matrix output
136+
is splatted across entries following
137137
the behavior below:
138138
[[EE, EN, EU, ET],
139139
[NE, NN, NU, NT],
140140
[UE, UN, UU, UT],
141141
[TE, TN, TU, TT]] (16 values in 2D array)
142142
is stored as
143-
[EE, EN, EU, ET,
144-
NN, NU, NT,
145-
UU, UT,
146-
TT] (10 values in 1D array),
143+
[EE, EN, EU, ET,
144+
NN, NU, NT,
145+
UU, UT,
146+
TT] (10 values in 1D array),
147147
recognizing that the dop matrix is symmetric.
148148
149149
Parameters
@@ -158,7 +158,7 @@ def splat_dop_matrix(dop_matrix):
158158
"""
159159

160160
# Splat the DOP matrix
161-
dop_splat = dop_matrix[(0, 0, 0, 0, 1, 1, 1, 2, 2, 3),
161+
dop_splat = dop_matrix[(0, 0, 0, 0, 1, 1, 1, 2, 2, 3),
162162
(0, 1, 2, 3, 1, 2, 3, 2, 3, 3)]
163163

164164
return np.array(dop_splat)
@@ -178,18 +178,18 @@ def unsplat_dop_matrix(dop_splat):
178178
[UE, UN, UU, UT],
179179
[TE, TN, TU, TT]] (16 values in 2D array)
180180
recognizing that the dop matrix is symmetric.
181-
181+
182182
Parameters
183183
----------
184184
dop_splat : np.ndarray (10,)
185185
DOP matrix splatted into a 1D array.
186-
186+
187187
Returns
188188
-------
189189
dop_matrix : np.ndarray (4, 4)
190190
DOP matrix in ENU coordinates.
191191
"""
192-
192+
193193
# Un-splat the DOP matrix
194194
dop_matrix = np.zeros((4, 4))
195195

@@ -205,18 +205,17 @@ def unsplat_dop_matrix(dop_splat):
205205
return dop_matrix
206206

207207

208-
209208
def calculate_enu_dop_matrix(derived):
210209
"""
211210
Calculate the DOP matrix from elevation and azimuth (ENU).
212-
211+
213212
Parameters
214213
----------
215214
derived : gnss_lib_py.navdata.navdata.NavData
216215
NavData instance containing received GNSS measurements for a
217216
particular time instance, contains elevation and azimuth angle
218217
information for an estimated location.
219-
218+
220219
Returns
221220
-------
222221
dop_matrix : np.ndarray (4, 4)
@@ -234,7 +233,7 @@ def calculate_enu_dop_matrix(derived):
234233
except np.linalg.LinAlgError:
235234
# If the matrix is singular, return NaNs for the DOP
236235
dop_matrix = np.nan * np.ones((4, 4))
237-
236+
238237
return dop_matrix
239238

240239

@@ -311,9 +310,9 @@ def _calculate_enut_matrix(derived):
311310
Matrix of ENU and Time vectors.
312311
313312
"""
314-
enu_unit_dir_mat = el_az_to_enu_unit_vector(derived['el_sv_deg'],
313+
enu_unit_dir_mat = el_az_to_enu_unit_vector(derived['el_sv_deg'],
315314
derived['az_sv_deg'])
316-
enut_matrix = np.hstack((enu_unit_dir_mat,
315+
enut_matrix = np.hstack((enu_unit_dir_mat,
317316
np.ones((enu_unit_dir_mat.shape[0], 1))))
318317

319318
return enut_matrix

0 commit comments

Comments
 (0)