Skip to content

Commit 9f244de

Browse files
committed
Catch TypeError & define i-band in the SLSN kernel with a dummy value
1 parent 1061a60 commit 9f244de

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

fink_science/ztf/superluminous/kernel.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,8 @@
1919
curdir = os.path.dirname(os.path.abspath(__file__))
2020

2121
classifier_path = curdir + "/data/models/superluminous_classifier.joblib"
22-
band_wave_aa = {1: 4770.0, 2: 6231.0}
22+
# Declare i-band with dummy value
23+
band_wave_aa = {1: 4770.0, 2: 6231.0, 3: 0.0}
2324
temperature = "sigmoid"
2425
bolometric = "bazin"
2526
min_points_total = 7

fink_science/ztf/superluminous/slsn_classifier.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -378,7 +378,7 @@ def fit_rainbow(lc, rainbow_model):
378378

379379
return list(result[:-1]) + list(result[:-1] / errors) + [result[-1]]
380380

381-
except RuntimeError:
381+
except (TypeError, RuntimeError):
382382
return [np.nan] * (2 * len(rainbow_model.names) + 1)
383383

384384

0 commit comments

Comments
 (0)