Skip to content

Commit

Permalink
remove the old fast transient rate computation by the new in the fast…
Browse files Browse the repository at this point in the history
… transient science module
  • Loading branch information
FusRoman committed Feb 1, 2024
1 parent c09ef35 commit 246576e
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 17 deletions.
2 changes: 1 addition & 1 deletion fink_mm/distribution/apply_filters.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ def apply_filters(
df_stream["rb"],
df_stream["gcn_loc_error"],
df_stream["p_assoc"],
df_stream["rate"],
df_stream["mag_rate"],
),
)
.filter("f_gold == True")
Expand Down
33 changes: 17 additions & 16 deletions fink_mm/utils/fun_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -757,21 +757,22 @@ def join_post_process(df_grb: DataFrame, hdfs_adress: str, root_path: str) -> Da
df_grb = concat_col(df_grb, "jd")
df_grb = concat_col(df_grb, "fid")

df_grb = df_grb.withColumn(
"c_rate",
compute_rate(
df_grb["candidate.magpsf"],
df_grb["candidate.jdstarthist"],
df_grb["candidate.jd"],
df_grb["candidate.fid"],
df_grb["cmagpsf"],
df_grb["cdiffmaglim"],
df_grb["cjd"],
df_grb["cfid"],
),
)

df_grb = format_rate_results(df_grb, "c_rate")
# DEPRECATED
# computed by the fast transient fink science module
# df_grb = df_grb.withColumn(
# "c_rate",
# compute_rate(
# df_grb["candidate.magpsf"],
# df_grb["candidate.jdstarthist"],
# df_grb["candidate.jd"],
# df_grb["candidate.fid"],
# df_grb["cmagpsf"],
# df_grb["cdiffmaglim"],
# df_grb["cjd"],
# df_grb["cfid"],
# ),
# )
# df_grb = format_rate_results(df_grb, "c_rate")

# TODO : do something better with satellites
# df_grb = add_tracklet_information(df_grb)
Expand Down Expand Up @@ -805,7 +806,7 @@ def join_post_process(df_grb: DataFrame, hdfs_adress: str, root_path: str) -> Da
df_grb["raw_event"],
df_grb["ztf_ra"],
df_grb["ztf_dec"],
df_grb["start_vartime"],
df_grb["jd_first_real_det"],
F.lit(hdfs_adress),
df_grb["gcn_status"],
F.lit(root_path),
Expand Down

0 comments on commit 246576e

Please sign in to comment.