MODELS = ['', '_gamma', '_delta', '_epsilon', '_theta', '_omega'] # '' corresponds to the model for a telegram channel
df = df.withColumn('lc_features', extract_features_ad(*ad_args)))
for model in MODELS:
df = df.withColumn(f'anomaly_score{model}', anomaly_score('lc_features', F.lit(model))))
for model in MODELS:
df_proc = df.select(
'objectId', 'candidate.ra',
'candidate.dec', 'candidate.rb',
f'anomaly_score{model}', "timestamp")
if model == '':
df_out = anomaly_notification_(df_proc, threshold=10,
send_to_tg=True, channel_id=...,
send_to_slack=True, channel_name=...)
else:
df_out = anomaly_notification_(df_proc, send_to_tg=False, send_to_slack=False, send_to_anomaly_base=True, model=model)
If model=='', notifications are only uploaded to the telegram and slack channels. Notifications from other models can be uploaded to both messengers and anomaly base.
Added the option to upload notifications to https://anomaly.fink-portal.org/.
It could be used like this, for example:
If
model==''
, notifications are only uploaded to the telegram and slack channels. Notifications from other models can be uploaded to both messengers and anomaly base.