Coverage for /wheeldirectory/casa-6.7.0-12-py3.10.el8/lib/py/lib/python3.10/site-packages/casatasks/ft.py: 56%
27 statements
« prev ^ index » next coverage.py v7.6.4, created at 2024-10-31 17:39 +0000
« prev ^ index » next coverage.py v7.6.4, created at 2024-10-31 17:39 +0000
1##################### generated by xml-casa (v2) from ft.xml ########################
2##################### 9c1db93ee44949588c604c133f8691c6 ##############################
3from __future__ import absolute_import
4import numpy
5from casatools.typecheck import CasaValidator as _val_ctor
6_pc = _val_ctor( )
7from casatools.coercetype import coerce as _coerce
8from casatools.errors import create_error_string
9from .private.task_ft import ft as _ft_t
10from casatasks.private.task_logging import start_log as _start_log
11from casatasks.private.task_logging import end_log as _end_log
12from casatasks.private.task_logging import except_log as _except_log
14class _ft:
15 """
16 ft ---- Insert a source model as a visibility set
19 A source model (souce.model image) or components list is converted
20 into model visibilities that is inserted into the MODEL_DATA column or
21 alternatively is stored in the header of the MS to be served on the
22 fly when requested.
24 Setjy will automatically make this ft step on the sources currently
25 available, which are 3C48, 3C138, 3C147, 3C286 at 1.4, 5.0, 8.4, 15,
26 22, 43 GHz. Their location is site dependent. In Charlottesville and
27 Socorro, the models are in
28 /usr/lib(lib64)/casapy/data/nrao/VLA/CalModels.
30 --------- parameter descriptions ---------------------------------------------
32 vis Name of input visibility file
33 Default: none
35 Example: vis='ngc5921.ms'
36 field Select field using field id(s) or field name(s)
37 Default: '' (all fields)
39 BUT, only one source can be specified in a
40 multi-source vis.
43 Examples:
44 field = '1328+307' specifies source
45 '1328+307'
46 field = '4' specified field with index 4
47 spw Select spectral window/channels
48 Default: '' (all spectral windows and channels)
49 model Name of input model image(s)
50 Default: '' (none)
52 Example:
53 model='/usr/lib/casapy/data/nrao/VLA/CalModels/3C286_X.im'
55 NOTE: The model visibilities are scaled from the
56 model frequency to the observed frequency of the
57 data.
58 nterms Number of terms used to model the sky frequency
59 dependence
60 Default: 1 (one model image is required)
62 Example: nterms=3 - represents a 2nd order
63 Taylor-polynomial in frequency and should be
64 used in conjuction with coefficient model
65 images as
66 model=['xxx.model.tt0','xxx.model.tt1',
67 'xxx.model.tt2']
68 reffreq Reference-frequency about which this Taylor-expansion is
69 defined.
70 Default: '' (reads the reference frequency from
71 the model image)
73 Example: reffreq = '1.5GHz'
74 complist Name of component list
75 Default: none
77 Example: complist='test.cl'
79 WARNING: component lists are difficult to make
80 incremental Add model visibility to the existing model visibilties
81 stored in the MS
82 Default: False
83 Options: False|True
84 usescratch Story visibilities in MODEL_DATA column?
85 Default: False
86 Options: False|True
88 If True, model visibilities will be stored in the
89 scratch column MODEL_DATA; if False, the model
90 visibilities will be generated on the fly (this
91 mode may save some disk space equivalent to the
92 volume of the observed data).
93 [1;42mRETURNS[1;m void
95 --------- examples -----------------------------------------------------------
98 FOR MORE INFORMATION, SEE THE TASK PAGES OF FT IN CASA DOCS:
99 https://casa.nrao.edu/casadocs/
103 """
105 _info_group_ = """imaging, calibration"""
106 _info_desc_ = """Insert a source model as a visibility set"""
108 def __call__( self, vis='', field='', spw='', model='', nterms=int(1), reffreq='', complist='', incremental=False, usescratch=False ):
109 schema = {'vis': {'type': 'cReqPath', 'coerce': _coerce.expand_path}, 'field': {'type': 'cStr', 'coerce': _coerce.to_str}, 'spw': {'type': 'cStr', 'coerce': _coerce.to_str}, 'model': {'type': 'cVariant', 'coerce': [_coerce.to_variant]}, 'nterms': {'type': 'cInt'}, 'reffreq': {'type': 'cStr', 'coerce': _coerce.to_str}, 'complist': {'type': 'cStr', 'coerce': _coerce.to_str}, 'incremental': {'type': 'cBool'}, 'usescratch': {'type': 'cBool'}}
110 doc = {'vis': vis, 'field': field, 'spw': spw, 'model': model, 'nterms': nterms, 'reffreq': reffreq, 'complist': complist, 'incremental': incremental, 'usescratch': usescratch}
111 assert _pc.validate(doc,schema), create_error_string(_pc.errors)
112 _logging_state_ = _start_log( 'ft', [ 'vis=' + repr(_pc.document['vis']), 'field=' + repr(_pc.document['field']), 'spw=' + repr(_pc.document['spw']), 'model=' + repr(_pc.document['model']), 'nterms=' + repr(_pc.document['nterms']), 'reffreq=' + repr(_pc.document['reffreq']), 'complist=' + repr(_pc.document['complist']), 'incremental=' + repr(_pc.document['incremental']), 'usescratch=' + repr(_pc.document['usescratch']) ] )
113 task_result = None
114 try:
115 task_result = _ft_t( _pc.document['vis'], _pc.document['field'], _pc.document['spw'], _pc.document['model'], _pc.document['nterms'], _pc.document['reffreq'], _pc.document['complist'], _pc.document['incremental'], _pc.document['usescratch'] )
116 except Exception as exc:
117 _except_log('ft', exc)
118 raise
119 finally:
120 task_result = _end_log( _logging_state_, 'ft', task_result )
121 return task_result
123ft = _ft( )