Skip to content

Commit a34e807

Browse files
author
Tabarly
committed
update adjust script
1 parent b82dfd6 commit a34e807

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

utilities/postprocessing/adjust.py

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,17 +7,22 @@
77
from pathlib import Path
88
import re
99

10-
CORRECTION = timedelta(10, 60496)
11-
10+
# CORRECTION = timedelta(10, 60496)
11+
CORRECTION = timedelta(seconds=(1535393272-1529482132)) # epoch from good - raspi
1212
TIMESTAMP_RE = r'(\d{4})-(\d{2})-(\d{2})-?T?(\d{2})[-.](\d{2})[-.](\d{2})'
1313

14-
for path in sorted(Path.cwd().glob('*_2017-04-1*')):
14+
#for path in sorted(Path.cwd().glob('*_2018-06-20-*')):
15+
for path in sorted(Path.cwd().glob('*_triangle*')):
1516
print('--')
1617
print(path.name)
1718
m = re.search(TIMESTAMP_RE, path.name)
1819
old_ts = datetime(*[int(g) for g in m.groups()])
1920
new_ts = old_ts + CORRECTION
20-
new_name = path.name[:m.start()] + new_ts.strftime("%Y-%m-%dT%H.%M.%S") \
21+
if "T" in path.name:
22+
new_name = path.name[:m.start()] + new_ts.strftime("%Y-%m-%dT%H.%M.%S") \
23+
+ path.name[m.end():]
24+
else:
25+
new_name = path.name[:m.start()] + new_ts.strftime("%Y-%m-%d-%H-%M-%S") \
2126
+ path.name[m.end():]
2227
print(new_name)
2328
new_file = path.parent / new_name

0 commit comments

Comments
 (0)