Coverage for /wheeldirectory/casa-6.7.0-12-py3.10.el8/lib/py/lib/python3.10/site-packages/casatools/singledishms.py: 65%

43 statements  

« prev     ^ index     » next       coverage.py v7.6.4, created at 2024-10-31 19:53 +0000

1##################### generated by xml-casa (v2) from singledishms.xml ############## 

2##################### a4df7bdedb92ac3c6488a5f6ac49bdc7 ############################## 

3from __future__ import absolute_import 

4from .__casac__.singledishms import singledishms as _singledishms 

5 

6from .errors import create_error_string 

7from .typecheck import CasaValidator as _validator 

8_pc = _validator( ) 

9from .coercetype import coerce as _coerce 

10 

11 

12class singledishms: 

13 _info_group_ = """singledishms""" 

14 _info_desc_ = """New single dish tool interface to process an MS""" 

15 ### self 

16 def __init__(self, *args, **kwargs): 

17 """This is used to construct a singledishms tool instance. The created instance is 

18 just like the default one ('sdms') but physically independent from it. 

19 This is useful when users want to create their own tool instance inside scripts/modules 

20 to avoid possible conflicts that may happen when using the default tool instance 

21 from various places. 

22 """ 

23 self._swigobj = kwargs.get('swig_object',None) 

24 if self._swigobj is None: 

25 self._swigobj = _singledishms() 

26 

27 def open(self, ms_name=''): 

28 """Close the current MeasurementSet and open a new MeasurementSet 

29 instead. The current state of sdms is retained, except for 

30 the data selection. 

31 """ 

32 return self._swigobj.open(ms_name) 

33 

34 def close(self): 

35 """This is used to close sdms tools. Note that the 

36 data is written to disk and detached from sdms tool. 

37 This is a synonym for done. 

38  

39 """ 

40 return self._swigobj.close() 

41 

42 def done(self): 

43 """This is used to close and sdms tools. Note that the 

44 data is written to disk and detached from sdms tool. 

45 This is a synonym for close. 

46  

47 """ 

48 return self._swigobj.done() 

49 

50 def name(self): 

51 """Returns the name of the attached MeasurementSet. 

52  

53 """ 

54 return self._swigobj.name() 

55 

56 def subtract_baseline(self, datacolumn='data', outfile='', bloutput='', dosubtract=True, spw=[ ], updateweight=False, sigmavalue='stddev', blfunc='poly', order=int(5), clip_threshold_sigma=float(3.0), num_fitting_max=int(1), linefinding=False, threshold=float(5.0), avg_limit=int(4), minwidth=int(4), edge=[ int(0),int(0) ]): 

57 """Fit baseline and subtract it from selected spectra 

58  

59 """ 

60 return self._swigobj.subtract_baseline(datacolumn, outfile, bloutput, dosubtract, spw, updateweight, sigmavalue, blfunc, order, clip_threshold_sigma, num_fitting_max, linefinding, threshold, avg_limit, minwidth, edge) 

61 

62 def subtract_baseline_cspline(self, datacolumn='data', outfile='', bloutput='', dosubtract=True, spw=[ ], updateweight=False, sigmavalue='stddev', npiece=int(5), clip_threshold_sigma=float(3.0), num_fitting_max=int(1), linefinding=False, threshold=float(5.0), avg_limit=int(4), minwidth=int(4), edge=[ int(0),int(0) ]): 

63 """Fit baseline and subtract it from selected spectra 

64  

65 """ 

66 return self._swigobj.subtract_baseline_cspline(datacolumn, outfile, bloutput, dosubtract, spw, updateweight, sigmavalue, npiece, clip_threshold_sigma, num_fitting_max, linefinding, threshold, avg_limit, minwidth, edge) 

67 

68 def subtract_baseline_sinusoid(self, datacolumn='data', outfile='', bloutput='', dosubtract=True, spw=[ ], updateweight=False, sigmavalue='stddev', addwn='0', rejwn='', applyfft=False, fftmethod='fft', fftthresh=[ ], clip_threshold_sigma=float(3.0), num_fitting_max=int(1), linefinding=False, threshold=float(5.0), avg_limit=int(4), minwidth=int(4), edge=[ int(0),int(0) ]): 

69 """Fit baseline and subtract it from selected spectra 

70  

71 """ 

72 return self._swigobj.subtract_baseline_sinusoid(datacolumn, outfile, bloutput, dosubtract, spw, updateweight, sigmavalue, addwn, rejwn, applyfft, fftmethod, fftthresh, clip_threshold_sigma, num_fitting_max, linefinding, threshold, avg_limit, minwidth, edge) 

73 

74 def subtract_baseline_variable(self, datacolumn='data', outfile='', bloutput='', dosubtract=True, spw=[ ], updateweight=False, sigmavalue='stddev', blparam='', verbose=False): 

75 """Fit baseline and subtract it from selected spectra. 

76 Fit parameters for each spectrum are obtained from a text file. 

77  

78 """ 

79 return self._swigobj.subtract_baseline_variable(datacolumn, outfile, bloutput, dosubtract, spw, updateweight, sigmavalue, blparam, verbose) 

80 

81 def apply_baseline_table(self, bltable='', datacolumn='data', spw=[ ], updateweight=False, sigmavalue='stddev', outfile=''): 

82 """For each row of given baseline table, read baseline parameters, 

83 construct baseline, then subtract it from the corresponding spectrum 

84 in the MS. 

85  

86 """ 

87 return self._swigobj.apply_baseline_table(bltable, datacolumn, spw, updateweight, sigmavalue, outfile) 

88 

89 def fit_line(self, datacolumn='data', spw=[ ], pol=[ ], timebin='', timespan='', polaverage='', fitfunc='gaussian', nfit='0', linefinding=False, threshold=float(5.0), avg_limit=int(4), minwidth=int(4), edge=[ int(0),int(0) ], tempfile='', tempoutfile=''): 

90 """Fit line profile to selected spectra and obtain the best-fit parameter values 

91  

92 """ 

93 return self._swigobj.fit_line(datacolumn, spw, pol, timebin, timespan, polaverage, fitfunc, nfit, linefinding, threshold, avg_limit, minwidth, edge, tempfile, tempoutfile) 

94 

95 def set_selection(self, spw=[ ], field=[ ], antenna=[ ], timerange=[ ], scan=[ ], observation=[ ], polarization=[ ], beam=[ ], intent=[ ], feed=[ ], taql='', reindex=True): 

96 """ 

97 """ 

98 return self._swigobj.set_selection(spw, field, antenna, timerange, scan, observation, polarization, beam, intent, feed, taql, reindex) 

99 

100 def smooth(self, type='gaussian', width=float(0.0), datacolumn='data', outfile=''): 

101 """NOTE: currently only Gaussian kernel is supported. 

102  

103 """ 

104 return self._swigobj.smooth(type, width, datacolumn, outfile) 

105 

106 def atmcor(self, config={ }, datacolumn='data', outfile=''): 

107 """Offline atmospheric correction of calibrated data 

108  

109 """ 

110 return self._swigobj.atmcor(config, datacolumn, outfile) 

111 

112 def importasap(self, infile='', outfile='', parallel=False): 

113 """Import ASAP Scantable data to MeasurementSet. 

114  

115 """ 

116 return self._swigobj.importasap(infile, outfile, parallel) 

117 

118 def importnro(self, infile='', outfile='', parallel=False): 

119 """Import NOSTAR data to MeasurementSet. 

120  

121 """ 

122 return self._swigobj.importnro(infile, outfile, parallel) 

123