SNSNRMetric

class rubin_sim.maf.metrics.SNSNRMetric(metric_name='SNSNRMetric', mjd_col='observationStartMJD', ra_col='fieldRA', dec_col='fieldDec', filter_col='filter', m5_col='fiveSigmaDepth', exptime_col='visitExposureTime', night_col='night', obsid_col='observationId', nexp_col='numExposures', vistime_col='visitTime', coadd=True, lim_sn=None, names_ref=None, season=1, z=0.01, **kwargs)

Bases: BaseMetric

Metric to estimate the detection rate for faint supernovae (x1,color) = (-2.0,0.2)

Parameters:
liststr, optional

Name of the columns used to estimate the metric Default : ‘observationStartMJD’, ‘fieldRA’, ‘fieldDec’,’filter’,’fiveSigmaDepth’, ‘visitExposureTime’,’night’,’observationId’, ‘numExposures’,’visitTime’

coaddbool, optional

to make “coaddition” per night (uses snStacker) Default : True

lim_snclass, optional

Reference data used to simulate LC points (interpolation)

names_refstr, optional

names of the simulator used to produce reference data

seasonflota, optional

season num Default : 1.

zfloat, optional

redshift for this study Default : 0.01

Methods Summary

check_seasons(tab)

Check wether seasons have no overlap if it is the case: modify MJD_min and season length of the corresponding season return only seasons with season_length > 30 days

detection_rate(snr_obs, snr_fakes)

Estimate the time fraction(per season) for which snr_obs > snr_fakes = detection rate For regular cadences one should get a result close to 1

gen_fakes(slice_sel, band)

Generate fake observations according to observing values extracted from simulations

get_season(t0)

Estimate the seasons corresponding to t0 values

plot(snr_obs, snr_fakes)

Plot SNR vs time

plot_history(fluxes, mjd, flag, snr, t0_lc, ...)

Plot history of Plot For each MJD, fluxes and snr are plotted Each plot may be saved as a png to make a video afterwards

process(sel)

Process one season

run(data_slice[, slice_point])

run the metric

season_info(data_slice, season)

Get info on seasons for each data_slice

snr(time_lc, m5_vals, flag, season_vals, t0_lc)

Estimate SNR vs time

snr_fakes(data_slice)

Estimate SNR for fake observations in the same way as for observations (using SNR_Season)

snr_slice(data_slice[, j, output_q])

Estimate SNR for a given data_slice

Methods Documentation

check_seasons(tab)

Check wether seasons have no overlap if it is the case: modify MJD_min and season length of the corresponding season return only seasons with season_length > 30 days

Parameters:
tabarray with the following fields:
Returns:
tabarray with the following fields:
detection_rate(snr_obs, snr_fakes)

Estimate the time fraction(per season) for which snr_obs > snr_fakes = detection rate For regular cadences one should get a result close to 1

Parameters:
snr_obsarray

array estimated using snr_slice(observations)

snr_fakes: array

array estimated using snr_slice(fakes)

Returns:
record array with the following fields:

fieldRA (float) fieldDec (float) season (float) band (str) frac_obs_name_ref (float)

gen_fakes(slice_sel, band)

Generate fake observations according to observing values extracted from simulations

Parameters:
slice_selarray

array of observations

bandstr

band to consider

Returns:
fake_obs_seasonarray

array of observations with the following fields observationStartMJD (float) field_ra (float) field_dec (float) filter (U1) fiveSigmaDepth (float) numExposures (float) visitExposureTime (float) season (int)

get_season(t0)

Estimate the seasons corresponding to t0 values

Parameters:
t0list(float)

set of t0 values

Returns:
list (float) of corresponding seasons
plot(snr_obs, snr_fakes)

Plot SNR vs time

Parameters:
snr_obsarray

array estimated using snr_slice(observations)

snr_obsarray

array estimated using snr_slice(fakes)

plot_history(fluxes, mjd, flag, snr, t0_lc, dates)

Plot history of Plot For each MJD, fluxes and snr are plotted Each plot may be saved as a png to make a video afterwards

Parameters:
fluxeslist(float)

LC fluxes

mjdlist(float)

mjds of the fluxes

flagarray

flag for selection of fluxes

snrlist

signal-to-noise ratio

t0_lclist(float)

list of T0 supernovae

dateslist(float)

date of the display (mjd)

process(sel)

Process one season

Parameters:
selarray

array of observations

seasonint

season number

Returns:
record array with the following fields:

fieldRA (float) fieldDec (float) season (float)

band (str) frac_obs_name_ref (float)

run(data_slice, slice_point=None)

run the metric

Parameters:
data_slicearray

simulation data under study

Returns:
detection ratefloat
season_info(data_slice, season)

Get info on seasons for each data_slice

Parameters:
data_slicearray

array of observations

Returns:
recordarray with the following fields:
season, cadence, season_length, MJDmin, MJDmax
snr(time_lc, m5_vals, flag, season_vals, t0_lc)

Estimate SNR vs time

Parameters:
time_lc
m5_valslist(float)

five-sigme depth values

flagarray(bool)

flag to be applied (example: selection from phase cut)

season_valsarray(float)

season values

t0_lcarray(float)

array of T0 for supernovae

Returns:
fluxes_totlist(float)

list of (interpolated) fluxes

snr_tabarray with the following fields:

snr_name_ref (float) : Signal-to-Noise values season (float) : season num.

snr_fakes(data_slice)

Estimate SNR for fake observations in the same way as for observations (using SNR_Season)

Parameters:
data_slicearray

array of observations

Returns:
snr_tabarray with the following fields:

snr_name_ref (float) : Signal-to-Noise values season (float) : season num.

snr_slice(data_slice, j=-1, output_q=None)

Estimate SNR for a given data_slice

Parameters:
data_slicenp.recarray
jint, optional
output_qint, optional
Returns:
array with the following fields (all are of f8 type, except band which is of U1)
SNR_name_ref: Signal-To-Noise Ratio estimator
seasonseason
cadence: cadence of the season
season_length: length of the season
MJD_min: min MJD of the season
DayMax: SN max luminosity MJD (aka T0)
MJD:
m5_eff: mean m5 of obs passing the min_phase, max_phase cut
field_ra: mean field RA
field_dec: mean field Dec
band: band
m5: mean m5 (over the season)
nvisits: median number of visits (per observation) (over the season)
ExposureTime: median exposure time (per observation) (over the season)