Skip to content

Commit

Permalink
Refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
JulienPeloton committed Dec 7, 2023
1 parent 38fb42a commit 3008f81
Showing 1 changed file with 1 addition and 9 deletions.
10 changes: 1 addition & 9 deletions fink_broker/science.py
Original file line number Diff line number Diff line change
Expand Up @@ -505,22 +505,14 @@ def apply_science_modules_elasticc(df: DataFrame) -> DataFrame:
df = df.withColumn('cats_broad_class', mapping_cats_general_expr[df['argmax']])
df = df.withColumn('cats_broad_max_prob', F.array_max(df['cbpf_preds']))

# AGN
# AGN & SLSN
args_forced = [
'diaObject.diaObjectId', 'cmidPointTai', 'cpsFlux', 'cpsFluxErr', 'cfilterName',
'diaSource.ra', 'diaSource.decl',
'diaObject.hostgal_zphot', 'diaObject.hostgal_zphot_err',
'diaObject.hostgal_ra', 'diaObject.hostgal_dec'
]
df = df.withColumn('rf_agn_vs_nonagn', agn_elasticc(*args_forced))

# SLSN
args_forced = [
'diaObject.diaObjectId', 'cmidPointTai', 'cpsFlux', 'cpsFluxErr', 'cfilterName',
'diaSource.ra', 'diaSource.decl',
'diaObject.hostgal_zphot', 'diaObject.hostgal_zphot_err',
'diaObject.hostgal_ra', 'diaObject.hostgal_dec'
]
df = df.withColumn('rf_slsn_vs_nonslsn', slsn_elasticc(*args_forced))

# Drop temp columns
Expand Down

0 comments on commit 3008f81

Please sign in to comment.