Пример #1
0
 def test_classical_significances_trial_correction(self):
     ps = Powerspectrum(lc=self.lc, norm="leahy")
     # change the powers so that just one exceeds the threshold
     ps.power = np.zeros_like(ps.power) + 2.0
     index = 1
     ps.power[index] = 10.0
     threshold = 0.01
     pval = ps.classical_significances(threshold=threshold,
                                       trial_correction=True)
     assert np.size(pval) == 0
Пример #2
0
 def test_classical_significances_trial_correction(self):
     ps = Powerspectrum(lc=self.lc, norm="leahy")
     # change the powers so that just one exceeds the threshold
     ps.power = np.zeros_like(ps.power) + 2.0
     index = 1
     ps.power[index] = 10.0
     threshold = 0.01
     pval = ps.classical_significances(threshold=threshold,
                                       trial_correction=True)
     assert np.size(pval) == 0
Пример #3
0
    def test_pvals_is_numpy_array(self):
        ps = Powerspectrum(lc=self.lc, norm="leahy")
        # change the powers so that just one exceeds the threshold
        ps.power = np.zeros_like(ps.power) + 2.0

        index = 1
        ps.power[index] = 10.0

        threshold = 1.0

        pval = ps.classical_significances(threshold=threshold,
                                          trial_correction=True)

        assert isinstance(pval, np.ndarray)
        assert pval.shape[0] == 2
Пример #4
0
    def test_classical_significances_threshold(self):
        ps = Powerspectrum(lc = self.lc, norm="leahy")

        ## change the powers so that just one exceeds the threshold
        ps.ps = np.zeros(ps.ps.shape[0])+2.0

        index = 1
        ps.ps[index] = 10.0

        threshold = 0.01

        pval = ps.classical_significances(threshold=threshold,
                                          trial_correction=False)
        assert pval[0,0] < threshold
        assert pval[1,0] == index
Пример #5
0
    def test_pvals_is_numpy_array(self):
        ps = Powerspectrum(lc=self.lc, norm="leahy")
        # change the powers so that just one exceeds the threshold
        ps.power = np.zeros_like(ps.power) + 2.0

        index = 1
        ps.power[index] = 10.0

        threshold = 1.0

        pval = ps.classical_significances(threshold=threshold,
                                          trial_correction=True)

        assert isinstance(pval, np.ndarray)
        assert pval.shape[0] == 2
    def test_classical_significances_threshold(self):
        ps = Powerspectrum(lc=self.lc, norm="leahy")

        # change the powers so that just one exceeds the threshold
        ps.ps = np.zeros(ps.ps.shape[0])+2.0

        index = 1
        ps.ps[index] = 10.0

        threshold = 0.01

        pval = ps.classical_significances(threshold=threshold,
                                          trial_correction=False)
        assert pval[0, 0] < threshold
        assert pval[1, 0] == index
Пример #7
0
 def test_classical_significances_fails_in_rms(self):
     ps = Powerspectrum(lc=self.lc, norm="frac")
     with pytest.raises(ValueError):
         ps.classical_significances()
Пример #8
0
 def test_classical_significances_runs(self):
     ps = Powerspectrum(lc=self.lc, norm="Leahy")
     ps.classical_significances()
Пример #9
0
 def test_classical_significances_fails_in_rms(self):
     ps = Powerspectrum(lc = self.lc, norm="rms")
     ps.classical_significances()
Пример #10
0
 def test_classical_significances_fails_in_rms(self):
     ps = Powerspectrum(lc=self.lc, norm="frac")
     with pytest.raises(ValueError):
         ps.classical_significances()
Пример #11
0
 def test_classical_significances_runs(self):
     ps = Powerspectrum(lc=self.lc, norm="Leahy")
     ps.classical_significances()
 def test_classical_significances_fails_in_rms(self):
     ps = Powerspectrum(lc=self.lc, norm="rms")
     ps.classical_significances()