Coverage for /wheeldirectory/casa-6.7.0-12-py3.10.el8/lib/py/lib/python3.10/site-packages/casatools/__casac__/singledishms.py: 61%
122 statements
« prev ^ index » next coverage.py v7.6.4, created at 2024-11-01 07:19 +0000
« prev ^ index » next coverage.py v7.6.4, created at 2024-11-01 07:19 +0000
1# This file was automatically generated by SWIG (http://www.swig.org).
2# Version 3.0.12
3#
4# Do not make changes to this file unless you know what you are doing--modify
5# the SWIG interface file instead.
7from sys import version_info as _swig_python_version_info
8if _swig_python_version_info >= (2, 7, 0):
9 def swig_import_helper():
10 import importlib
11 pkg = __name__.rpartition('.')[0]
12 mname = '.'.join((pkg, '_singledishms')).lstrip('.')
13 try:
14 return importlib.import_module(mname)
15 except ImportError:
16 return importlib.import_module('_singledishms')
17 _singledishms = swig_import_helper()
18 del swig_import_helper
19elif _swig_python_version_info >= (2, 6, 0):
20 def swig_import_helper():
21 from os.path import dirname
22 import imp
23 fp = None
24 try:
25 fp, pathname, description = imp.find_module('_singledishms', [dirname(__file__)])
26 except ImportError:
27 import _singledishms
28 return _singledishms
29 try:
30 _mod = imp.load_module('_singledishms', fp, pathname, description)
31 finally:
32 if fp is not None:
33 fp.close()
34 return _mod
35 _singledishms = swig_import_helper()
36 del swig_import_helper
37else:
38 import _singledishms
39del _swig_python_version_info
41try:
42 _swig_property = property
43except NameError:
44 pass # Python < 2.2 doesn't have 'property'.
46try:
47 import builtins as __builtin__
48except ImportError:
49 import __builtin__
51def _swig_setattr_nondynamic(self, class_type, name, value, static=1):
52 if (name == "thisown"):
53 return self.this.own(value)
54 if (name == "this"):
55 if type(value).__name__ == 'SwigPyObject':
56 self.__dict__[name] = value
57 return
58 method = class_type.__swig_setmethods__.get(name, None)
59 if method:
60 return method(self, value)
61 if (not static):
62 if _newclass:
63 object.__setattr__(self, name, value)
64 else:
65 self.__dict__[name] = value
66 else:
67 raise AttributeError("You cannot add attributes to %s" % self)
70def _swig_setattr(self, class_type, name, value):
71 return _swig_setattr_nondynamic(self, class_type, name, value, 0)
74def _swig_getattr(self, class_type, name):
75 if (name == "thisown"):
76 return self.this.own()
77 method = class_type.__swig_getmethods__.get(name, None)
78 if method:
79 return method(self)
80 raise AttributeError("'%s' object has no attribute '%s'" % (class_type.__name__, name))
83def _swig_repr(self):
84 try:
85 strthis = "proxy of " + self.this.__repr__()
86 except __builtin__.Exception:
87 strthis = ""
88 return "<%s.%s; %s >" % (self.__class__.__module__, self.__class__.__name__, strthis,)
90try:
91 _object = object
92 _newclass = 1
93except __builtin__.Exception:
94 class _object:
95 pass
96 _newclass = 0
98class singledishms(_object):
99 """Proxy of C++ casac::singledishms class."""
101 __swig_setmethods__ = {}
102 __setattr__ = lambda self, name, value: _swig_setattr(self, singledishms, name, value)
103 __swig_getmethods__ = {}
104 __getattr__ = lambda self, name: _swig_getattr(self, singledishms, name)
105 __repr__ = _swig_repr
107 def __init__(self):
108 """__init__(self) -> singledishms"""
109 this = _singledishms.new_singledishms()
110 try:
111 self.this.append(this)
112 except __builtin__.Exception:
113 self.this = this
115 def open(self, *args, **kwargs):
116 """
117 open(self, _ms_name) -> bool
121 Summary:
122 Open a new MeasurementSet for processing after closing current MeasurementSet
124 Description:
127 Close the current MeasurementSet and open a new MeasurementSet
128 instead. The current state of sdms is retained, except for
129 the data selection.
131 Input Parameters:
132 ms_name New MeasurementSet to be processed
134 Example:
136 sdms.open('m100_sd.ms')
138 --------------------------------------------------------------------------------
140 """
141 return _singledishms.singledishms_open(self, *args, **kwargs)
144 def close(self):
145 """
146 close(self) -> bool
150 Summary:
151 Close the sdms tool, with data written on disk, keeping sdms running for future use
153 Description:
156 This is used to close sdms tools. Note that the
157 data is written to disk and detached from sdms tool.
158 This is a synonym for done.
161 Example:
163 sdms.close()
165 --------------------------------------------------------------------------------
167 """
168 return _singledishms.singledishms_close(self)
171 def done(self):
172 """
173 done(self) -> bool
177 Summary:
178 Close the sdms tool
180 Description:
183 This is used to close and sdms tools. Note that the
184 data is written to disk and detached from sdms tool.
185 This is a synonym for close.
188 Example:
190 sdms.done()
192 --------------------------------------------------------------------------------
194 """
195 return _singledishms.singledishms_done(self)
198 def name(self):
199 """
200 name(self) -> string
204 Summary:
205 Provide the name of the attached MeasurementSet
207 Description:
210 Returns the name of the attached MeasurementSet.
213 Example:
215 sdms.name()
217 --------------------------------------------------------------------------------
219 """
220 return _singledishms.singledishms_name(self)
223 def subtract_baseline(self, *args, **kwargs):
224 """
225 subtract_baseline(self, _datacolumn, _outfile, _bloutput, _dosubtract, _spw, _updateweight, _sigmavalue, _blfunc, _order, _clip_threshold_sigma, _num_fitting_max, _linefinding, _threshold, _avg_limit, _minwidth, _edge) -> bool
229 Summary:
230 Invoke baseline subtraction
232 Description:
235 Fit baseline and subtract it from selected spectra
238 Input Parameters:
239 datacolumn The name of data column to process ('data', 'float_data', or 'corrected')
240 outfile The name of output MeasurementSet
241 bloutput The name(s) of Baseline to be output
242 dosubtract Execute baseline subtraction from the input data
243 spw Spectral Window Ids (0 relative) to select; -1 interpreted as all
244 updateweight Update weight based on sigmavalue of residual data
245 sigmavalue sigma value for computing weight
246 blfunc baseline function
247 order polynomial order
248 clip_threshold_sigma threshold for clipping in unit of sigma
249 num_fitting_max maximum number of recursive clipping
250 linefinding do line finding
251 threshold S/N threshold for line finder
252 avg_limit channel averaging for broad lines in line finding
253 minwidth the minimum channel width to detect as a line by line finder
254 edge channels to drop at beginning and end of spectrum in line finding
256 Example:
258 sdms.open('m100_sd.ms')
259 sdms.set_selection(field='M100')
260 sdms.subtract_baseline(order=3,clip_threshold_sigma=5.0,num_fitting_max=6)
262 --------------------------------------------------------------------------------
264 """
265 return _singledishms.singledishms_subtract_baseline(self, *args, **kwargs)
268 def subtract_baseline_cspline(self, *args, **kwargs):
269 """
270 subtract_baseline_cspline(self, _datacolumn, _outfile, _bloutput, _dosubtract, _spw, _updateweight, _sigmavalue, _npiece, _clip_threshold_sigma, _num_fitting_max, _linefinding, _threshold, _avg_limit, _minwidth, _edge) -> bool
274 Summary:
275 Invoke baseline subtraction
277 Description:
280 Fit baseline and subtract it from selected spectra
283 Input Parameters:
284 datacolumn The name of data column to process ('data', 'float_data', or 'corrected')
285 outfile The name of output MeasurementSet
286 bloutput The name(s) of Baseline to be output
287 dosubtract Execute baseline subtraction from the input data
288 spw Spectral Window Ids (0 relative) to select; -1 interpreted as all
289 updateweight Update weight based on sigmavalue of residual data
290 sigmavalue sigma value for computing weight
291 npiece cspline npiece
292 clip_threshold_sigma threshold for clipping in unit of sigma
293 num_fitting_max maximum number of recursive clipping
294 linefinding do line finding
295 threshold S/N threshold for line finder
296 avg_limit channel averaging for broad lines in line finding
297 minwidth the minimum channel width to detect as a line by line finder
298 edge channels to drop at beginning and end of spectrum in line finding
300 Example:
302 sdms.open('m100_sd.ms')
303 sdms.set_selection(field='M100')
304 sdms.subtract_baseline_cspline(npiece=3,clip_threshold_sigma=5.0,num_fitting_max=6)
306 --------------------------------------------------------------------------------
308 """
309 return _singledishms.singledishms_subtract_baseline_cspline(self, *args, **kwargs)
312 def subtract_baseline_sinusoid(self, *args, **kwargs):
313 """
314 subtract_baseline_sinusoid(self, _datacolumn, _outfile, _bloutput, _dosubtract, _spw, _updateweight, _sigmavalue, _addwn, _rejwn, _applyfft, _fftmethod, _fftthresh, _clip_threshold_sigma, _num_fitting_max, _linefinding, _threshold, _avg_limit, _minwidth, _edge) -> bool
318 Summary:
319 Invoke baseline subtraction
321 Description:
324 Fit baseline and subtract it from selected spectra
327 Input Parameters:
328 datacolumn The name of data column to process ('data', 'float_data', or 'corrected')
329 outfile The name of output MeasurementSet
330 bloutput The name(s) of Baseline to be output
331 dosubtract Execute baseline subtraction from the input data
332 spw Spectral Window Ids (0 relative) to select; -1 interpreted as all
333 updateweight Update weight based on sigmavalue of residual data
334 sigmavalue sigma value for computing weight
335 addwn additional wave numbers to use
336 rejwn reject specified wave numbers
337 applyfft automatically set wave numbers of sinusoids
338 fftmethod method to automatically set wave numbers of sinusoids ['fft']
339 fftthresh threshold to select wave numbers of sinusoids
340 clip_threshold_sigma threshold for clipping in unit of sigma
341 num_fitting_max maximum number of recursive clipping
342 linefinding do line finding
343 threshold S/N threshold for line finder
344 avg_limit channel averaging for broad lines in line finding
345 minwidth the minimum channel width to detect as a line by line finder
346 edge channels to drop at beginning and end of spectrum in line finding
348 Example:
350 sdms.open('m100_sd.ms')
351 sdms.set_selection(field='M100')
352 sdms.subtract_baseline_sinusoid(applyfft=True,clip_threshold_sigma=5.0,num_fitting_max=6)
354 --------------------------------------------------------------------------------
356 """
357 return _singledishms.singledishms_subtract_baseline_sinusoid(self, *args, **kwargs)
360 def subtract_baseline_variable(self, *args, **kwargs):
361 """
362 subtract_baseline_variable(self, _datacolumn, _outfile, _bloutput, _dosubtract, _spw, _updateweight, _sigmavalue, _blparam, _verbose) -> bool
366 Summary:
367 Invoke baseline subtraction by parameters stored in a file.
369 Description:
372 Fit baseline and subtract it from selected spectra.
373 Fit parameters for each spectrum are obtained from a text file.
376 Input Parameters:
377 datacolumn The name of data column to process ('data', 'float_data', or 'corrected')
378 outfile The name of output MeasurementSet
379 bloutput The name(s) of Baseline to be output
380 dosubtract Execute baseline subtraction from the input data
381 spw Spectral Window Ids (0 relative) to select; -1 interpreted as all
382 updateweight Update weight based on sigmavalue of residual data
383 sigmavalue sigma value for computing weight
384 blparam The name of text file that stores fit parameters for each spectrum of selected MS
385 verbose Print fitting parameters of each spectrum to logger
387 Example:
389 sdms.open('m100_sd.ms')
390 sdms.set_selection(field='M100')
391 sdms.subtract_baseline_variable('m100_fitparam.txt')
393 --------------------------------------------------------------------------------
395 """
396 return _singledishms.singledishms_subtract_baseline_variable(self, *args, **kwargs)
399 def apply_baseline_table(self, *args, **kwargs):
400 """
401 apply_baseline_table(self, _bltable, _datacolumn, _spw, _updateweight, _sigmavalue, _outfile) -> bool
405 Summary:
406 Apply baseline table to MS.
408 Description:
411 For each row of given baseline table, read baseline parameters,
412 construct baseline, then subtract it from the corresponding spectrum
413 in the MS.
416 Input Parameters:
417 bltable The name of input Baseline Table
418 datacolumn The name of data column to process ('data', 'float_data', or 'corrected')
419 spw Spectral Window Ids (0 relative) to select; -1 interpreted as all
420 updateweight Update weight based on sigmavalue of residual data
421 sigmavalue sigma value for computing weight
422 outfile The name of output MeasurementSet
424 Example:
426 sdms.open('m100_sd.ms')
427 sdms.set_selection(field='M100')
428 sdms.apply_baseline_table('m100_sd.bltable')
430 --------------------------------------------------------------------------------
432 """
433 return _singledishms.singledishms_apply_baseline_table(self, *args, **kwargs)
436 def fit_line(self, *args, **kwargs):
437 """
438 fit_line(self, _datacolumn, _spw, _pol, _timebin, _timespan, _polaverage, _fitfunc, _nfit, _linefinding, _threshold, _avg_limit, _minwidth, _edge, _tempfile, _tempoutfile) -> bool
442 Summary:
443 Invoke line fitting
445 Description:
448 Fit line profile to selected spectra and obtain the best-fit parameter values
451 Input Parameters:
452 datacolumn The name of data column to process ('data', 'float_data', or 'corrected')
453 spw Spectral Window Ids (0 relative) to select; -1 interpreted as all
454 pol Select data by polarization(s)
455 timebin Bin width for time averaging
456 timespan Span the timebin across 'scan', 'state', 'field', or a combination of them (e.g., 'scan,state')
457 polaverage polarization averaging mode ('', 'stokes', or 'geometric')
458 fitfunc Function of line profile
459 nfit Comma-separated numbers of gaussian/lorentzian lines to fit in maskline region. ignored when linefinding=true.
460 linefinding do line finding
461 threshold S/N threshold for line finder
462 avg_limit channel averaging for broad lines in line finding
463 minwidth the minimum channel width to detect as a line by line finder
464 edge channels to drop at beginning and end of spectrum in line finding
465 tempfile The name of temporary file to keep fitting results
466 tempoutfile The name of temporary ms file
468 Example:
470 sdms.open('m100_sd.ms')
471 sdms.set_selection(field='M100')
472 sdms.fit_line(fitfunc='gauss',spw='0:1000~2000;4000~5000',nfit=[1,1])
474 --------------------------------------------------------------------------------
476 """
477 return _singledishms.singledishms_fit_line(self, *args, **kwargs)
480 def set_selection(self, *args, **kwargs):
481 """
482 set_selection(self, _spw, _field, _antenna, _timerange, _scan, _observation, _polarization, _beam, _intent, _feed, _taql, _reindex) -> bool
486 Summary:
487 Select Measurementset to process
489 Description:
495 Input Parameters:
496 spw Spectral Window Ids (0 relative) to select; -1 interpreted as all
497 field Field Ids (0 relative) or Field names (msselection syntax and wilcards are used) to select
498 antenna Antenna Ids (0 relative) or Antenna names (msselection syntax and wilcards are used) to select
499 timerange Limit data selected to be within a given time range. Syntax is defined in the msselection link
500 scan Limit data selected on scan numbers. Syntax is defined in the msselection link
501 observation Select data by observation ID(s). Syntax is the same as for scan numbers.
502 polarization Select data by polarization(s)
503 beam Beam Ids (0 relative) to select; CURRENTLY NOT AVAILABLE!!!
504 intent Select data by intent(s)
505 feed Select data by feed(s)
506 taql For the TAQL experts, flexible data selection using the TAQL syntax
507 reindex Re-index indices in subtables based on data selection
509 Example:
511 sdms.set_selection(field='M100', spw='3,5')
513 --------------------------------------------------------------------------------
515 """
516 return _singledishms.singledishms_set_selection(self, *args, **kwargs)
519 def smooth(self, *args, **kwargs):
520 """
521 smooth(self, _type, _width, _datacolumn, _outfile) -> bool
525 Summary:
526 Smooth data with arbitrary smoothing kernel
528 Description:
531 NOTE: currently only Gaussian kernel is supported.
534 Input Parameters:
535 type Smoothing kernel type
536 width Smoothing kernel width
537 datacolumn The name of data column to process ('data', 'float_data', or 'corrected')
538 outfile The name of output MeasurementSet
540 --------------------------------------------------------------------------------
542 """
543 return _singledishms.singledishms_smooth(self, *args, **kwargs)
546 def atmcor(self, *args, **kwargs):
547 """
548 atmcor(self, _config, _datacolumn, _outfile) -> bool
552 Summary:
553 Offline atmospheric correction of calibrated data
555 Description:
558 Offline atmospheric correction of calibrated data
561 Input Parameters:
562 config Configuration for atmospheric correction
563 datacolumn The name of data column to process ('data', 'float_data', or 'corrected')
564 outfile The name of output MeasurementSet
566 --------------------------------------------------------------------------------
568 """
569 return _singledishms.singledishms_atmcor(self, *args, **kwargs)
572 def importasap(self, *args, **kwargs):
573 """
574 importasap(self, _infile, _outfile, _parallel) -> bool
578 Summary:
579 Import ASAP Scantable to MS.
581 Description:
584 Import ASAP Scantable data to MeasurementSet.
587 Input Parameters:
588 infile The name of input ASAP Scantable
589 outfile The name of output MeasurementSet
590 parallel Turn on parallel execution
592 --------------------------------------------------------------------------------
594 """
595 return _singledishms.singledishms_importasap(self, *args, **kwargs)
598 def importnro(self, *args, **kwargs):
599 """
600 importnro(self, _infile, _outfile, _parallel) -> bool
604 Summary:
605 Import NOSTAR data to MS.
607 Description:
610 Import NOSTAR data to MeasurementSet.
613 Input Parameters:
614 infile The name of input NOSTAR data
615 outfile The name of output MeasurementSet
616 parallel Turn on parallel execution
618 --------------------------------------------------------------------------------
620 """
621 return _singledishms.singledishms_importnro(self, *args, **kwargs)
623 __swig_destroy__ = _singledishms.delete_singledishms
624 __del__ = lambda self: None
625singledishms_swigregister = _singledishms.singledishms_swigregister
626singledishms_swigregister(singledishms)
628# This file is compatible with both classic and new-style classes.