from __future__ import absolute_import
from __future__ import print_function
from casatasks.private.casa_transition import is_CASA6
from casatools import ctsys
from casatools import ms as mstool
from casatools import msmetadata as msmdtool
from casatasks import fixplanets
ctsys_resolve = ctsys.resolve
from __main__ import default
def ctsys_resolve(apath):
dataPath = os.path.join(os.environ['CASAPATH'].split()[0],'casatestdata/')
return os.path.join(dataPath,apath)
Unit tests for task fixplanets.
1. Does a standard fixplanets work on an MS imported from an ASDM from April 2011
2. Does the setting of a given direction work on an MS imported from an ASDM from April 2011
3. Does the setting of a given direction with ref !=J2000 and != sol.sys. object give the expected error?
4. Does the setting of a given direction work with a sol system ref frame
5. Does the use of an ephemeris via the direction parameter work
datapath = ctsys_resolve('unittest/fixplanets/')
outms = 'uid___A002_X1c6e54_X223-thinned.ms'
inpms = os.path.join(datapath, outms)
outms2 = 'uid___A002_X1c6e54_X223-thinned.mms/'
inpms2 = os.path.join(datapath,outms2)
class fixplanets_test1(unittest.TestCase):
shutil.rmtree(outms, ignore_errors=True)
shutil.copytree(inpms, outms)
shutil.rmtree(outms2, ignore_errors=True)
os.system('cp -R '+ inpms2 + ' ' + outms2)
shutil.rmtree(outms, ignore_errors=True)
shutil.rmtree(outms2, ignore_errors=True)
def verify(self, thems, thefield, theref):
thefieldids = mymsmdt.fieldsforname(thefield)