snr¶
-
simcado.simulation.
snr
(exptimes, mags, filter_name='Ks', cmds=None, **kwargs)[source]¶ Returns the signal-to-noise ratio(s) for given exposure times and magnitudes
Each time this runs, simcado runs a full simulation on a grid of stars. Therefore if you are interested in the SNR for many difference expoure times and a range of magnitudes, it is faster to pass all of them at once to this function. See the example section below.
- Parameters
- exptimesfloat, list
[s] A single or multiple exposure times
- magsfloat, list
[mag] A single or multiple magnitudes
- filter_namestr, optional
The name of the filter to be used - See
get_filter_set()
The default is “Ks”- cmdsUserCommands object, optional
Extra commands to be passed to
simcado.simulation.run()
.
- Returns
- snr_returnlist
A list of SNR values for each exposure time and each magnitude
Examples
A basic example of wanting the SNR for a Ks=24 star in a 1 hr observation
>>> snr(exptimes=3600, mags=24) [72.69760133863036]
However this is slow because it runs a full simulation. Hence it is better to do more at once If we want the SNR for the range of magnitudes J=[15, 20, 25, 30] for a 1 hr observation:
>>> snr(exptimes=3600, mags=[15,20,25,30], filter_name="J") [array([ 2.35125027e+04, 2.74921916e+03, 8.97552604e+01, 8.18183097e-01])]
Now if we were interested in different exposure times, say 10 minutes and 5 hours, for a 24th magnitude star in the narrow band Br$gamma$ filter:
>>> # Chekc the name of the Brackett Gamma filter >>> [name for name in simcado.optics.get_filter_set() if "Br" in name] ['BrGamma'] >>> snr(exptimes=[600, 18000], mags=24, filter_name="BrGamma") [8.016218764390803, 42.71569256185457]