Commits
56 56 | shutil.copytree(os.path.join(datapath,self.vis_file), self.vis_copy) |
57 57 | |
58 58 | def tearDown(self): |
59 59 | if os.path.exists(self.vis_copy): |
60 60 | shutil.rmtree(self.vis_copy) |
61 61 | if os.path.exists(self.res_table): |
62 62 | shutil.rmtree(self.res_table) |
63 63 | |
64 64 | def test_smsettrop(self): |
65 65 | """ """ |
66 + | # testing closing existing |
67 + | self.assertTrue(len(_tb.showcache()) == 0) |
68 + | _tb.close() |
69 + | _sm.done() |
70 + | |
66 71 | _sm.openfromms(self.vis_copy) |
67 72 | # This call exercises the new parameter CAS-13194 |
68 73 | _sm.settrop(mode='screen', table=self.res_table,pwv=3.0,deltapwv=0.15, |
69 74 | beta=1.1,windspeed=7.0,simint=0.1) |
70 75 | # Should be no steps in phase vs time table |
71 76 | # Corrected data which contains corrupted vis |
72 77 | _sm.corrupt() |
73 78 | _sm.done() |
74 79 | |
75 80 | _tb.open(self.res_table) |
90 95 | par1 = cpar[0,0,index1] |
91 96 | par2 = cpar[0,0,index2] |
92 97 | |
93 98 | # get phase angles |
94 99 | phaseang1 = numpy.angle(par1, deg=True) |
95 100 | phaseang2 = numpy.angle(par2, deg=True) |
96 101 | |
97 102 | phaseDiff = phaseang2 - phaseang1 |
98 103 | |
99 104 | # Test that there is no more large positive jump in phase angle |
100 - | self.assertTrue(numpy.isclose(phaseDiff, -15.6033857), msg=(phaseDiff,par1,par2)) |
105 + | self.assertTrue(numpy.isclose(phaseDiff, -15.6033857), msg=(phaseDiff,cpar[0,0,477:584])) |
101 106 | # check that a corrected data col exists |
102 107 | self.assertTrue(corDataExists) |
103 108 | # if simint is lower than 0.1 get warning and value changed to 0.1 |
104 109 | |
105 110 | class sm_predict_test(unittest.TestCase): |
106 111 | """ |
107 112 | """ |
108 113 | comp_list = 'mycomplist.cl' |
109 114 | orig_ms = 'myms.ms' |
110 115 | ref_flux = 5 |