Source
ok = abs(val1['quantity']['*3']['value']-val2['quantity']['*1']['value'])<1e-6 and val1['quantity']['*3']['unit']==val2['quantity']['*1']['unit']
##############################################################################
# #
# Test Name: #
# coordsystest_regression.py #
# Rationale for Inclusion: #
# This is a Python translation of the Glish assay test coordsystest.g #
# It tests many coordsys tool methods #
# Features Tested: #
# coordsys, type, done, id, ncoordinates #
# coordinatetype, axiscoordinatetypes, summary #
# is_coordsys, coordsystools #
# referencecode, setreferencecode #
# restfrequency, setrestfrequency #
# projection, setprojection #
# torecord, fromrecord, copy #
# setepoch, epoch, setobserver, observer #
# settelescope, telescope, setparentname, parentname #
# setnames, names, setunits, units #
# setreferencepixel, referencepixel #
# setreferencevalue, referencevalue #
# setincrement, increment #
# setlineartransform, lineartransform #
# setstokes, stokes #
# findcoordinate, findaxis #
# toworld, toworldmany, topixel, topixelmany #
# naxes, axesmap #
# reorder #
# frequencytovelocity, velocitytofrequency #
# setreferencelocation #
# toabs, torel, toabsmany, torelmany #
# convert, convertmany #
# setspectral #
# settabular #
# addcoordinate #
# toworld, topixel with reference conversion #
# setdirection #
# replace #
# Success/failure criteria: #
# Internally tests each method for pass/fail. Throws an uncaught #
# exception ending test when an unexpected failure occurs. #
# All tests pass if script runs to completion. #
# #
##############################################################################
# #
# Converted by RRusk 2007-11-08 from coordsystest.py #
# #
##############################################################################
import time
import re
#
# coordsystest.py: test casapy coordsys tool
#
#
# Utils
#
def note(message, priority="INFO", origin="coordsystest", ntime=None, postcli='F'):
#if not ntime: #if (ntime==None):
# ntime=time.asctime()
#print ntime, priority, origin, message
if postcli: print message
casalog.postLocally(message, priority, origin)