prange = [[0, 1], [0], [1]]
polval = ['', 'RR', 'LL']
for i in range(len(blfunc)):
for j in range(len(testmode)):
print('testing blfunc=' + blfunc[i] + ', testmode=' + testmode[j] + '...')
if os.path.exists(infile):
shutil.copytree(os.path.join(self.datapath, self.infile), infile)
tb.open(tablename=infile, nomodify=False)
r2msk = tb.getcell('FLAG', 2)
tb.putcell('FLAG', 2, r2msk)
with table_manager(infile, nomodify=False) as tb:
r2msk = tb.getcell('FLAG', 2)
r2msk[prange[j], :] = True
tb.putcell('FLAG', 2, r2msk)
outfile = self.outroot + self.tid + blfunc[i] + testmode[j] + '.ms'
bloutput = self.outroot + self.tid + blfunc[i] + testmode[j] + '.bltable'
result = sdbaseline(infile=infile, datacolumn=datacolumn,
blmode=blmode, blformat=blformat, bloutput=bloutput,
spw=spw, pol=pol, blfunc=blfunc[i], order=order, npiece=npiece,
dosubtract=dosubtract, outfile=outfile)
self.assertEqual(result, None,
msg="The task returned '" + str(result) + "' instead of None")
with table_manager(bloutput) as tb:
nrow_bltable = tb.nrows()
if os.path.exists(self.infile):
shutil.rmtree(self.infile)
shutil.copytree(os.path.join(self.datapath, self.infile), self.infile)
blparam = self.outroot + '.blparam'
self._createBlparamFile(blparam, self.blparam_order, self.blparam_dic, '')
tb.open(tablename=infile, nomodify=False)
r2msk = tb.getcell('FLAG', 2)
r2msk[prange[j], :] = True
tb.putcell('FLAG', 2, r2msk)
outfile = self.outroot + self.tid + blfunc + '.ms'
bloutput = self.outroot + self.tid + blfunc + '.bltable'
sdbaseline(infile=infile, datacolumn=datacolumn,
blmode=blmode, blformat=blformat, bloutput=bloutput,
spw=spw, pol=pol, blfunc=blfunc, blparam=blparam,
dosubtract=dosubtract, outfile=outfile)
tb.open(infile, nomodify=False)
rowidx = range(tb.nrows())
specs = tb.getcell("FLAG", idx)
specs[:, 0:edge[0]] = True
specs[:, -edge[1]:] = True
specs[:, :edge[0]] = True
specs[:, -edge[1]:] = True
tb.putcell('FLAG', idx, specs)
def run_test(self, refstat, **kwargs):
task_param = self.base_param.copy()
for key, val in kwargs.items():
outfile = task_param['outfile']