from __future__ import absolute_import
from casatasks.private.casa_transition import is_CASA6
from casatools import imager, ms, image, quanta
from casatasks import casalog
_im,_ms,_ia=gentools(['im','ms','ia'])
def ft(vis=None,field=None,spw=None,model=None,nterms=None,reffreq=None,complist=None,incremental=None, usescratch=None):
""" Insert a source model into the MODEL_DATA column of a visibility set:
A source model (souce.model image) or components list is converted into a
model visibility that is inserted into the MODEL_DATA column. This is
needed to use resolved source in gaincal and in fluxscale. (Setjy will
automatically make this ft step.)
The sources currently available are 3C48, 3C138, 3C147, 3C286
at 1.4, 5.0, 8.4, 15, 22, 43 GHz. Their location is site
dependent. In Charlottesville and at the AOC, the models are
in /usr/lib/casapy/data/nrao/VLA/CalModels.
vis -- Name of input visibility file
default: none; example: vis='ngc5921.ms'
NOTE: each source must be specified in a multi-source vis.
field = '1328+307' specifies source '1328+307'
field = '4' specified field with index 4
default: spw = '' (all spw)
model -- Name of input model image
example: model='/usr/lib/casapy/data/nrao/VLA/CalModels/3C286_X.im'
Note: The model visibilities are scaled from the model frequency
to the observed frequency of the data.
nterms -- Number of terms used to model the sky frequency dependence
example : nterms=3 represents a 2nd order Taylor-polynomial in frequency
and is to be used along with 3 model-image names.
model=['xxx.image.tt0','xxx.image.tt1', 'xxx.image.tt2']
reffreq -- Reference-frequency about which this Taylor-expansion is defined.
complist -- Name of component list
default: None; ; example: complist='test.cl'
components tool not yet available
incremental -- Add model visibility to the existing MODEL_DATA visibilties
default: False; example: incremental=True