Coverage for /wheeldirectory/casa-6.7.0-12-py3.10.el8/lib/py/lib/python3.10/site-packages/casatasks/importatca.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 importatca.xml ################
2##################### f17af04e63dd592cea5bd148a07dbb50 ##############################
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_importatca import importatca as _importatca_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 _importatca:
15 """
16 importatca ---- Import ATCA RPFITS file(s) to a measurement set
19 Imports an arbitrary number of ATCA RPFITS format data sets into a
20 casa measurement set. If more than one band is present, they will be
21 put in the same measurement set but in a separate spectral window.
22 The task will handle both old ATCA and new CABB (after April 2009)
23 archive data.
25 --------- parameter descriptions ---------------------------------------------
27 files Name of input ATCA RPFits file(s)
28 vis Name of output MeasurementSet
29 Default: none
31 Example: vis='mydata.ms'
32 options Processing options
33 Default: none
34 Options: birdie, reweight, noxycorr, fastmosaic,
35 hires, noac (comma separated list)
37 - birdie: (pre-CABB data only) discard edge
38 channels and channels affected by internal RFI
39 - reweight: (pre-CABB data only) suppress ringing
40 of RFI spikes by reweighting of the lag
41 spectrum
42 - noxycorr: do not apply the xy phase correction
43 as derived from the switched noise calibration,
44 by default this is applied during loading of
45 the data
46 - fastmosaic: use this option if you are loading
47 mosaic data with many pointings and only one or
48 two integrations per pointing; this option
49 changes the tiling of the data to avoid
50 excessive I/O
51 - hires: use this option if you have data in time
52 binning mode (as used for pulsars) but you want
53 to make it look like data with very short
54 integration time (no bins)
55 - noac: discard the auto-correlation data
56 spw Select spectral window/channels
57 Default: '' (all spectral windows and channels)
59 Examples:
60 spw='0~2,4'; spectral windows 0,1,2,4 (all channels)
61 spw='<2'; spectral windows less than 2 (i.e. 0,1)
62 spw='0:5~61'; spw 0, channels 5 to 61
63 spw='0,10,3:3~45'; spw 0,10 all channels, spw
64 3 - chans 3 to 45.
65 spw='0~2:2~6'; spw 0,1,2 with channels 2
66 through 6 in each.
67 spw = '\*:3~64' channels 3 through 64 for all sp id's
68 spw = ' :3~64' will NOT work.
69 nscans Number of scans to skip followed by number of scans to
70 read
71 Default: [0, 0]
72 lowfreq Lowest reference frequency to select
73 Default: 0.1GHz
74 highfreq Highest reference frequency to select
75 Default: 999GHz
76 fields List of field names to select
77 edge The edge parameter specifies how many edge channels to
78 discard as a percentage of the number of channels in each band.
79 Default: 8 (e.g., discard 82 channels from the
80 top and bottom of a 2048 channel spectrum)
82 For combined zooms, this specifies the percentage
83 for a single zoom window
85 --------- examples -----------------------------------------------------------
88 FOR MORE INFORMATION, SEE THE TASK PAGES OF IMPORTATCA IN CASA DOCS:
89 https://casa.nrao.edu/casadocs/
93 """
95 _info_group_ = """import/export"""
96 _info_desc_ = """Import ATCA RPFITS file(s) to a measurement set"""
98 def __call__( self, files=[ ], vis='', options='', spw=[ int(-1) ], nscans=[ int(0),int(0) ], lowfreq={'value': float(0.1), 'unit': 'GHz'}, highfreq={'value': float(999), 'unit': 'GHz'}, fields=[ ], edge=float(8) ):
99 schema = {'files': {'type': 'cPathVec', 'coerce': [_coerce.to_list,_coerce.expand_pathvec]}, 'vis': {'type': 'cStr', 'coerce': _coerce.to_str}, 'options': {'type': 'cStr', 'coerce': _coerce.to_str}, 'spw': {'type': 'cIntVec', 'coerce': [_coerce.to_list,_coerce.to_intvec]}, 'nscans': {'type': 'cIntVec', 'coerce': [_coerce.to_list,_coerce.to_intvec]}, 'lowfreq': {'type': 'cDoubleQuant'}, 'highfreq': {'type': 'cDoubleQuant'}, 'fields': {'type': 'cStrVec', 'coerce': [_coerce.to_list,_coerce.to_strvec]}, 'edge': {'type': 'cFloat', 'coerce': _coerce.to_float}}
100 doc = {'files': files, 'vis': vis, 'options': options, 'spw': spw, 'nscans': nscans, 'lowfreq': lowfreq, 'highfreq': highfreq, 'fields': fields, 'edge': edge}
101 assert _pc.validate(doc,schema), create_error_string(_pc.errors)
102 _logging_state_ = _start_log( 'importatca', [ 'files=' + repr(_pc.document['files']), 'vis=' + repr(_pc.document['vis']), 'options=' + repr(_pc.document['options']), 'spw=' + repr(_pc.document['spw']), 'nscans=' + repr(_pc.document['nscans']), 'lowfreq=' + repr(_pc.document['lowfreq']), 'highfreq=' + repr(_pc.document['highfreq']), 'fields=' + repr(_pc.document['fields']), 'edge=' + repr(_pc.document['edge']) ] )
103 task_result = None
104 try:
105 task_result = _importatca_t( _pc.document['files'], _pc.document['vis'], _pc.document['options'], _pc.document['spw'], _pc.document['nscans'], _pc.document['lowfreq'], _pc.document['highfreq'], _pc.document['fields'], _pc.document['edge'] )
106 except Exception as exc:
107 _except_log('importatca', exc)
108 raise
109 finally:
110 task_result = _end_log( _logging_state_, 'importatca', task_result )
111 return task_result
113importatca = _importatca( )