You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
#function for mapping sensor locations with constraints
134
-
defnorm_calc_exact_n_const_sensors(lin_idx, dlens, piv, j, n_const_sensors): ##Will first force sensors into constrained region
135
-
#num_sensors should be fixed for each custom constraint (for now)
136
-
#num_sensors must be <= size of constraint region
137
-
"""
138
-
Function for mapping constrained sensor locations with the QR procedure.
139
-
140
-
Parameters
141
-
----------
142
-
lin_idx: np.ndarray, shape [No. of constrained locations]
143
-
Array which contains the constrained locationsof the grid in terms of column indices of basis_matrix.
144
-
dlens: np.ndarray, shape [Variable based on j]
145
-
Array which contains the norm of columns of basis matrix.
146
-
piv: np.ndarray, shape [n_features]
147
-
Ranked list of sensor locations.
148
-
n_const_sensors: int,
149
-
Number of sensors to be placed in the constrained area.
150
-
j: int,
151
-
Iterative variable in the QR algorithm.
152
-
153
-
Returns
154
-
-------
155
-
dlens : np.darray, shape [Variable based on j] with constraints mapped into it.
156
-
"""
157
-
ifj<n_const_sensors: # force sensors into constraint region
158
-
#idx = np.arange(dlens.shape[0])
159
-
#dlens[np.delete(idx, lin_idx)] = 0
160
-
161
-
didx=np.isin(piv[j:],lin_idx,invert=True)
162
-
dlens[didx] =0
163
-
else:
164
-
didx=np.isin(piv[j:],lin_idx,invert=False)
165
-
dlens[didx] =0
166
-
returndlens
167
-
168
-
defnorm_calc_max_n_const_sensors(lin_idx, dlens, piv, j, const_sensors,all_sensors,n_sensors): ##Optimal sensor placement with constraints (will place sensors in the order of QR)
169
-
"""
170
-
Function for mapping constrained sensor locations with the QR procedure (Optimally).
171
-
172
-
Parameters
173
-
----------
174
-
lin_idx: np.ndarray, shape [No. of constrained locations]
175
-
Array which contains the constrained locationsof the grid in terms of column indices of basis_matrix.
176
-
dlens: np.ndarray, shape [Variable based on j]
177
-
Array which contains the norm of columns of basis matrix.
178
-
piv: np.ndarray, shape [n_features]
179
-
Ranked list of sensor locations.
180
-
j: int,
181
-
Iterative variable in the QR algorithm.
182
-
const_sensors: int,
183
-
Number of sensors to be placed in the constrained area.
184
-
all_sensors: np.ndarray, shape [n_features]
185
-
Ranked list of sensor locations.
186
-
n_sensors: integer,
187
-
Total number of sensors
188
-
189
-
Returns
190
-
-------
191
-
dlens : np.darray, shape [Variable based on j] with constraints mapped into it.
0 commit comments