Coverage for /wheeldirectory/casa-6.7.0-12-py3.10.el8/lib/py/lib/python3.10/site-packages/casatasks/importuvfits.py: 56%
27 statements
« prev ^ index » next coverage.py v7.6.4, created at 2024-10-31 19:10 +0000
« prev ^ index » next coverage.py v7.6.4, created at 2024-10-31 19:10 +0000
1##################### generated by xml-casa (v2) from importuvfits.xml ##############
2##################### 264135ac2cd552a4f2b3991e0ce23596 ##############################
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_importuvfits import importuvfits as _importuvfits_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 _importuvfits:
15 """
16 importuvfits ---- Convert a UVFITS file to a CASA visibility data set
18 Convert a UVITS file to a CASA visiblity data set.
19 Don't forget to flag autocorrelations using taskname flagdata, autocorr = true
22 --------- parameter descriptions ---------------------------------------------
24 fitsfile Name of input UV FITS file
25 vis Name of output visibility file (MS)
26 antnamescheme VLA/EVLA/CARMA only; \'new\' or \'old\'; \'VA04\' or \'04\' for VLA ant 4
28 --------- examples -----------------------------------------------------------
31 Convert a UVFITS file to a CASA visibility data set:
33 Keyword arguments:
34 fitsfile -- Name of input UV FITS file
35 default = none; example='3C273XC1.fits'
36 vis -- Name of output visibility file (MS)
37 default = none; example: vis='3C273XC1.ms'
38 antnamescheme -- Naming scheme for VLA/JVLA/CARMA antennas
39 default = old;
40 old: Antenna name is a number, '04'
41 This option exists for backwards compatibility
42 but can lead to ambiguous results when antenna
43 indices are used for data selection.
44 new: Antenna name is not a number, e.g., 'VA04' or 'EA04'
45 With this scheme, data selection via
46 antenna names and indices is non-ambiguous.
48 Note: Don't forget to flag autocorrections using
49 taskname flagdata, autocorr = true
54 """
56 _info_group_ = """import/export"""
57 _info_desc_ = """Convert a UVFITS file to a CASA visibility data set"""
59 def __call__( self, fitsfile='', vis='', antnamescheme='old' ):
60 schema = {'fitsfile': {'type': 'cReqPath', 'coerce': _coerce.expand_path}, 'vis': {'type': 'cStr', 'coerce': _coerce.to_str}, 'antnamescheme': {'type': 'cStr', 'coerce': _coerce.to_str, 'allowed': [ 'old', 'new' ]}}
61 doc = {'fitsfile': fitsfile, 'vis': vis, 'antnamescheme': antnamescheme}
62 assert _pc.validate(doc,schema), create_error_string(_pc.errors)
63 _logging_state_ = _start_log( 'importuvfits', [ 'fitsfile=' + repr(_pc.document['fitsfile']), 'vis=' + repr(_pc.document['vis']), 'antnamescheme=' + repr(_pc.document['antnamescheme']) ] )
64 task_result = None
65 try:
66 task_result = _importuvfits_t( _pc.document['fitsfile'], _pc.document['vis'], _pc.document['antnamescheme'] )
67 except Exception as exc:
68 _except_log('importuvfits', exc)
69 raise
70 finally:
71 task_result = _end_log( _logging_state_, 'importuvfits', task_result )
72 return task_result
74importuvfits = _importuvfits( )