Exemple #1
0
    def test_barycenter_times(self):
        '''Test image production.'''

        scanset = ScanSet('test.hdf5')

        scanset.barycenter_times()

        assert 'barytime' in scanset.colnames
        assert np.all(
            np.abs(scanset['barytime'] - scanset['time']) < 9 * 60 / 86400)
Exemple #2
0
    def test_apply_user_filt(self):
        '''Test apply user filts.'''
        def user_fun(scanset):
            return scanset['barytime'] - np.floor(scanset['barytime'])

        scanset = ScanSet('test.hdf5')
        scanset.barycenter_times()
        phase_in_sec = scanset.apply_user_filter(user_fun, 'Phase_in_sec')

        assert np.min(phase_in_sec) >= 0
        assert np.max(phase_in_sec) <= 1
        assert np.all(phase_in_sec == scanset['Phase_in_sec'])