Пример #1
0
 def test_efsearch(self):
     evfile = self.dum
     main_efsearch([evfile, '-f', '9.85', '-F', '9.95', '-n', '64',
                    '--fit-candidates'])
     outfile = 'events_EF' + HEN_FILE_EXTENSION
     assert os.path.exists(outfile)
     plot_folding([outfile], ylog=True)
     efperiod = load_folding(outfile)
     assert np.isclose(efperiod.peaks[0], self.pulse_frequency,
                       atol=1/25.25)
     os.unlink(outfile)
Пример #2
0
    def test_efsearch_deorbit_invalid(self):
        evfile = self.dum
        with pytest.warns(UserWarning) as record:
            ip = main_efsearch([
                evfile, '-f', '9.85', '-F', '9.95', '-n', '64',
                '--deorbit-par', "nonexistent.par"
            ])
        assert np.any(["Parameter file" in r.message.args[0] for r in record])

        outfile = 'events_EF' + HEN_FILE_EXTENSION
        assert os.path.exists(outfile)
        with pytest.warns(UserWarning) as record:
            plot_folding([outfile], ylog=True)
        assert np.any(["does not exist" in r.message.args[0] for r in record])