Exemplo n.º 1
0
 def test_classical_significances_trial_correction(self):
     with pytest.warns(UserWarning) as record:
         cs = Crossspectrum(self.lc1, self.lc2, norm='leahy')
     # change the powers so that just one exceeds the threshold
     cs.power = np.zeros_like(cs.power) + 2.0
     index = 1
     cs.power[index] = 10.0
     threshold = 0.01
     pval = cs.classical_significances(threshold=threshold,
                                       trial_correction=True)
     assert np.size(pval) == 0
Exemplo n.º 2
0
    def test_pvals_is_numpy_array(self):
        cs = Crossspectrum(self.lc1, self.lc2, norm='leahy')
        # change the powers so that just one exceeds the threshold
        cs.power = np.zeros_like(cs.power) + 2.0

        index = 1
        cs.power[index] = 10.0

        threshold = 1.0

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

        assert isinstance(pval, np.ndarray)
        assert pval.shape[0] == 2
Exemplo n.º 3
0
 def test_classical_significances_fails_in_rms(self):
     with pytest.warns(UserWarning) as record:
         cs = Crossspectrum(self.lc1, self.lc2, norm='frac')
     with pytest.raises(ValueError):
         cs.classical_significances()
Exemplo n.º 4
0
 def test_classical_significances_runs(self):
     with pytest.warns(UserWarning) as record:
         cs = Crossspectrum(self.lc1, self.lc2, norm='leahy')
     cs.classical_significances()