Coverage for /wheeldirectory/casa-6.7.0-12-py3.10.el8/lib/py/lib/python3.10/site-packages/casatasks/importmiriad.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 importmiriad.xml ##############
2##################### 816bce2ce9c34258335e566cc652c17b ##############################
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_importmiriad import importmiriad as _importmiriad_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 _importmiriad:
15 """
16 importmiriad ---- Convert a Miriad visibility file into a CASA MeasurementSet
19 Convert a Miriad visibility file into a CASA MeasurementSet with
20 optional selection of spectral windows and weighting scheme
23 --------- parameter descriptions ---------------------------------------------
25 mirfile Name of input Miriad visibility file
26 Default: none
28 Example: mirfile='mydata.uv'
29 vis Name of output MeasurementSet
30 Default: none
32 Example: vis='mydata.ms'
33 tsys Use the Tsys to set the visibility weights
34 Default: False
35 Options: False|True
36 spw Select spectral window/channels
37 Default: '' (all spectral windows and channels)
39 Examples:
40 spw='0~2,4'; spectral windows 0,1,2,4 (all channels)
41 spw='<2'; spectral windows less than 2 (i.e. 0,1)
42 spw='0:5~61'; spw 0, channels 5 to 61
43 spw='0,10,3:3~45'; spw 0,10 all channels, spw
44 3 - chans 3 to 45.
45 spw='0~2:2~6'; spw 0,1,2 with channels 2
46 through 6 in each.
47 spw = '\*:3~64' channels 3 through 64 for all sp id's
48 spw = ' :3~64' will NOT work.
49 vel Select velocity reference
50 Default: telescope dependent, ATCA -> TOPO, CARMA
51 -> LSRK
52 Options: TOPO|LSRK|LSRD
54 Example: vel='LSRK'
55 linecal (CARMA) Apply line calibration
56 Default: False
57 Options: False|True
59 Only useful for CARMA data
60 wide (CARMA) Select wide window averages
62 Select which of the wide-band channels should be loaded
63 Only useful for CARMA data
64 debug Display increasingly verbose debug messages
65 Default: 0
67 Example: debug=1
68 [1;42mRETURNS[1;m void
70 --------- examples -----------------------------------------------------------
73 FOR MORE INFORMATION, SEE THE TASK PAGES OF IMPORTMIRIAD IN CASA DOCS:
74 https://casa.nrao.edu/casadocs/
78 """
80 _info_group_ = """import/export"""
81 _info_desc_ = """Convert a Miriad visibility file into a CASA MeasurementSet"""
83 def __call__( self, mirfile='', vis='', tsys=False, spw=[ int(-1) ], vel='', linecal=False, wide=[ ], debug=int(0) ):
84 schema = {'mirfile': {'type': 'cReqPath', 'coerce': _coerce.expand_path}, 'vis': {'type': 'cStr', 'coerce': _coerce.to_str}, 'tsys': {'type': 'cBool'}, 'spw': {'type': 'cIntVec', 'coerce': [_coerce.to_list,_coerce.to_intvec]}, 'vel': {'type': 'cStr', 'coerce': _coerce.to_str}, 'linecal': {'type': 'cBool'}, 'wide': {'type': 'cIntVec', 'coerce': [_coerce.to_list,_coerce.to_intvec]}, 'debug': {'type': 'cInt'}}
85 doc = {'mirfile': mirfile, 'vis': vis, 'tsys': tsys, 'spw': spw, 'vel': vel, 'linecal': linecal, 'wide': wide, 'debug': debug}
86 assert _pc.validate(doc,schema), create_error_string(_pc.errors)
87 _logging_state_ = _start_log( 'importmiriad', [ 'mirfile=' + repr(_pc.document['mirfile']), 'vis=' + repr(_pc.document['vis']), 'tsys=' + repr(_pc.document['tsys']), 'spw=' + repr(_pc.document['spw']), 'vel=' + repr(_pc.document['vel']), 'linecal=' + repr(_pc.document['linecal']), 'wide=' + repr(_pc.document['wide']), 'debug=' + repr(_pc.document['debug']) ] )
88 task_result = None
89 try:
90 task_result = _importmiriad_t( _pc.document['mirfile'], _pc.document['vis'], _pc.document['tsys'], _pc.document['spw'], _pc.document['vel'], _pc.document['linecal'], _pc.document['wide'], _pc.document['debug'] )
91 except Exception as exc:
92 _except_log('importmiriad', exc)
93 raise
94 finally:
95 task_result = _end_log( _logging_state_, 'importmiriad', task_result )
96 return task_result
98importmiriad = _importmiriad( )