snsim.post_sim_tools ==================== .. py:module:: snsim.post_sim_tools .. autoapi-nested-parse:: This module contains some tools for post-sim analysis. Functions --------- .. autoapisummary:: snsim.post_sim_tools.SNR_pdet snsim.post_sim_tools.SNR_select Module Contents --------------- .. py:function:: SNR_pdet(SNR, SNR_mean, SNRp, p) Approximation of the SNR detection probability. :param SNR: The Signal to Noise Ratio. :type SNR: float or np.array(float) :param SNR_mean: The SNR for which p = 0.5. :type SNR_mean: float :param SNRp: The SNR for which we have a probability p of detection. :type SNRp: float :param p: The probability of detection at SNRp. :type p: float :returns: Probability of detection. :rtype: float or np.array(float) .. rubric:: Notes The detection probability function : .. math:: P_{det}(SNR) = \frac{1}{1+\left(\frac{SNR_{mean}}{SNR}\right)^n} where :math:`n = \frac{\ln\left(\frac{1-p}{p}\right)}{\ln(SNR_{mean}) - \ln(SNR_p)}` .. py:function:: SNR_select(selec_function, lcs, SNR_mean=5, SNR_limit=[15, 0.99], randseed=np.random.randint(1000, 100000)) Run a SNR efficiency detection on all lcs. :param selec_function: Can be 'approx' function TODO : add interpolation for function from file. :type selec_function: str :param lcs: SN lcs data. :type lcs: pandas.DataFrame :param SNR_mean: The SNR for which the detection probability is 1/2 -> SNR_mean. :type SNR_mean: float or dic :param SNR_limit: A SNR and its probability of detection -> $SNR_p$ and p. :type SNR_limit: list of dic(list) :param randseed: Randseed for random detection. :type randseed: int :returns: The SNR selected epochs. :rtype: pandas.DataFrame .. rubric:: Notes The detection probability function : .. math:: P_\text{det}(SNR) = \frac{1}{1+\left(\frac{SNR_\text{mean}}{SNR}\right)^n} where :math:`n = \frac{\ln\left(\frac{1-p}{p}\right)}{\ln(SNR_\text{mean}) - \ln(SNR_p)}`