diff --git a/code/parse_copenhagen.py b/code/parse_copenhagen.py index 6d27cb7..d5aaaaf 100644 --- a/code/parse_copenhagen.py +++ b/code/parse_copenhagen.py @@ -30,9 +30,11 @@ rssi = 3 def main(args): - # Get contacts [tim, uid_a, uid_b] from previous parsing - cont = lmdk_lib.load_data(args, 'cont') - if cont.size == 0: + # Get contacts from previous parsing + cont_data = lmdk_lib.load_data(args, 'cont') + if cont_data.size == 0: + # Contacts [tim, uid_a, uid_b, rssi] + cont = [] try: print('Extracting %s... ' %(os.path.abspath(args.arc)), end='', flush=True) with zipfile.ZipFile(args.arc, 'r') as arc: @@ -46,14 +48,14 @@ def main(args): for c in cont_l: if c[uid_b] != '-1' and c[rssi] != '0' and c[uid_b] != '-2' and c[uid_a] != c[uid_b]: # Add valid contact - cont.append([c[tim], c[uid_a], c[uid_b]]) + cont.append([c[tim], c[uid_a], c[uid_b], c[rssi]]) print('[OK]') except Exception as e: print('[Error: %s]' %(e)) except Exception as e: print('[Error: %s]' %(e)) # Save to results - lmdk_lib.save_data(args, np.array(cont), 'cont') + lmdk_lib.save_data(args, np.array(cont, np.float32), 'cont') '''