Source
xxxxxxxxxx
##########################################################################
# test_task_ft.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.calibration.ft.html
#
# Test_logreturn checks to make sure a logfile is generated and populated
# Test_dictreturn checks that the result is a python dict object containing keys specified in the documentation
# Test_takescal checks that a caltable is accepted and non-cal tables are rejected
# Test_axis checks that different axis vaules will provide different information
# Test_axisvals checks that the values for axis provided in the documentatin are accepted as valid values
# Test_datacolumn checks that different datacolumn values provide different information
#
##########################################################################
import sys
import os
import unittest
import shutil
import numpy as np
import casatools
from casatasks import ft
from casatools import table, ctsys, componentlist
tb = table()
cl = componentlist()
# Gaincaltest and gaussian model with noise
# Need model w/o standard gridder
# Need new model for model/complist preference?
datapath = casatools.ctsys.resolve('unittest/ft/uid___X02_X3d737_X1_01_small.ms')
modelpath = casatools.ctsys.resolve('unittest/ft/uid___X02_X3d737_X1_01_small.model')
simdata = casatools.ctsys.resolve('unittest/ft/ft_test_simulated.ms')
simcomplist = casatools.ctsys.resolve('unittest/ft/ft_test_simulated_complist.cl')
simmodel = casatools.ctsys.resolve('unittest/ft/ft_test_simulated_image.im')
multiterm0 = casatools.ctsys.resolve('unittest/ft/ft_test_multiterm.model.tt0')
multiterm1 = casatools.ctsys.resolve('unittest/ft/ft_test_multiterm.model.tt1')
datacopy = 'ft_test_copy.ms'
modelcopy = 'ft_test_model_copy.model'
nonStandardGridCopy = 'ft_test_nonstandard_gridder.model'
simdatacopy = 'ft_test_simdata.ms'
simcomplistcopy = 'ft_test_simcomplist.cl'
ftcomponentlist = 'ft_test_comp_list.cl'
def getColList(table):
tb.open(table)