Coverage for /wheeldirectory/casa-6.7.0-12-py3.10.el8/lib/py/lib/python3.10/site-packages/casatasks/sdfixscan.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 sdfixscan.xml #################
2##################### 6a1de0fd6bb62ca1dace38fc285b49d9 ##############################
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_sdfixscan import sdfixscan as _sdfixscan_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 _sdfixscan:
15 """
16 sdfixscan ---- Task for single-dish image processing
19 Task sdfixscan is used to remove a scanning noise that appears
20 as a striped noise pattern along the scan direction in a raster
21 scan data.
23 By default, the scanning noise is removed by using the
24 FFT-based 'Basket-Weaving' method (Emerson & Grave 1988) that
25 requires multiple images that observed exactly the same area with
26 different scanning direction. If only one image is available, the
27 'Pressed-out' method (Sofue & Reich 1979) can be used to remove
28 the scanning effect.
31 --------- parameter descriptions ---------------------------------------------
33 infiles list of name of input SD images (FITS or CASA image)
34 mode image processing mode
35 numpoly order of polynomial fit for Pressed-out method
36 beamsize beam size for Pressed-out method
37 smoothsize size of smoothing beam for Pressed-out method
38 direction scan direction (p.a.) counterclockwise from the horizontal axis in unit of degree
39 maskwidth mask width for Basket-Weaving (on percentage)
40 tmax maximum threshold value for processing
41 tmin minimum threshold value for processing
42 outfile name of output file
43 overwrite overwrite the output file if already exists
44 [1;42mRETURNS[1;m void
46 --------- examples -----------------------------------------------------------
49 -----------------
50 Keyword arguments
51 -----------------
52 infiles -- name or list of names of input SD (FITS or CASA) image(s)
53 mode -- image processing mode
54 options: 'fft_mask' (FFT-based Basket-Weaving),
55 'model' (Pressed-out method)
56 default: 'fft_mask'
57 >>>mode expandable parameter
58 direction -- scan direction (p.a.) counterclockwise from the
59 horizontal axis in unit of degree.
60 default: []
61 example: direction=[0.0, 90.0] means that the first image
62 has scan direction along longitude axis while the
63 second image is along latitude axis.
64 maskwidth -- mask width for Basket-Weaving on percentage
65 default: 1.0 (1.0% of map size)
66 numpoly -- order of polynomial fit in Presssed-out method
67 default: 2
68 beamsize -- beam size for Pressed-out method
69 default: 0.0
70 example: beamsize=10.0 is interpreted as '10arcsec'.
71 beamsize='1arcmin' specifies beam size as
72 quantity.
73 smoothsize -- smoothing beam size in Pressed-out method.
74 if numeric value is given, it is interpreted in unit
75 of beam size specified by the parameter beamsize
76 default: 2.0
77 example: smoothsize=2.0 means that smoothing beam size is
78 2.0 * beamsize.
79 smoothsize='1arcmin' sets smoothsize directly.
80 tmax -- maximum threshold value for processing
81 default: 0.0 (no threshold in maximum)
82 example: 10.0 (mask data larger value than 10.0)
83 tmin -- minimum threshold value for processing
84 default: 0.0 (no threshold in minimum)
85 example: -10.0 (mask data smaller value than -10.0)
86 outfile -- name of output file. output file is in CASA image format.
87 default: '' (use default name 'sdfixscan.out.im')
88 example: 'output.im'
89 overwrite -- overwrite the output file if already exists
90 options: (bool) True, False
91 default: False
93 -----------
94 DESCRIPTION
95 -----------
96 Task sdfixscan is used to remove a scanning noise that appears
97 as a striped noise pattern along the scan direction in a raster
98 scan data.
100 By default, the scanning noise is removed by using the FFT-based
101 'Basket-Weaving' method (Emerson & Grave 1988) that requires
102 multiple images that observed exactly the same area with different
103 scanning direction. If only one image is available, the 'Pressed-out'
104 method (Sofue & Reich 1979) can be used to remove the scanning
105 effect.
107 For 'Basket-Weaving', scanning directions must have at least two
108 different values. Normally, the scanning direction should be
109 specified for each input image. Otherwise, specified scanning
110 directions will be used iteratively. The maskwidth is a width of
111 masking region in the Fourier plane. It is specified as a fraction
112 (percentage) of the image size.
114 For 'Pressed-out', the scanning direction must be unique. There are
115 two ways to specify a size of smoothing beam used for process. One
116 is to specify smoothing size directly. To do this, smoothsize should
117 be specified as string that consists of a numerical value and an unit
118 (e.g. '10.0arcsec'). A value of beamsize will be ignored in this case.
119 Another way to specify smoothing size is to set an observed beam size
120 and indicate smoothing size as a scale factor of the observed beam
121 size. In this case, the beamsize is interpreted as the observed beam
122 size, and the smoothsize is the scale factor. If the beamsize is
123 provided as float value, its unit is assumed to 'arcsec'. It is also
124 possible to set the beamsize as string consisting of the numerical
125 value and the unit. The smoothsize must be float value.
127 The infiles only allows an image data (CASA or FITS), and does not
128 work with MS or Scantable. The direction is an angle with respect to
129 the horizontal direction, and its unit is degree. Any value may be
130 interpreted properly, but the value ranging from 0.0 to 180.0 will
131 be secure. The tmax and the tmin is used to specify a threshold that
132 defines a range of spectral values used for processing. The data point
133 that has the value larger than tmax or smaller than tmin will be
134 excluded from the processing. The default (0.0) is no threshold.
135 The outfile specifies an output CASA image name. If the outfile is
136 empty, the default name ('sdfixscan.out.im') will be used.
140 """
142 _info_group_ = """single dish"""
143 _info_desc_ = """Task for single-dish image processing"""
145 def __call__( self, infiles=[ ], mode='fft_mask', numpoly=int(2), beamsize=float(0.0), smoothsize=float(2.0), direction=[ ], maskwidth=float(1.0), tmax=float(0.0), tmin=float(0.0), outfile='', overwrite=False ):
146 schema = {'infiles': {'type': 'cVariant', 'coerce': [_coerce.to_variant]}, 'mode': {'type': 'cStr', 'coerce': _coerce.to_str, 'allowed': [ 'fft_mask', 'model' ]}, 'numpoly': {'type': 'cInt'}, 'beamsize': {'type': 'cFloat', 'coerce': _coerce.to_float}, 'smoothsize': {'type': 'cVariant', 'coerce': [_coerce.to_variant]}, 'direction': {'type': 'cVariant', 'coerce': [_coerce.to_variant]}, 'maskwidth': {'type': 'cVariant', 'coerce': [_coerce.to_variant]}, 'tmax': {'type': 'cFloat', 'coerce': _coerce.to_float}, 'tmin': {'type': 'cFloat', 'coerce': _coerce.to_float}, 'outfile': {'type': 'cStr', 'coerce': _coerce.to_str}, 'overwrite': {'type': 'cBool'}}
147 doc = {'infiles': infiles, 'mode': mode, 'numpoly': numpoly, 'beamsize': beamsize, 'smoothsize': smoothsize, 'direction': direction, 'maskwidth': maskwidth, 'tmax': tmax, 'tmin': tmin, 'outfile': outfile, 'overwrite': overwrite}
148 assert _pc.validate(doc,schema), create_error_string(_pc.errors)
149 _logging_state_ = _start_log( 'sdfixscan', [ 'infiles=' + repr(_pc.document['infiles']), 'mode=' + repr(_pc.document['mode']), 'numpoly=' + repr(_pc.document['numpoly']), 'beamsize=' + repr(_pc.document['beamsize']), 'smoothsize=' + repr(_pc.document['smoothsize']), 'direction=' + repr(_pc.document['direction']), 'maskwidth=' + repr(_pc.document['maskwidth']), 'tmax=' + repr(_pc.document['tmax']), 'tmin=' + repr(_pc.document['tmin']), 'outfile=' + repr(_pc.document['outfile']), 'overwrite=' + repr(_pc.document['overwrite']) ] )
150 task_result = None
151 try:
152 task_result = _sdfixscan_t( _pc.document['infiles'], _pc.document['mode'], _pc.document['numpoly'], _pc.document['beamsize'], _pc.document['smoothsize'], _pc.document['direction'], _pc.document['maskwidth'], _pc.document['tmax'], _pc.document['tmin'], _pc.document['outfile'], _pc.document['overwrite'] )
153 except Exception as exc:
154 _except_log('sdfixscan', exc)
155 raise
156 finally:
157 task_result = _end_log( _logging_state_, 'sdfixscan', task_result )
158 return task_result
160sdfixscan = _sdfixscan( )