Update localization_log_gamma_model.py

This commit is contained in:
HappyZ 2019-06-05 22:37:14 -05:00
parent acb197ef95
commit b6d31f5366
1 changed files with 11 additions and 0 deletions

View File

@ -31,11 +31,15 @@ def fittingSingle(filepath, args):
if data is None:
print("err: failed to load file {}".format(filepath))
return
location_gt_tmp = None
location_gt = [float('nan'), float('nan')]
if len(data) is 2:
data, location_gt_tmp = data
if location_gt_tmp is not None:
location_gt = location_gt_tmp * 0.1
if args.only_true_loc and location_gt_tmp is None:
print("skipped as no groundtruth")
return
# convert data matrix to vectors
rx_locs, rx_rsses = convert_mat_to_vector(data, block_size=0.1)
@ -173,6 +177,13 @@ if __name__ == '__main__':
default=None,
help='output results to filepath'
)
p.add_argument(
'--with-true-loc-only', '--trueloc-only',
dest='only_true_loc',
action='store_true',
default=False,
help='only parse known location ones'
)
try:
args = p.parse_args()
except BaseException as e: