casa  $Rev:20696$
 All Classes Namespaces Files Functions Variables
ft.py
Go to the documentation of this file.
00001 #
00002 # This file was generated using xslt from its XML file
00003 #
00004 # Copyright 2009, Associated Universities Inc., Washington DC
00005 #
00006 import sys
00007 import os
00008 from  casac import *
00009 import string
00010 from taskinit import casalog
00011 #from taskmanager import tm
00012 import task_ft
00013 def ft(vis='', field='', spw='', model='', nterms=1, reffreq='', complist='', incremental=False, usescratch=False):
00014 
00015         """Insert a source model  a visibility set:
00016 
00017        A source model (souce.model image) or components list is converted into a
00018        model visibility that is inserted into the MODEL_DATA column.  This is
00019        needed to use resolved source in gaincal and in fluxscale.  
00020 
00021        Setjy will automatically make this ft step on the
00022        sources currently available are 3C48, 3C138, 3C147, 3C286
00023        at 1.4, 5.0, 8.4, 15, 22, 43 GHz.  Their location is site
00024        dependent.  In Charlottesville and at the AOC, the models are
00025        in /usr/lib(lib64)/casapy/data/nrao/VLA/CalModels.
00026                
00027 
00028        Keyword arguments:
00029        vis -- Name of input visibility file
00030               default: none; example: vis='ngc5921.ms'
00031        field -- Field name list
00032                default: '' ==> all
00033                NOTE: BUT, only one source can be specified in a multi-source vis.
00034                field = '1328+307'  specifies source '1328+307'
00035                field = '4' specified field with index 4
00036        spw -- Spw selection
00037                default: spw = '' (all spw)
00038        model -- Name of input model image
00039                default: '' ==> None;
00040                example: model='/usr/lib/casapy/data/nrao/VLA/CalModels/3C286_X.im'
00041                Note: The model visibilities are scaled from the model frequency
00042                      to the observed frequency of the data.
00043        nterms -- Number of terms used to model the sky frequency dependence
00044                  default: 1  ==> one model image is required
00045                  example : nterms=3  represents a 2nd order Taylor-polynomial in frequency
00046                            and should be used in conjuction with coefficient model images as 
00047                            model=['xxx.model.tt0','xxx.model.tt1', 'xxx.model.tt2']
00048              reffreq -- Reference-frequency about which this Taylor-expansion is defined.
00049                         default: '' ==> reads the reference frequency from the model image
00050                         example : reffreq = '1.5GHz'
00051        complist -- Name of component list
00052                default: None; ; example: complist='test.cl'
00053                component lists are difficult to make.
00054        incremental -- Add model visibility to the existing model visibilties stored in the MS
00055                default: False; example: incremental=True
00056        usescratch  -- if True model visibilities will be stored in the scratch column 
00057                             MODEL_DATA; when false the model visibilities will be generated 
00058                             on the fly (this mode may save some disk space equivalent to 
00059                             the volume of the observed data). 
00060                             default: False; example usescratch=True
00061 
00062 
00063      
00064 
00065 
00066 
00067  
00068         """
00069 
00070 #
00071 #    The following is work around to avoid a bug with current python translation
00072 #
00073         mytmp = {}
00074 
00075         mytmp['vis'] = vis
00076         mytmp['field'] = field
00077         mytmp['spw'] = spw
00078         mytmp['model'] = model
00079         mytmp['nterms'] = nterms
00080         mytmp['reffreq'] = reffreq
00081         mytmp['complist'] = complist
00082         mytmp['incremental'] = incremental
00083         mytmp['usescratch'] = usescratch
00084         pathname='file:///'+os.environ.get('CASAPATH').split()[0]+'/share/xml/'
00085         trec = casac.utils().torecord(pathname+'ft.xml')
00086 
00087         casalog.origin('ft')
00088         if trec.has_key('ft') and casac.utils().verify(mytmp, trec['ft']) :
00089             result = task_ft.ft(vis, field, spw, model, nterms, reffreq, complist, incremental, usescratch)
00090 
00091         else :
00092           result = False
00093         return result