snsim.post_sim_tools

This module contains some tools for post-sim analysis.

Functions

SNR_pdet(SNR, SNR_mean, SNRp, p)

Approximation of the SNR detection probability.

SNR_select(selec_function, lcs[, SNR_mean, SNR_limit, ...])

Run a SNR efficiency detection on all lcs.

Module Contents

snsim.post_sim_tools.SNR_pdet(SNR, SNR_mean, SNRp, p)[source]

Approximation of the SNR detection probability.

Parameters:
  • SNR (float or np.array(float)) – The Signal to Noise Ratio.

  • SNR_mean (float) – The SNR for which p = 0.5.

  • SNRp (float) – The SNR for which we have a probability p of detection.

  • p (float) – The probability of detection at SNRp.

Returns:

Probability of detection.

Return type:

float or np.array(float)

Notes

The detection probability function :

\[P_{det}(SNR) = \frac{1}{1+\left(\frac{SNR_{mean}}{SNR}\right)^n}\]

where \(n = \frac{\ln\left(\frac{1-p}{p}\right)}{\ln(SNR_{mean}) - \ln(SNR_p)}\)

snsim.post_sim_tools.SNR_select(selec_function, lcs, SNR_mean=5, SNR_limit=[15, 0.99], randseed=np.random.randint(1000, 100000))[source]

Run a SNR efficiency detection on all lcs.

Parameters:
  • selec_function (str) – Can be ‘approx’ function TODO : add interpolation for function from file.

  • lcs (pandas.DataFrame) – SN lcs data.

  • SNR_mean (float or dic) – The SNR for which the detection probability is 1/2 -> SNR_mean.

  • SNR_limit (list of dic(list)) – A SNR and its probability of detection -> $SNR_p$ and p.

  • randseed (int) – Randseed for random detection.

Returns:

The SNR selected epochs.

Return type:

pandas.DataFrame

Notes

The detection probability function :

\[P_\text{det}(SNR) = \frac{1}{1+\left(\frac{SNR_\text{mean}}{SNR}\right)^n}\]

where \(n = \frac{\ln\left(\frac{1-p}{p}\right)}{\ln(SNR_\text{mean}) - \ln(SNR_p)}\)