Commit
·
88c4554
1
Parent(s):
91707da
Update inference code
Browse filesSigned-off-by: Benedikt Blumenstiel <[email protected]>
- inference.py +7 -7
inference.py
CHANGED
@@ -131,13 +131,13 @@ def load_example(
|
|
131 |
try:
|
132 |
match = re.search(r'(\d{7,8}T\d{6})', file)
|
133 |
if match:
|
134 |
-
|
135 |
-
|
136 |
-
|
137 |
-
|
138 |
-
|
139 |
-
|
140 |
-
|
141 |
except Exception as e:
|
142 |
print(f'Could not extract timestamp for {file} ({e})')
|
143 |
|
|
|
131 |
try:
|
132 |
match = re.search(r'(\d{7,8}T\d{6})', file)
|
133 |
if match:
|
134 |
+
year = int(match.group(1)[:4])
|
135 |
+
julian_day = match.group(1).split('T')[0][4:]
|
136 |
+
if len(julian_day) == 3:
|
137 |
+
julian_day = int(julian_day)
|
138 |
+
else:
|
139 |
+
julian_day = datetime.datetime.strptime(julian_day, '%m%d').timetuple().tm_yday
|
140 |
+
temporal_coords.append([year, julian_day])
|
141 |
except Exception as e:
|
142 |
print(f'Could not extract timestamp for {file} ({e})')
|
143 |
|