diff --git a/opencellid_parsing/003b.extract_only_enough_data_with_groundtruth.py b/opencellid_parsing/003b.extract_only_enough_data_with_groundtruth.py index 2352bb9..5046360 100644 --- a/opencellid_parsing/003b.extract_only_enough_data_with_groundtruth.py +++ b/opencellid_parsing/003b.extract_only_enough_data_with_groundtruth.py @@ -19,8 +19,6 @@ data = pickle.load(open(pickle_fp_with_gt, 'rb')) threshold = int(input("please enter minimal number of measurements:")) outputfolder = '{}_extracted_thresh_{}'.format(folderpath.rstrip('/'), threshold) -if not os.path.isdir(outputfolder): - os.makedirs(outputfolder) headline = '#lon,lat,sig,measure_at,upload_at,rating,speed,direction' headlines = { @@ -55,3 +53,5 @@ for filepath in data: for dataline in data[filepath][1]: of.write(dataline + "\n") print("done: {} out of {} files extracted ({:.2f}%)".format(counter_valid, len(data), 100.0 * counter_valid / len(data))) + +os.rename('{}_extracted'.format(folderpath.rstrip('/')), outputfolder)