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

122 statements  

« prev     ^ index     » next       coverage.py v7.6.4, created at 2024-10-31 17:39 +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. 

6 

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 

40 

41try: 

42 _swig_property = property 

43except NameError: 

44 pass # Python < 2.2 doesn't have 'property'. 

45 

46try: 

47 import builtins as __builtin__ 

48except ImportError: 

49 import __builtin__ 

50 

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) 

68 

69 

70def _swig_setattr(self, class_type, name, value): 

71 return _swig_setattr_nondynamic(self, class_type, name, value, 0) 

72 

73 

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)) 

81 

82 

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,) 

89 

90try: 

91 _object = object 

92 _newclass = 1 

93except __builtin__.Exception: 

94 class _object: 

95 pass 

96 _newclass = 0 

97 

98class singledishms(_object): 

99 """Proxy of C++ casac::singledishms class.""" 

100 

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 

106 

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 

114 

115 def open(self, *args, **kwargs): 

116 """ 

117 open(self, _ms_name) -> bool 

118 

119 

120 

121 Summary: 

122 Open a new MeasurementSet for processing after closing current MeasurementSet  

123 

124 Description: 

125 

126 

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. 

130 

131 Input Parameters: 

132 ms_name New MeasurementSet to be processed 

133 

134 Example: 

135 

136 sdms.open('m100_sd.ms') 

137 

138 -------------------------------------------------------------------------------- 

139 

140 """ 

141 return _singledishms.singledishms_open(self, *args, **kwargs) 

142 

143 

144 def close(self): 

145 """ 

146 close(self) -> bool 

147 

148 

149 

150 Summary: 

151 Close the sdms tool, with data written on disk, keeping sdms running for future use  

152 

153 Description: 

154 

155 

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. 

159 

160 

161 Example: 

162 

163 sdms.close() 

164 

165 -------------------------------------------------------------------------------- 

166 

167 """ 

168 return _singledishms.singledishms_close(self) 

169 

170 

171 def done(self): 

172 """ 

173 done(self) -> bool 

174 

175 

176 

177 Summary: 

178 Close the sdms tool 

179 

180 Description: 

181 

182 

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. 

186 

187 

188 Example: 

189 

190 sdms.done() 

191 

192 -------------------------------------------------------------------------------- 

193 

194 """ 

195 return _singledishms.singledishms_done(self) 

196 

197 

198 def name(self): 

199 """ 

200 name(self) -> string 

201 

202 

203 

204 Summary: 

205 Provide the name of the attached MeasurementSet 

206 

207 Description: 

208 

209 

210 Returns the name of the attached MeasurementSet. 

211 

212 

213 Example: 

214 

215 sdms.name() 

216 

217 -------------------------------------------------------------------------------- 

218 

219 """ 

220 return _singledishms.singledishms_name(self) 

221 

222 

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 

226 

227 

228 

229 Summary: 

230 Invoke baseline subtraction  

231 

232 Description: 

233 

234 

235 Fit baseline and subtract it from selected spectra 

236 

237 

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 

255 

256 Example: 

257 

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) 

261 

262 -------------------------------------------------------------------------------- 

263 

264 """ 

265 return _singledishms.singledishms_subtract_baseline(self, *args, **kwargs) 

266 

267 

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 

271 

272 

273 

274 Summary: 

275 Invoke baseline subtraction  

276 

277 Description: 

278 

279 

280 Fit baseline and subtract it from selected spectra 

281 

282 

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 

299 

300 Example: 

301 

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) 

305 

306 -------------------------------------------------------------------------------- 

307 

308 """ 

309 return _singledishms.singledishms_subtract_baseline_cspline(self, *args, **kwargs) 

310 

311 

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 

315 

316 

317 

318 Summary: 

319 Invoke baseline subtraction  

320 

321 Description: 

322 

323 

324 Fit baseline and subtract it from selected spectra 

325 

326 

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 

347 

348 Example: 

349 

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) 

353 

354 -------------------------------------------------------------------------------- 

355 

356 """ 

357 return _singledishms.singledishms_subtract_baseline_sinusoid(self, *args, **kwargs) 

358 

359 

360 def subtract_baseline_variable(self, *args, **kwargs): 

361 """ 

362 subtract_baseline_variable(self, _datacolumn, _outfile, _bloutput, _dosubtract, _spw, _updateweight, _sigmavalue, _blparam, _verbose) -> bool 

363 

364 

365 

366 Summary: 

367 Invoke baseline subtraction by parameters stored in a file.  

368 

369 Description: 

370 

371 

372 Fit baseline and subtract it from selected spectra. 

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

374 

