discrepantrows = checkwithtaql("select from [select from "+cal1+" where SPECTRAL_WINDOW_ID=="+str(testspw)+" orderby TIME, FIELD_ID, ANTENNA1, ANTENNA2 ] t1, [select from "+cal2+" where SPECTRAL_WINDOW_ID=="+str(testspw)+" orderby TIME, FIELD_ID, ANTENNA1, ANTENNA2 ] t2 where (not all(near(t1."+colname1+",t2."+colname2+", "+str(tolerance)+")))")
from casatools import table
from casatools import ms, image
from taskinit import tbtool
from taskinit import mstool, iatool
A set of common helper functions for unit tests:
compTables - compare two CASA tables
compVarColTables - Compare a variable column of two tables
DictDiffer - a class with methods to take a difference of two
verify_ms - Function to verify spw and channels information in an MS
create_input - Save the string in a text file with the given name
def phasediffabsdeg(c1, c2):
print("Phase difference of real numbers is always zero.")
a = math.atan2(c1.imag, c1.real)
b = math.atan2(c2.imag, c2.real)
def compTables(referencetab, testtab, excludecols, tolerance=0.001, mode="percentage", startrow = 0, nrow = -1, rowincr = 1):
compTables - compare two CASA tables
referencetab - the table which is assumed to be correct