add filter ouptut on single moving direction
suffix: 0 = -> 1 = v 2 = <- 3 = ^ 4 = < ^ > 5 = < v >
This commit is contained in:
parent
2f4b3f45fa
commit
5ff5e5fa55
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
|
@ -63,12 +63,10 @@ def blocking_display_rss_map(rss_map: np.ndarray):
|
|||
'''
|
||||
'''
|
||||
plt.imshow(
|
||||
np.transpose(rss_map) - np.nanmedian(rss_map),
|
||||
np.transpose(rss_map),
|
||||
cmap='hot',
|
||||
origin='lower',
|
||||
interpolation='nearest',
|
||||
vmin=-15,
|
||||
vmax=15
|
||||
interpolation='nearest'
|
||||
)
|
||||
plt.colorbar()
|
||||
# plt.show()
|
||||
|
|
@ -81,7 +79,7 @@ def blocking_display_rss_map(rss_map: np.ndarray):
|
|||
print()
|
||||
|
||||
|
||||
def convert_to_pickle_rss(fp: str, orientation: int, visualize: bool):
|
||||
def convert_to_pickle_rss(fp: str, orientation: int, visualize: bool = False, filters: int = None):
|
||||
'''
|
||||
modified from Zhuolin
|
||||
'''
|
||||
|
|
@ -137,17 +135,32 @@ def convert_to_pickle_rss(fp: str, orientation: int, visualize: bool):
|
|||
upper_bound_y + factor * PICKLE_MAP_STEP
|
||||
)
|
||||
data_fullfilled = data_part[2, data_y_idxs]
|
||||
# orientation_fullfilled = data_part[3, data_y_idxs]
|
||||
# data_fullfilled[(orientation_fullfilled > 0.5 * np.pi) & (orientation_fullfilled < 1.5 * np.pi)] = data_fullfilled[(orientation_fullfilled > 0.5 * np.pi) & (orientation_fullfilled < 1.5 * np.pi)] + 10.0
|
||||
# data_fullfilled[(orientation_fullfilled > 0.1 * np.pi) & (orientation_fullfilled < 0.5 * np.pi)] = data_fullfilled[(orientation_fullfilled > 0.1 * np.pi) & (orientation_fullfilled < 0.5 * np.pi)] + 5.0
|
||||
# data_fullfilled[(orientation_fullfilled > 1.5 * np.pi) & (orientation_fullfilled < 1.9 * np.pi)] = data_fullfilled[(orientation_fullfilled > 1.5 * np.pi) & (orientation_fullfilled < 1.9 * np.pi)] + 5.0
|
||||
orientation_fullfilled = data_part[3, data_y_idxs]
|
||||
if filters is 0:
|
||||
data_fullfilled = data_fullfilled[(orientation_fullfilled > 1.75 * np.pi) | (orientation_fullfilled < 0.25 * np.pi)]
|
||||
elif filters is 1:
|
||||
data_fullfilled = data_fullfilled[(orientation_fullfilled > 1.25 * np.pi) & (orientation_fullfilled < 1.75 * np.pi)]
|
||||
elif filters is 2:
|
||||
data_fullfilled = data_fullfilled[(orientation_fullfilled > 0.75 * np.pi) & (orientation_fullfilled < 1.25 * np.pi)]
|
||||
elif filters is 3:
|
||||
data_fullfilled = data_fullfilled[(orientation_fullfilled > 0.25 * np.pi) & (orientation_fullfilled < 0.75 * np.pi)]
|
||||
elif filters is 4:
|
||||
data_fullfilled = data_fullfilled[(orientation_fullfilled > 1.5 * np.pi) | (orientation_fullfilled < 0.5 * np.pi)]
|
||||
elif filters is 5:
|
||||
data_fullfilled = data_fullfilled[(orientation_fullfilled > 0.5 * np.pi) & (orientation_fullfilled < 1.5 * np.pi)]
|
||||
if data_fullfilled.size:
|
||||
rss_map[i, j] = max(np.median(data_fullfilled), -85.0)
|
||||
|
||||
if visualize:
|
||||
blocking_display_rss_map(rss_map)
|
||||
|
||||
with open(fp.replace(".csv", "_pkttype_{}_map.pickle".format(pkt_types[0][0])), "wb") as f:
|
||||
with open(
|
||||
fp.replace(
|
||||
".csv", "_pkttype_{}_map{}.pickle"
|
||||
.format(pkt_types[0][0], "" if filters is None else "_{}".format(filters))
|
||||
),
|
||||
"wb"
|
||||
) as f:
|
||||
pickle.dump(rss_map, f)
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -74,7 +74,13 @@ def convert_to_pickle(filepaths, orientation, visualize, is_csi):
|
|||
for filepath in filepaths:
|
||||
print("parsing file: {}".format(filepath))
|
||||
try:
|
||||
convert_to_pickle_rss(filepath, orientation, visualize)
|
||||
convert_to_pickle_rss(filepath, orientation, visualize=visualize, filters=None)
|
||||
convert_to_pickle_rss(filepath, orientation, visualize=visualize, filters=0)
|
||||
convert_to_pickle_rss(filepath, orientation, visualize=visualize, filters=1)
|
||||
convert_to_pickle_rss(filepath, orientation, visualize=visualize, filters=2)
|
||||
convert_to_pickle_rss(filepath, orientation, visualize=visualize, filters=3)
|
||||
convert_to_pickle_rss(filepath, orientation, visualize=visualize, filters=4)
|
||||
convert_to_pickle_rss(filepath, orientation, visualize=visualize, filters=5)
|
||||
except KeyboardInterrupt:
|
||||
print("KeyboardInterrupt happened")
|
||||
|
||||
|
|
@ -94,6 +100,7 @@ def main(args):
|
|||
f_sig_extracted = extract_dev_from_combined(f_sig_combined, minimalCounts=5000)
|
||||
|
||||
if args.pickle:
|
||||
# f_sig_extracted = [x for x in f_sig_extracted if '98fc11691fc5' in x]
|
||||
convert_to_pickle(f_sig_extracted, args.orientation, args.visualize, is_csi)
|
||||
|
||||
# generate path in map for visualization
|
||||
|
|
|
|||
Loading…
Reference in New Issue