def test_scan(self):
        '''Test that data are read.'''

        scan = Scan(self.fname)
        scan.write('scan.hdf5', overwrite=True)
        scan2 = Scan('scan.hdf5')
        assert scan.meta == scan2.meta
    def test_scan(self):
        '''Test that data are read.'''

        scan = Scan(self.fname, debug=True)

        scan.write('scan.hdf5', overwrite=True)
        scan.baseline_subtract('rough', plot=True)
    def test_scan_baseline_unknown(self):
        '''Test that data are read.'''

        scan = Scan(self.fname, debug=True)
        scan.write('scan.hdf5', overwrite=True)
        with pytest.raises(ValueError):
            scan.baseline_subtract('asdfgh', plot=True)
 def test_scan_from_table(self):
     '''Test that data are read.'''
     from astropy.table import Table
     scan = Scan(self.fname)
     scan.write('scan.hdf5', overwrite=True)
     table = Table.read('scan.hdf5', path='scan')
     scan_from_table = Scan(table)
     for c in scan.columns:
         assert np.all(scan_from_table[c] == scan[c])
     for m in scan_from_table.meta.keys():
         assert scan_from_table.meta[m] == scan.meta[m]
    def test_scan_write_other_than_hdf5_raises(self):
        '''Test that data are read.'''

        scan = Scan(self.fname, debug=True)
        with pytest.raises(TypeError):
            scan.write('scan.fits', overwrite=True)
        with pytest.raises(TypeError):
            scan.write('scan.json', overwrite=True)
        with pytest.raises(TypeError):
            scan.write('scan.csv', overwrite=True)