Source
xxxxxxxxxx
'''test3: Does the setting of a given direction with ref !=J2000 and != sol.sys. object give the expected error?'''
##########################################################################
# test_req_task_fixplanets.py
#
# Copyright (C) 2018
# Associated Universities, Inc. Washington DC, USA.
#
# This script is free software; you can redistribute it and/or modify it
# under the terms of the GNU Library General Public License as published by
# the Free Software Foundation; either version 2 of the License, or (at your
# option) any later version.
#
# This library is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
# License for more details.
#
# [Add the link to the JIRA ticket here once it exists]
#
# Based on the requirements listed in plone found here:
# https://casadocs.readthedocs.io/en/stable/api/tt/casatasks.manipulation.fixplanets.html
#
#
##########################################################################
from casatools import ctsys
from casatools import table as tb
from casatools import ms as mstool
from casatools import msmetadata as msmdtool
from casatasks import fixplanets
import os
import unittest
import shutil
import numpy as np
### DATA ###
datapath = ctsys.resolve('unittest/fixplanets/')
# Input data
msfile = 'gaincaltest2.ms'
reffile = 'nep2-shrunk.ms'
ephem = 'Titan_55197-59214dUTC_J2000.tab'
fakefile = 'fake.txt'
dataSOURCE = datapath + msfile + '/SOURCE'
dataFIELD = datapath + msfile + '/FIELD'
copypath = 'copypath.ms'
copySOURCE1 = 'copypath.ms/SOURCE'
copyFIELD1 = 'copypath.ms/FIELD'
copypath2 = 'copypath2.ms'
copySOURCE2 = 'copypath2.ms/SOURCE'
copyFIELD2 = 'copypath2.ms/FIELD'
refcopy1 = 'refcopy1.ms'
refcopy2 = 'refcopy2.ms'
# data from test_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)
mymst = mstool()
mymsmdt = msmdtool()
def compRows(vis1, vis2, subtable):
tb.open(vis1)
res1 = tb.getcol(subtable)
tb.close()
tb.open(vis2)
res2 = tb.getcol(subtable)
tb.close()
return np.all(res1 == res2)
class fixplanets_test(unittest.TestCase):
def setUp(self):
if not os.path.exists(copypath):
shutil.copytree(os.path.join(datapath, msfile), copypath)