Skip to content

Commit

Permalink
Merge pull request #419 from lsst/tickets/OPSIM-1172
Browse files Browse the repository at this point in the history
swap in usual m52snr
  • Loading branch information
yoachim authored Aug 21, 2024
2 parents eaed822 + 76cf59b commit 071a912
Showing 1 changed file with 4 additions and 10 deletions.
14 changes: 4 additions & 10 deletions rubin_sim/maf/utils/sn_n_sn_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
from astropy.table import Table
from rubin_scheduler.data import get_data_dir
from scipy.interpolate import RegularGridInterpolator
from rubin_sim.maf.utils import m52snr

warnings.filterwarnings("ignore", category=RuntimeWarning)

Expand Down Expand Up @@ -267,16 +268,9 @@ def process_band(self, sel_obs, ebvof_mw, band, gen_par):
lc.loc[:, "color"] = self.color

# estimate errors
lc["flux_e_sec"] = self.reference_lc.mag_to_flux[band](
(lc["mag"], lc[self.exptime_col] / lc[self.nexp_col], lc[self.nexp_col])
)
lc["flux_5"] = 10 ** (-0.4 * (lc[self.m5_col] - self.reference_lc.zp[band]))
lc["snr_m5"] = lc["flux_e_sec"] / np.sqrt(
(lc["flux_5"] / 5.0) ** 2 + lc["flux_e_sec"] / lc[self.exptime_col]
)
lc["snr_m5"] = m52snr(lc["mag"], lc["fiveSigmaDepth"])
lc["fluxerr_photo"] = lc["flux"] / lc["snr_m5"]
lc["magerr"] = (2.5 / np.log(10.0)) / lc["snr_m5"]
lc["fluxerr"] = lc["fluxerr_photo"]

# Fisher matrix components
for key, vals in fisher__mat.items():
Expand All @@ -291,8 +285,8 @@ def process_band(self, sel_obs, ebvof_mw, band, gen_par):
# if len(lc) > 0.:
# lc = self.dust_corrections(lc, ebvof_mw)

# remove lc points with no flux
idx = lc["flux_e_sec"] > 0.0
# remove lc points with no detectable flux
idx = lc["mag"] < lc["fiveSigmaDepth"] + 0.5
lc_flux = lc[idx]

return lc_flux
Expand Down

0 comments on commit 071a912

Please sign in to comment.