Last active
February 14, 2017 20:00
-
-
Save papr/92d9cf729ff130e500dfa53bb595f31b to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import numpy as np | |
deduplication_offset = 1e-9 | |
deduplication_counter = 0 | |
timestamp_file_path = 'world_timestamps.npy' | |
print('Loading timestamps...') | |
timestamps = np.sort(np.load(timestamp_file_path)) | |
print('Starting timestamp deduplication...') | |
for idx in range(1, timestamps.shape[0]): | |
if timestamps[idx] - timestamps[idx-1] < deduplication_offset: | |
timestamps[idx] += deduplication_offset | |
deduplication_counter += 1 | |
print('Deduplicated {} timestamps.'.format(deduplication_counter)) | |
np.save(timestamp_file_path, timestamps) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment