Changeset 1824 for trunk/test
- Timestamp:
- 08/02/10 19:40:09 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/test/test_scantable.py
r1725 r1824 1 1 import unittest 2 2 import datetime 3 from asap import scantable, selector, rcParams, mask_not 4 rcParams["verbose"] = False 3 from asap import scantable, selector, rcParams, mask_not, asaplog 4 asaplog.disable() 5 5 6 6 class ScantableTest(unittest.TestCase): 7 7 def setUp(self): 8 9 self.st = scantable("data/MOPS.rpf", average=True) 8 s = scantable("data/MOPS.rpf", average=True) 9 sel = selector() 10 # make sure this order is always correct - in can be random 11 sel.set_order(["SCANNO", "POLNO"]) 12 s.set_selection(sel) 13 self.st = s.copy() 10 14 restfreqs = [86.243] # 13CO-1/0, SiO the two IF 11 15 self.st.set_restfreqs(restfreqs,"GHz") … … 78 82 def test_get_column_names(self): 79 83 cnames = ['SCANNO', 'CYCLENO', 'BEAMNO', 'IFNO', 80 'POLNO', 'FREQ_ID', 'MOLECULE_ID', 'REFBEAMNO', 84 'POLNO', 'FREQ_ID', 'MOLECULE_ID', 'REFBEAMNO', 'FLAGROW', 81 85 'TIME', 'INTERVAL', 'SRCNAME', 'SRCTYPE', 82 86 'FIELDNAME', 'SPECTRA', 'FLAGTRA', 'TSYS', … … 101 105 def test_get_sourcename(self): 102 106 self.assertEqual(self.st.get_sourcename(0), 'Orion_SiO_R') 103 self.assertEqual(self.st.get_sourcename()[:2], ['Orion_SiO_R', 'Orion_SiO']) 107 self.assertEqual(self.st.get_sourcename(), 108 ['Orion_SiO_R', 'Orion_SiO_R', 109 'Orion_SiO', 'Orion_SiO']) 104 110 105 111 def test_get_azimuth(self): … … 144 150 msk = q0.create_mask([-10,20]) 145 151 q0.flag(mask=mask_not(msk)) 152 q1.flag(mask=msk) 146 153 self.assertAlmostEqual(q0.stats(stat='max')[0], 95.62171936) 147 q1.flag(mask=msk)148 154 self.assertAlmostEqual(q1.stats(stat='max')[0], 2.66563416) 149 155
Note:
See TracChangeset
for help on using the changeset viewer.