def test_numsubms(self): '''Partition: small numsubms value''' # There are 16 spws; we want only 6 sub-MSs. partition(vis=self.msfile, outputvis=self.mmsfile, separationaxis='spw', numsubms=6) time.sleep(10) self.assertTrue(os.path.exists(self.mmsfile), 'MMS was not created for this test') # Take the dictionary and compare with original MS thisdict = listpartition(vis=self.mmsfile, createdict=True) # Check the number of sub-MSs mmslist = [] klist = thisdict.keys() for kk in klist: mmslist.append(thisdict[kk]['MS']) nsubms = mmslist.__len__() self.assertEqual(nsubms, 6, 'There should be only 6 sub-MSs') # Check that spw list is the same in MS and MMS spwlist = ph.getMMSSpwIds(thisdict) # Reference list of scans in MS slist = ph.getScanList(self.msfile) setlist = set([]) for s in slist: ms_spw = ph.getSpwIds(self.msfile, s) for a in ms_spw: setlist.add(a) self.assertEqual(list(setlist), spwlist)
def test_numsubms(self): """Partition: small numsubms value""" # There are 16 spws; we want only 6 sub-MSs. partition( vis=self.msfile, outputvis=self.mmsfile, separationaxis="spw", numsubms=6, flagbackup=False, disableparallel=True, datacolumn="corrected", ) self.assertTrue(os.path.exists(self.mmsfile), "MMS was not created for this test") # Take the dictionary and compare with original MS thisdict = listpartition(vis=self.mmsfile, createdict=True) # Check the number of sub-MSs mmslist = [] klist = thisdict.keys() for kk in klist: mmslist.append(thisdict[kk]["MS"]) nsubms = mmslist.__len__() self.assertEqual(nsubms, 6, "There should be only 6 sub-MSs") # Check that spw list is the same in MS and MMS spwlist = ph.getMMSSpwIds(thisdict) # Reference list of scans in MS slist = ph.getScanList(self.msfile) setlist = set([]) for s in slist: ms_spw = ph.getSpwIds(self.msfile, s) for a in ms_spw: setlist.add(a) self.assertEqual(list(setlist), spwlist) # The separation axis should be written to the output MMS sepaxis = ph.axisType(self.mmsfile) self.assertEqual(sepaxis, "spw", "Partition did not write AxisType correctly in MMS")
def test_numsubms(self): '''Partition: small numsubms value''' # There are 16 spws; we want only 6 sub-MSs. partition(vis=self.msfile, outputvis=self.mmsfile, separationaxis='spw', numsubms=6, flagbackup=False, disableparallel=True, datacolumn='corrected') self.assertTrue(os.path.exists(self.mmsfile), 'MMS was not created for this test') # Take the dictionary and compare with original MS thisdict = listpartition(vis=self.mmsfile, createdict=True) # Check the number of sub-MSs mmslist = [] klist = thisdict.keys() for kk in klist: mmslist.append(thisdict[kk]['MS']) nsubms = mmslist.__len__() self.assertEqual(nsubms, 6, 'There should be only 6 sub-MSs') # Check that spw list is the same in MS and MMS spwlist = ph.getMMSSpwIds(thisdict) # Reference list of scans in MS slist = ph.getScanList(self.msfile) setlist = set([]) for s in slist: ms_spw = ph.getSpwIds(self.msfile, s) for a in ms_spw: setlist.add(a) self.assertEqual(list(setlist), spwlist) # The separation axis should be written to the output MMS sepaxis = ph.axisType(self.mmsfile) self.assertEqual(sepaxis, 'spw', 'Partition did not write AxisType correctly in MMS')