Skip to content

Commit e97dd94

Browse files
committed
Skip more bad light curves
1 parent 7bb66ea commit e97dd94

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

src/qusi/internal/light_curve_dataset.py

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -121,9 +121,15 @@ def __iter__(self):
121121
# TODO: Preprocessing step should be here. Or maybe that should all be on the light curve collection
122122
# as well? Or passed in somewhere else?
123123
standard_light_curve = next(base_collection_iter)
124-
transformed_standard_light_curve = self.post_injection_transform(
125-
standard_light_curve
126-
)
124+
try:
125+
transformed_standard_light_curve = self.post_injection_transform(
126+
standard_light_curve
127+
)
128+
except ValueError as error:
129+
with Path('problem_light_curves.txt').open('a') as problem_files_list_file:
130+
print(f'#############################', flush=True)
131+
print(f'{standard_light_curve.path}', file=problem_files_list_file, flush=True)
132+
continue
127133
yield transformed_standard_light_curve
128134
if collection_type in [
129135
LightCurveCollectionType.INJECTEE,

0 commit comments

Comments
 (0)