375 

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 

386 

387 Example: 

388 

389 sdms.open('m100_sd.ms') 

390 sdms.set_selection(field='M100') 

391 sdms.subtract_baseline_variable('m100_fitparam.txt') 

392 

393 -------------------------------------------------------------------------------- 

394 

395 """ 

396 return _singledishms.singledishms_subtract_baseline_variable(self, *args, **kwargs) 

397 

398 

399 def apply_baseline_table(self, *args, **kwargs): 

400 """ 

401 apply_baseline_table(self, _bltable, _datacolumn, _spw, _updateweight, _sigmavalue, _outfile) -> bool 

402 

403 

404 

405 Summary: 

406 Apply baseline table to MS.  

407 

408 Description: 

409 

410 

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. 

414 

415 

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 

423 

424 Example: 

425 

426 sdms.open('m100_sd.ms') 

427 sdms.set_selection(field='M100') 

428 sdms.apply_baseline_table('m100_sd.bltable') 

429 

430 -------------------------------------------------------------------------------- 

431 

432 """ 

433 return _singledishms.singledishms_apply_baseline_table(self, *args, **kwargs) 

434 

435 

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 

439 

440 

441 

442 Summary: 

443 Invoke line fitting  

444 

445 Description: 

446 

447 

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

449 

450 

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 

467 

468 Example: 

469 

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]) 

473 

474 -------------------------------------------------------------------------------- 

475 

476 """ 

477 return _singledishms.singledishms_fit_line(self, *args, **kwargs) 

478 

479 

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 

483 

484 

485 

486 Summary: 

487 Select Measurementset to process 

488 

489 Description: 

490 

491 

492 

493 

494 

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 

508 

509 Example: 

510 

511 sdms.set_selection(field='M100', spw='3,5') 

512 

513 -------------------------------------------------------------------------------- 

514 

515 """ 

516 return _singledishms.singledishms_set_selection(self, *args, **kwargs) 

517 

518 

519 def smooth(self, *args, **kwargs): 

520 """ 

521 smooth(self, _type, _width, _datacolumn, _outfile) -> bool 

522 

523 

524 

525 Summary: 

526 Smooth data with arbitrary smoothing kernel 

527 

528 Description: 

529 

530 

531 NOTE: currently only Gaussian kernel is supported. 

532 

533 

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 

539 

540 -------------------------------------------------------------------------------- 

541 

542 """ 

543 return _singledishms.singledishms_smooth(self, *args, **kwargs) 

544 

545 

546 def atmcor(self, *args, **kwargs): 

547 """ 

548 atmcor(self, _config, _datacolumn, _outfile) -> bool 

549 

550 

551 

552 Summary: 

553 Offline atmospheric correction of calibrated data 

554 

555 Description: 

556 

557 

558 Offline atmospheric correction of calibrated data 

559 

560 

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 

565 

566 -------------------------------------------------------------------------------- 

567 

568 """ 

569 return _singledishms.singledishms_atmcor(self, *args, **kwargs) 

570 

571 

572 def importasap(self, *args, **kwargs): 

573 """ 

574 importasap(self, _infile, _outfile, _parallel) -> bool 

575 

576 

577 

578 Summary: 

579 Import ASAP Scantable to MS. 

580 

581 Description: 

582 

583 

584 Import ASAP Scantable data to MeasurementSet. 

585 

586 

587 Input Parameters: 

588 infile The name of input ASAP Scantable 

589 outfile The name of output MeasurementSet 

590 parallel Turn on parallel execution 

591 

592 -------------------------------------------------------------------------------- 

593 

594 """ 

595 return _singledishms.singledishms_importasap(self, *args, **kwargs) 

596 

597 

598 def importnro(self, *args, **kwargs): 

599 """ 

600 importnro(self, _infile, _outfile, _parallel) -> bool 

601 

602 

603 

604 Summary: 

605 Import NOSTAR data to MS. 

606 

607 Description: 

608 

609 

610 Import NOSTAR data to MeasurementSet. 

611 

612 

613 Input Parameters: 

614 infile The name of input NOSTAR data 

615 outfile The name of output MeasurementSet 

616 parallel Turn on parallel execution 

617 

618 -------------------------------------------------------------------------------- 

619 

620 """ 

621 return _singledishms.singledishms_importnro(self, *args, **kwargs) 

622 

623 __swig_destroy__ = _singledishms.delete_singledishms 

624 __del__ = lambda self: None 

625singledishms_swigregister = _singledishms.singledishms_swigregister 

626singledishms_swigregister(singledishms) 

627 

628# This file is compatible with both classic and new-style classes. 

629 

630