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

214 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, '_componentlist')).lstrip('.') 

13 try: 

14 return importlib.import_module(mname) 

15 except ImportError: 

16 return importlib.import_module('_componentlist') 

17 _componentlist = 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('_componentlist', [dirname(__file__)]) 

26 except ImportError: 

27 import _componentlist 

28 return _componentlist 

29 try: 

30 _mod = imp.load_module('_componentlist', fp, pathname, description) 

31 finally: 

32 if fp is not None: 

33 fp.close() 

34 return _mod 

35 _componentlist = swig_import_helper() 

36 del swig_import_helper 

37else: 

38 import _componentlist 

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 componentlist(_object): 

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

100 

101 __swig_setmethods__ = {} 

102 __setattr__ = lambda self, name, value: _swig_setattr(self, componentlist, name, value) 

103 __swig_getmethods__ = {} 

104 __getattr__ = lambda self, name: _swig_getattr(self, componentlist, name) 

105 __repr__ = _swig_repr 

106 

107 def __init__(self): 

108 """__init__(self) -> componentlist""" 

109 this = _componentlist.new_componentlist() 

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, _filename, _nomodify, _log) -> bool 

118 

119 

120 

121 Summary: 

122 Construct a cl from a table on disk 

123 

124 Description: 

125 

126 

127 Use this constructor to construct a componentlist tool by reading 

128 the data from an table. To ensure that this table contains 

129 all the necessary columns and to allow the table format to be 

130 enhanced in the future, it is highly recommended that the table be 

131 created using a componentlist tool. 

132 

133 The table that contains the componentlist may be opened read-only by 

134 setting the readonly flag to True. When this is done some of the 

135 functions in the componentlist tool cannot be used. These include 

136 the ``set'', ``convert'', ``remove'', ``replace'', ``purge'', 

137 ``recover'', and ``sort'' functions. 

138 

139 

140 Input Parameters: 

141 filename The filename of the table 

142 nomodify Should the table be opened read only 

143 log Send a message to the logger 

144 

145 Example: 

146 

147 cl.open('crux.cl') 

148 

149 -------------------------------------------------------------------------------- 

150 

151 """ 

152 return _componentlist.componentlist_open(self, *args, **kwargs) 

153 

154 

155 def asciitocomponentlist(self, *args, **kwargs): 

156 """ 

157 asciitocomponentlist(self, _filename, _asciifile, _refer, _format, _direction, _spectrum, _flux, _log) -> long 

158 

159 

160 

161 Summary: 

162 Create a componentlist from an ascii file {bf (Not implemented yet)} 

163 

164 Description: 

165 

166 

167 This constructor will allow conversion of a number of ascii-file-based 

168 formats to componentlists. 

169 

170 

171 Input Parameters: 

172 filename Name of output component list table 

173 asciifile Name of input ascii file 

174 refer Input reference frame 

175 format Name of format (only ST supported) 

176 direction Direction measure (for relative coordinates) 

177 spectrum Default spectrum field, valid spectrum field [type='Constant', frequency=[type='frequency' , refer='LSR' , m0=[unit='GHz' , value=1.0]]  

178 flux Default flux field, valid flux field [value=[0.0, 0.0, 0.0, 0.0], unit='Jy', polarization='Stokes'] 

179 log Send a message to the logger 

180 

181 -------------------------------------------------------------------------------- 

182 

183 """ 

184 return _componentlist.componentlist_asciitocomponentlist(self, *args, **kwargs) 

185 

186 

187 def concatenate(self, *args, **kwargs): 

188 """ 

189 concatenate(self, _list, _which, _log) -> bool 

190 

191 

192 

193 Summary: 

194 Append components from another componentlist. 

195 

196 Description: 

197 

198 

199 The concatenate function copies the specified component(s), from 

200 the specified to list, to the end of the current list. The 

201 components are specified by numbering them from one to the length 

202 of the list. You cannot append components to a list that has been 

203 opened read only but the list you are copying from may be 

204 readonly. 

205 

206 You use a vector of indices to copy a number of components at 

207 once. By default all components are copied. 

208 

209 

210 Input Parameters: 

211 list list to copy from. Can be a componentlist record or a componentlist file name from disk 

212 which which components to copy, -1 unset 

213 log Send a message to the logger 

214 

215 Example: 

216 

217 cl.addcomponent(flux=1.0, dir='J2000 19h00m00 -40d00m00') 

218 cl.addcomponent(flux=2.0, dir='J2000 19h10m00 -40d00m00') 

219 cl.addcomponent(flux=3.0, dir='J2000 19h00m00 -40d00m00') 

220 cl2 = cltool(); 

221 cl2.concatenate(cl.torecord(), [0,2]); 

222 cl.done() 

223 cl2.rename('part_list.cl'); 

224 cl2.done() 

225 We make a 3 component component list and 

226 copies the first and third component to another a componentlist 

227 that was initially empty. These components are then saved to the 

228 table called part_list.cl. 

229 

230 cl.close() ### make sure we start with empty componentlist 

231 cl.concatenate('crux.cl', [0,2]); 

232 cl.rename('crux-copy.cl'); 

233 cl.done() 

234 

235 This example reads a componentlist from a casa table and 

236 copies the first and third component to another a componentlist 

237 that was initially empty. These components are then saved to the 

238 table called crux-copy.cl. 

239 

240 -------------------------------------------------------------------------------- 

241 

242 """ 

243 return _componentlist.componentlist_concatenate(self, *args, **kwargs) 

244 

245 

246 def fromrecord(self, *args, **kwargs): 

247 """ 

248 fromrecord(self, _record) -> bool 

249 

250 

251 

252 Summary: 

253 make a componentlist tool from a record 

254 

255 Description: 

256 

257 

258 

259 This function allows the componentlist records that are returned 

260 by other functions (for e.g from imageanalysis tool) be converted 

261 to a tool to be manipulated or to be saved on disk 

262 

263 

264 

265 Input Parameters: 

266 record a component list record 

267 

268 Example: 

269 

270 cl2 = cltool() 

271 

272 cl2.fromrecord(ia.findsources()) 

273 cl2.rename('sourcesfound.cl') 

274 cl2.done() 

275 

276 -------------------------------------------------------------------------------- 

277 

278 """ 

279 return _componentlist.componentlist_fromrecord(self, *args, **kwargs) 

280 

281 

282 def haskeyword(self, *args, **kwargs): 

283 """ 

284 haskeyword(self, _keyword) -> bool 

285 

286 

287 

288 Summary: 

289 Does the attached component list table have the specified keyword?? 

290 

291 Description: 

292 

293 

294 

295 Does the attached component list table have the specified keyword? This 

296 method will not work for in-memory componentlists. That is, the componentlist 

297 must exist on disk. If not, an exception is thrown. This method is for 

298 convenience for string keywords and is not meant as a replacement for the 

299 table tool API. 

300 

301 

302 

303 Input Parameters: 

304 keyword Keyword. 

305 

306 Example: 

307 

308 cl2 = componentlist() 

309 cl2.open('my.cl') 

310 res = cl2.haskeyword('metadata')) 

311 cl2.done() 

312 

313 -------------------------------------------------------------------------------- 

314 

315 """ 

316 return _componentlist.componentlist_haskeyword(self, *args, **kwargs) 

317 

318 

319 def putkeyword(self, *args, **kwargs): 

320 """ 

321 putkeyword(self, _keyword, _value) 

322 

323 

324 

325 Summary: 

326 Set the specified table keyword. 

327 

328 Description: 

329 

330 

331 Set the specified keyword in the componentlist table. If the keyword 

332 already exists in the table, it will be overwritten with this specified 

333 value. The value can be any type that CASA supports as an input 

334 parameter to tool methods. This method will not work for in-memory 

335 componentlists. That is, the componentlist must exist on disk. If not, 

336 an exception is thrown. This method is for convenience for string 

337 keywords and is not meant as a replacement for the table tool API. 

338 

339 

340 Input Parameters: 

341 keyword Keyword. 

342 value Value to be set. 

343 

344 Example: 

345 

346 cl2 = componentlist() 

347 cl2.open('my.cl') 

348 myrec = {'fred': 2, 'you': 3} 

349 cl2.setkeyword('metadata') 

350 cl2.done() 

351 

352 -------------------------------------------------------------------------------- 

353 

354 """ 

355 return _componentlist.componentlist_putkeyword(self, *args, **kwargs) 

356 

357 

358 def getkeyword(self, *args, **kwargs): 

359 """ 

360 getkeyword(self, _keyword) -> variant * 

361 

362 

363 

364 Summary: 

365 Get the specified table keyword. 

366 

367 Description: 

368 

369 

370 Get the specified keyword in the componentlist table. This method 

371 will not work for in-memory componentlists. That is, the componentlist 

372 must exist on disk. If not, an exception is thrown. If the specified 

373 keyword does not exist in the table, an exception is thrown. This 

374 method is for convenience for string keywords and is not meant as a 

375 replacement for the table tool API. 

376 

377 

378 Input Parameters: 

379 keyword Keyword. 

380 

381 Example: 

382 

383 cl2 = componentlist() 

384 cl2.open('my.cl') 

385 res = cl2.getkeyword('metadata') 

386 cl2.done() 

387 

388 -------------------------------------------------------------------------------- 

389 

390 """ 

391 return _componentlist.componentlist_getkeyword(self, *args, **kwargs) 

392 

393 

394 def torecord(self): 

395 """ 

396 torecord(self) -> record * 

397 

398 

399 

400 Summary: 

401 convert componentlist to a record 

402 

403 Description: 

404 

405 

406 

407 This function allows the componentlist to be converted to a 

408 record. Usually useful to pass to other functions in image 

409 analysis for e.g 

410 

411 

412 

413 Example: 

414 

415 cl2=cltool() 

416 cl.open('mycomp.cl') 

417 

418 cl2.fromrecord(ia.deconvolvecomponentlist(cl.torecord())) 

419 cl2.rename('deconvolved_sources.cl') 

420 cl2.done() 

421 

422 -------------------------------------------------------------------------------- 

423 

424 """ 

425 return _componentlist.componentlist_torecord(self) 

426 

427 

428 def remove(self, *args, **kwargs): 

429 """ 

430 remove(self, _which, _log) -> bool 

431 

432 

433 

434 Summary: 

435 Remove a component from the list. 

436 

437 Description: 

438 

439 

440 

441 The remove function removes the specified component(s) from the 

442 list. Components are specified by numbering them from one to the 

443 length of the list. So removing component one will remove the 

444 first component. After using this function all the 

445 remaining components will be shuffled down so that component two 

446 becomes component one. You cannot remove components from a list 

447 that has been opened read only. 

448 

449 You can specify a vector of indices to remove a number of 

450 components at once. For example in a five element list removing 

451 elements [1,3,5] will result in a two element list, now indexed as 

452 elements one and two, containing what was previously the second 

453 and fourth components. 

454 

455 Components that have been deleted using this function are not 

456 lost. The recover function can be used to get them back unless the 

457 purge function has been executed. Then they are completely gone. 

458 

459 

460 

461 Input Parameters: 

462 which indices of which component(s) to remove a vector containing unique integers between 0 and one less than the length of the list, -1 for all 

463 log Send a message to the logger 

464 

465 Example: 

466 

467 cl.open('crux.cl') 

468 cl.remove(1) 

469 

470 -------------------------------------------------------------------------------- 

471 

472 """ 

473 return _componentlist.componentlist_remove(self, *args, **kwargs) 

474 

475 

476 def purge(self): 

477 """ 

478 purge(self) -> bool 

479 

480 

481 

482 Summary: 

483 Permanently delete removed components. 

484 

485 Description: 

486 

487 

488 

489 The remove function deletes components from the list but does not 

490 remove them from memory. They remain accessible and can be 

491 obtained with the recover function. The purge function frees up 

492 the memory occupied by the removed components. You cannot use the 

493 recover function to obtain the removed components after the purge 

494 function has been called. 

495 

496 

497 

498 Example: 

499 

500 cl.open('crux.cl') 

501 cl.remove(1) 

502 cl.purge() 

503 

504 -------------------------------------------------------------------------------- 

505 

506 """ 

507 return _componentlist.componentlist_purge(self) 

508 

509 

510 def recover(self, *args, **kwargs): 

511 """ 

512 recover(self, _log) -> bool 

513 

514 

515 

516 Summary: 

517 Obtain removed components. 

518 

519 Description: 

520 

521 

522 The recover function appends components to the end of the list 

523 that have been deleted with the remove function. This does not 

524 include components that were removed before the purge function was 

525 last executed. 

526 

527 

528 Input Parameters: 

529 log Send a message to the logger 

530 

531 Example: 

532 

533 cl.open('crux.cl') 

534 cl.remove(1) 

535 cl.recover() 

536 

537 -------------------------------------------------------------------------------- 

538 

539 """ 

540 return _componentlist.componentlist_recover(self, *args, **kwargs) 

541 

542 

543 def length(self): 

544 """ 

545 length(self) -> long 

546 

547 

548 

549 Summary: 

550 Find the number of components in the list. 

551 

552 Description: 

553 

554 

555 The length function returns a non-negative integer that 

556 indicates how many components the list currently contains. 

557 

558 

559 Example: 

560 

561 cl.open('crux.cl') 

562 n = cl.length() 

563 

564 -------------------------------------------------------------------------------- 

565 

566 """ 

567 return _componentlist.componentlist_length(self) 

568 

569 

570 def indices(self): 

571 """ 

572 indices(self) -> std::vector< long > 

573 

574 

575 

576 Summary: 

577 Return a vector of indices. (Not implemented yet) 

578 

579 Description: 

580 

581 

582 The indices function will returns a vector of non-negative 

583 integers that can be used to index through the list. This vector 

584 always contains the integers starting at one and increasing 

585 sequentially to the length of the list. Its main use is in for 

586 loops as is illustrated in the example below. 

587 

588 

589 -------------------------------------------------------------------------------- 

590 

591 """ 

592 return _componentlist.componentlist_indices(self) 

593 

594 

595 def sort(self, *args, **kwargs): 

596 """ 

597 sort(self, _criteria, _log) -> bool 

598 

599 

600 

601 Summary: 

602 Sort the components in a list 

603 

604 Description: 

605 

606 

607 The sort function can sort all the components in a list using a 

608 variety of criteria. Currently the following criteria are 

609 available: 

610 Flux: Sorts the list so that the brightest components, 

611 as defined by Stokes I, are at the beginning of the list. 

612 Position: Sorts the list so that components that are 

613 closest to a reference position, which is currently fixed at 

614 (ra,dec)=(0,0), are at the beginning of the list. 

615 Polarization: Sorts the list so that components with the 

616 largest fractional polarization, sqrt(Q**2+U**2+V**2)/I, are 

617 at the front of the list. Components where I=0 are placed at 

618 the end of the list. 

619 The parsing of the string containg the sorting criteria is case 

620 insensitive. You cannot sort a list that has been opened read only. 

621 

622 

623 Input Parameters: 

624 criteria a string containg the criteria to use to sort the list 

625 log Send a message to the logger 

626 

627 Example: 

628 

629 cl.open('crux.cl') 

630 cl.sort('Polarization') 

631 

632 -------------------------------------------------------------------------------- 

633 

634 """ 

635 return _componentlist.componentlist_sort(self, *args, **kwargs) 

636 

637 

638 def isphysical(self, *args, **kwargs): 

639 """ 

640 isphysical(self, _which) -> bool 

641 

642 

643 

644 Summary: 

645 Check if a component is physically plausible 

646 

647 Description: 

648 

649 

650 The isphysical function is used to check if the specified 

651 components meet a number of criteria that must be true if the 

652 component could be used to model a physical process. These 

653 criteria are: 

654 1. I >= sqrt(Q**2 + U**2 + V**2) 

655 2. That the flux, when represented using the Stokes 

656 representation, has a zero imaginary value. 

657 

658 The ``Flux properties'' section of the ComponentModels module 

659 documentation describes how it is possible to generate a 

660 component which has non-zero imaginary value in the Stokes 

661 representation. 

662 

663 It is possible to check a number of components at once by 

664 specifying the indicies of all the components. The returned value 

665 will only be True if all the specified components are physical. 

666 

667 

668 

669 Input Parameters: 

670 which A vector of indices Indices must be between 0 and one less than the list length, inclusively 

671 

672 Example: 

673 

674 cl2 = cltool() 

675 cl2.simulate(2) 

676 cl2.setflux(1, value=[10, 1+3j, 1-4j, 0], polarization='linear'); 

677 print cl2.isphysical([0,1]) 

678 

679 -------------------------------------------------------------------------------- 

680 

681 """ 

682 return _componentlist.componentlist_isphysical(self, *args, **kwargs) 

683 

684 

685 def sample(self, *args, **kwargs): 

686 """ 

687 sample(self, _direction, _pixellatsize, _pixellongsize, _frequency) -> std::vector< double > 

688 

689 

690 

691 Summary: 

692 Sample the flux of the list in a specified direction. (Not implemented yet) 

693 

694 Description: 

695 

696 

697 

698 The sample function will returns a vector containing the flux in 

699 Janskys/pixel of all the components in the list, in the specified 

700 direction, at the specified frequency. The returned vector always 

701 contains four elements corresponding to the Stokes parameters 

702 I,Q,U,V. 

703 

704 

705 

706 Input Parameters: 

707 direction The direction to sample any valid direction measure. A valid Direction measure or vector of string or string, e.g me.direction('J2000','19h30m00', '-20d00m00') or ['J2000','19h30m00', '-20d00m00'] or 'J2000 19h30m00 -20d00m00' 

708 pixellatsize the x-size of the in pixels to use when sampling any quantity that has angular units. 

709 pixellongsize the y-size of the in pixels to use when sampling any quantity that has angular units. 

710 frequency The frequency to sample at Any frequency measure 

711 

712 -------------------------------------------------------------------------------- 

713 

714 """ 

715 return _componentlist.componentlist_sample(self, *args, **kwargs) 

716 

717 

718 def rename(self, *args, **kwargs): 

719 """ 

720 rename(self, _filename, _log) -> bool 

721 

722 

723 

724 Summary: 

725 Give the list a name so it can save itself. use close to save to disk 

726 

727 Description: 

728 

729 

730 

731 The rename function is used to specify the name of the table 

732 associated with this componentlist. 

733 

734 When a componentlist is created it is not associated with an casa 

735 table. So when the componentlist is removed from memory its 

736 contents are lost. But if a name is attached to the componentlist, 

737 using the rename function, then its contents are saved in a table 

738 with the specified name when the componentlist is closed 

739 

740 NOTE: that by just using rename the componentlist is not ensured 

741 to be on disk; to be sure use close after rename 

742 

743 If the componentlist is created using the open() constructor then 

744 this function will rename the table associated with the list to 

745 the user specified name. You cannot rename a componentlist that 

746 has been opened read only. 

747 

748 

749 

750 

751 

752 Input Parameters: 

753 filename The filename of the table 

754 log Send a message to the logger 

755 

756 Example: 

757 

758 cl.simulate(1); 

759 cl.setshape(0, 'gaussian', '35mas', '27mas', '-10d') 

760 cl.setflux(0, [1.0, 0.2, 0.1, 0.01]); 

761 cl.rename('smallblob.cl'); 

762 cl.close(); 

763 

764 cl.open('smallblob.cl') 

765 n=cl.length() 

766 

767 This example starts with an empty componentlist tool and then adds 

768 one component to it. The parameters of this component are then 

769 modified to change the shape and flux and the list saved in the 

770 casa table called 'smallblob.cl' The data is not written to 

771 disk until the list is closed, and when it is the componentlist is 

772 reset. So you need to reopen it if you want to interact with it. 

773 

774 -------------------------------------------------------------------------------- 

775 

776 """ 

777 return _componentlist.componentlist_rename(self, *args, **kwargs) 

778 

779 

780 def simulate(self, *args, **kwargs): 

781 """ 

782 simulate(self, _howmany, _log) -> bool 

783 

784 

785 

786 Summary: 

787 Add some simulated components to the list 

788 

789 Description: 

790 

791 

792 The simulate function adds simulated components to the list. The 

793 simulation criterion is very simple, all the components added are 

794 identical! They are point sources at the J2000 north pole with a 

795 flux in Stokes I of 1~Jy, and zero in the other polarizations. The 

796 spectrum is constant. The 'set' functions (eg. setflux, setfreq) 

797 can be used to change these parameters to desired ones. 

798 

799 The howmany argument indicates how many components to append to 

800 the list. 

801 

802 

803 Input Parameters: 

804 howmany How many components to simulate, greater than zero 

805 log Send a message to the logger 

806 

807 Example: 

808 

809 cl.simulate(2) 

810 cl.setflux(1, [2.78, 0, 0, 0]); 

811 cl.rename('test.cl'); 

812 cl.close(); 

813 

814 

815 

816 This example creates a componentlist with two components. The setflux function is used to 

817 modify the second component. The list is then saved on disk. 

818 I use short scripts like this a lot during testing. 

819 

820 -------------------------------------------------------------------------------- 

821 

822 """ 

823 return _componentlist.componentlist_simulate(self, *args, **kwargs) 

824 

825 

826 def addcomponent(self, *args, **kwargs): 

827 """ 

828 addcomponent(self, _flux, _fluxunit, _polarization, _dir, _shape, _majoraxis, _minoraxis, _positionangle, _freq, _spectrumtype, _index, _optionalparms, _label) -> bool 

829 

830 

831 

832 Summary: 

833 Add a component to the list 

834 

835 Description: 

836 

837 

838 

839 The addcomponent function is a convenience function that ties 

840 together the simulate function, and the various set 

841 functions. This function adds a component to the end of the 

842 list. For a description of the arguments see the following 

843 functions. 

844 [flux, fluxunit, polarization] See setflux 

845 [ra, raunit, dec, decunit] See setrefdir 

846 [dirframe] See setrefdirframe 

847 [shape, majoraxis, minoraxis, positionangle] See setshape 

848 [freq] A frequency quantity which is split into a value and 

849 units and passed to the setfreq function 

850 [freqframe] See setfreq 

851 [spectrumtype, index] The spectral index alpha such that flux density S 

852 as a function of frequency nu is: S~nu**alpha. 

853 See also the setspectrum or setstokesspectrum functions. 

854 [label] See setlabel 

855 

856 

857 Input Parameters: 

858 flux The flux value. A vector with four real or complex numbers 

859 fluxunit The units of the flux. Any string with the same dimensions as the Jansky 

860 polarization The polarization of the value field. 'Stokes', 'linear' or 'circular' 

861 dir The direction measure of the source, it can a be any direction measure from the measures tool or a string of the type 'J2000 10h30m00 -20d00m00.0' or a vector of strings of the type ['J2000', '10:30:00.00', '-20.00.00.0']. Basically the string or strings should have the direction frame and quantities for Ra and Dec 

862 shape The new shape type. A string that is either 'point', 'Gaussian', or 'disk' 

863 majoraxis The width (FWHM in the case of a Gaussian) of the larger axis. A quantity with angular units 

864 minoraxis The width (FWHM in the case of a Gaussian) of the smaller axis. A quantity with angular units 

865 positionangle The rotation of the axes with respect to the reference frame. A quantity with angular units 

866 freq The reference frequency. A quantity with units equivalent to the 'Hz' and frame or a frequency measure, e.g ['TOPO', '1.6GHz'], or simply default frame (LSRK) '1.6GHz' 

867 spectrumtype The spectrum type, a string that is one of 'constant', 'spectral index', or 'plp' 

868 index The spectral index or coeffecients for plp. 

869 optionalparms optional parameters in vector (for future use) 

870 label The label for the component 

871 

872 Example: 

873 

874 cl.open('my.cl') 

875 cl.addcomponent( 

876 shape='point', flux=[1.0, 0.0, 0.0, 0.0], dir='J2000 19h00m00 -20d00m00', 

877 spectrumtype='plp', index=[1, 2, 3] 

878 ) 

879 

880 In this example, a point source with a power log polynomial 

881 spectrum having the specified indices is added. 

882 

883 -------------------------------------------------------------------------------- 

884 

885 """ 

886 return _componentlist.componentlist_addcomponent(self, *args, **kwargs) 

887 

888 

889 def close(self, *args, **kwargs): 

890 """ 

891 close(self, _log) -> bool 

892 

893 

894 

895 Summary: 

896 Save the componentlist to disk and reset its state. 

897 

898 Description: 

899 

900 

901 The close function resets the componentlist to its default state. In 

902 this state it contains no components and is not associated with 

903 any table. 

904 

905 This function flushes all the components in memory to disk if the 

906 componentlist is associated with a table. The table is then 

907 closed, and the contents of the list deleted. 

908 

909 If the list is not associated with a table its contents are still 

910 deleted and memory used by the list is released. 

911 

912 

913 Input Parameters: 

914 log Send a message to the logger 

915 

916 Example: 

917 

918 See the example for the 

919 rename function. 

920 

921 -------------------------------------------------------------------------------- 

922 

923 """ 

924 return _componentlist.componentlist_close(self, *args, **kwargs) 

925 

926 

927 def edit(self, *args, **kwargs): 

928 """ 

929 edit(self, _which, _log) -> bool 

930 

931 

932 

933 Summary: 

934 Start up the component editor gui (Not implemented yet) 

935 

936 Description: 

937 

938 

939 

940 

941 

942 Input Parameters: 

943 which An index specifying which component. An integer between 0 and one less than the list length 

944 log Send a message to the logger 

945 

946 -------------------------------------------------------------------------------- 

947 

948 """ 

949 return _componentlist.componentlist_edit(self, *args, **kwargs) 

950 

951 

952 def done(self): 

953 """ 

954 done(self) -> bool 

955 

956 

957 

958 Summary: 

959 Delete the componentlist tool 

960 

961 Description: 

962 

963 

964 The done function frees up all the memory associated with a 

965 componentlist tool. After calling this function the componentlist 

966 tool cannot be used, either to manipulate the current list, or 

967 to open a new one. This function does not delete the disk 

968 file associated with a componentlist, but it will shut down the 

969 server process if there are no other componentlist tools being used. 

970 

971 

972 Example: 

973 

974 See the example for the rename function. 

975 

976 -------------------------------------------------------------------------------- 

977 

978 """ 

979 return _componentlist.componentlist_done(self) 

980 

981 

982 def select(self, *args, **kwargs): 

983 """ 

984 select(self, _which) -> bool 

985 

986 

987 

988 Summary: 

989 Mark components in the list 

990 

991 Description: 

992 

993 

994 The select function is used to mark the specified components as 

995 ``selected''. This function will be used in conjunction with the 

996 planned graphical user interface. Other functions functions in the 

997 componentlist tool will behave no differently if a component is 

998 marked as ``selected''. 

999 

1000 Components are not selected when the list is initially read 

1001 from disk or when a new component is added to the list using the 

1002 simulate function. 

1003 

1004 

1005 Input Parameters: 

1006 which A vector of indices. Indices must be between 0 and one less than the list length, inclusively 

1007 

1008 Example: 

1009 

1010 cl.open('crux.cl') 

1011 cl.select([1,3]) 

1012 

1013 -------------------------------------------------------------------------------- 

1014 

1015 """ 

1016 return _componentlist.componentlist_select(self, *args, **kwargs) 

1017 

1018 

1019 def deselect(self, *args, **kwargs): 

1020 """ 

1021 deselect(self, _which) -> bool 

1022 

1023 

1024 

1025 Summary: 

1026 Unmark components in the list 

1027 

1028 Description: 

1029 

1030 

1031 

1032 The deselect function is used to remove the ``selected'' mark from 

1033 specified components in the list. This function wiil be used in 

1034 conjunction with the planned graphical user interface and no other 

1035 functions in the componentlist will behave differently if a 

1036 component is marked as ``selected'' or not. 

1037 

1038 Components are not selected when the list is initially read from 

1039 disk or when a new component is added to the list using the 

1040 simulate function. function. Deselecting a component that is 

1041 already deselected is perfectly valid and results in no change. 

1042 

1043 

1044 Input Parameters: 

1045 which A vector of indices Indices must be between 0 and one less than the list length, inclusively 

1046 

1047 Example: 

1048 

1049 cl.open('crux.cl') 

1050 cl.select([1,3]) 

1051 cl.deselect([2,3]) 

1052 

1053 -------------------------------------------------------------------------------- 

1054 

1055 """ 

1056 return _componentlist.componentlist_deselect(self, *args, **kwargs) 

1057 

1058 

1059 def selected(self): 

1060 """ 

1061 selected(self) -> std::vector< long > 

1062 

1063 

1064 

1065 Summary: 

1066 Determine which components are selected 

1067 

1068 Description: 

1069 

1070 

1071 The selected function is used to determine which components in a 

1072 list are selected. It returns a vector with indices that indicate 

1073 which components are selected. A zero length vector is returned if 

1074 no components are selected. 

1075 

1076 Components are marked as selected using the 

1077 select 

1078 function. This function will be used in conjunction with the 

1079 graphical user interface and other functions in the componentlist 

1080 tool will behave no differently if a component is marked as 

1081 ``selected'' or not. 

1082 

1083 

1084 

1085 Example: 

1086 

1087 cl.open('crux.cl') 

1088 cl.select([1,3]) 

1089 cl.deselect([2,3]) 

1090 cl.selected() 

1091 

1092 -------------------------------------------------------------------------------- 

1093 

1094 """ 

1095 return _componentlist.componentlist_selected(self) 

1096 

1097 

1098 def getlabel(self, *args, **kwargs): 

1099 """ 

1100 getlabel(self, _which) -> string 

1101 

1102 

1103 

1104 Summary: 

1105 Get the label of the specified component 

1106 

1107 Description: 

1108 

1109 

1110 The getlabel function returns the label associated with the specified 

1111 component. The label is an arbitrary text string that can be used 

1112 to tag a component. 

1113 

1114 

1115 Input Parameters: 

1116 which An index specifying which component. An integer between 0 and one less than the list length, inclusively 

1117 

1118 Example: 

1119 

1120 cl.open('crux.cl') 

1121 cl.getlabel(1) 

1122 

1123 -------------------------------------------------------------------------------- 

1124 

1125 """ 

1126 return _componentlist.componentlist_getlabel(self, *args, **kwargs) 

1127 

1128 

1129 def setlabel(self, *args, **kwargs): 

1130 """ 

1131 setlabel(self, _which, _value, _log) -> bool 

1132 

1133 

1134 

1135 Summary: 

1136 Set the label of the specified components 

1137 

1138 Description: 

1139 

1140 

1141 The setlabel function is used to reassign the label (an arbitrary 

1142 text string) of the specified components to 

1143 a new value. 

1144 

1145 

1146 Input Parameters: 

1147 which An index specifying the component to modify. An integer between 0 and one less than the list length, inclusively 

1148 value The label for the specified components 

1149 log Send a message to the logger 

1150 

1151 Example: 

1152 

1153 cl.open('centarusA.cl') 

1154 cl.setlabel(1, 'Core') 

1155 

1156 -------------------------------------------------------------------------------- 

1157 

1158 """ 

1159 return _componentlist.componentlist_setlabel(self, *args, **kwargs) 

1160 

1161 

1162 def getfluxvalue(self, *args, **kwargs): 

1163 """ 

1164 getfluxvalue(self, _which) -> std::vector< double > 

1165 

1166 

1167 

1168 Summary: 

1169 Get the flux value of the specified component 

1170 

1171 Description: 

1172 

1173 

1174 The getfluxvalue function returns the value of the flux of the 

1175 specified component using the current units and the current 

1176 polarization representation. The functions 

1177 getfluxunit & 

1178 getfluxpol & 

1179 can be used to get the units and polarization 

1180 representation that corresponds to the supplied value. 

1181 

1182 

1183 Input Parameters: 

1184 which An index specifying which component. An integer between 0 and one less than the list length, inclusively 

1185 

1186 Example: 

1187 

1188 cl.open('crux.cl'); 

1189 flux = cl.getfluxvalue(1); 

1190 unit = cl.getfluxunit(1); 

1191 

1192 

1193 This example returns the values, units, polarization and error of the 

1194 first component in the list. 

1195 

1196 -------------------------------------------------------------------------------- 

1197 

1198 """ 

1199 return _componentlist.componentlist_getfluxvalue(self, *args, **kwargs) 

1200 

1201 

1202 def getfluxunit(self, *args, **kwargs): 

1203 """ 

1204 getfluxunit(self, _which) -> string 

1205 

1206 

1207 

1208 Summary: 

1209 Get the flux unit of the specified component 

1210 

1211 Description: 

1212 

1213 

1214 The getfluxunit function returns the units of the flux of the 

1215 specified component. The actual values are obtained using the 

1216 getfluxvalue function. 

1217 

1218 

1219 Input Parameters: 

1220 which An index specifying which component. An integer between 0 and one less than the list length, inclusively 

1221 

1222 Example: 

1223 

1224 See the example for the 

1225 getfluxvalue function. 

1226 

1227 -------------------------------------------------------------------------------- 

1228 

1229 """ 

1230 return _componentlist.componentlist_getfluxunit(self, *args, **kwargs) 

1231 

1232 

1233 def getfluxpol(self, *args, **kwargs): 

1234 """ 

1235 getfluxpol(self, _which) -> string 

1236 

1237 

1238 

1239 Summary: 

1240 Get the polarization representation for the flux of the specified component {bf (Not implmented yet)} 

1241 

1242 Description: 

1243 

1244 

1245 The getfluxunit function returns the polarization representation 

1246 of the flux of the specified component. The actual values are 

1247 obtained using the 

1248 getfluxvalue 

1249 function. 

1250 

1251 

1252 Input Parameters: 

1253 which An index specifying which component. An integer between 0 and one less than the list length, inclusively 

1254 

1255 -------------------------------------------------------------------------------- 

1256 

1257 """ 

1258 return _componentlist.componentlist_getfluxpol(self, *args, **kwargs) 

1259 

1260 

1261 def getfluxerror(self, *args, **kwargs): 

1262 """ 

1263 getfluxerror(self, _which) -> std::vector< double > 

1264 

1265 

1266 

1267 Summary: 

1268 Get the error in the flux of the specified component 

1269 

1270 Description: 

1271 

1272 

1273 The getfluxerror function returns the error in the flux of the 

1274 specified component using the current units and the current 

1275 polarization representation. The functions 

1276 getfluxvalue & 

1277 getfluxunit & 

1278 getfluxpol & 

1279 can be used to get the value, units and polarization 

1280 representation that corresponds to the specified error. 

1281 

1282 No error calculations are done by this tool. The error can be 

1283 stored and retreived and if any of the parameters of the flux 

1284 change the user is responsible for updating the errors. 

1285 

1286 

1287 Input Parameters: 

1288 which Index specifying which component. An integer between 0 and one less than the list length, inclusively 

1289 

1290 -------------------------------------------------------------------------------- 

1291 

1292 """ 

1293 return _componentlist.componentlist_getfluxerror(self, *args, **kwargs) 

1294 

1295 

1296 def setflux(self, *args, **kwargs): 

1297 """ 

1298 setflux(self, _which, _value, _unit, _polarization, _error, _log) -> bool 

1299 

1300 

1301 

1302 Summary: 

1303 Set the flux of the specified components 

1304 

1305 Description: 

1306 

1307 

1308 The setflux function is used to reassign the flux of the 

1309 specified components to a new value. The flux value, unit and 

1310 polarization can be specified and any number of components can be 

1311 set to the new value. (Currently, the parameter, error is 

1312 ignored.) 

1313 

1314 

1315 Input Parameters: 

1316 which A vector of indices specifying the components to modify. A vector with indices between 0 and one less than the list length, inclusively 

1317 value The flux values for the specified components A vector with four real or complex numbers 

1318 unit The units of the flux. Any string with the same dimensions as the Jansky 

1319 polarization The polarization of the value field 

1320 error The error in the value field. A complex vector of length four. 

1321 log Send a message to the logger 

1322 

1323 Example: 

1324 

1325 cl.open('crux.cl'); 

1326 cl.setflux(0, [1,0,0,0], unit='jy', 

1327 polarization='Stokes', error=[.3, 0, 0, 0]) 

1328 

1329 -------------------------------------------------------------------------------- 

1330 

1331 """ 

1332 return _componentlist.componentlist_setflux(self, *args, **kwargs) 

1333 

1334 

1335 def convertfluxunit(self, *args, **kwargs): 

1336 """ 

1337 convertfluxunit(self, _which, _unit) -> bool 

1338 

1339 

1340 

1341 Summary: 

1342 Change (convert) the flux units of the specified components 

1343 

1344 Description: 

1345 

1346 

1347 The convertfluxunit function is used to convert the flux to another 

1348 unit. The units emph{must} have the same dimensions as the Jansky. 

1349 

1350 

1351 Input Parameters: 

1352 which A vector of indices specifying the components to modify. A vector with indices between 0 and one less than the list length, inclusively 

1353 unit The units of the flux. Any string with the same dimensions as the Jansky 

1354 

1355 Example: 

1356 

1357 cl.open('crux.cl') 

1358 print cl.getfluxvalue(1) 

1359 cl.convertflux(1, 'WU') 

1360 print cl.getfluxvalue(1) 

1361 

1362 -------------------------------------------------------------------------------- 

1363 

1364 """ 

1365 return _componentlist.componentlist_convertfluxunit(self, *args, **kwargs) 

1366 

1367 

1368 def convertfluxpol(self, *args, **kwargs): 

1369 """ 

1370 convertfluxpol(self, _which, _polarization) -> bool 

1371 

1372 

1373 

1374 Summary: 

1375 Change (convert) the polarization representation of the specified components 

1376 

1377 Description: 

1378 

1379 

1380 The convertfluxpol function is used to convert the flux to another 

1381 polarization representation. There are are three representations 

1382 used, namely , 'Stokes', 'linear' & 'circular' 

1383 

1384 

1385 Input Parameters: 

1386 which A vector of indices specifying the components to modify. A vector with indices between 0 and one less than the list length, inclusively 

1387 polarization The new polarization representation 

1388 

1389 Example: 

1390 

1391 cl.open('centarusA.cl') 

1392 print cl.getfluxvalue(1) 

1393 cl.convertfluxpol(1, 'linear') 

1394 print cl.getfluxvalue(1) 

1395 

1396 -------------------------------------------------------------------------------- 

1397 

1398 """ 

1399 return _componentlist.componentlist_convertfluxpol(self, *args, **kwargs) 

1400 

1401 

1402 def getrefdir(self, *args, **kwargs): 

1403 """ 

1404 getrefdir(self, _which) -> record * 

1405 

1406 

1407 

1408 Summary: 

1409 Return the reference direction 

1410 

1411 Description: 

1412 

1413 

1414 The getrefdir function returns, as a direction measure, the 

1415 reference direction for the specified component. The reference 

1416 direction is for all the currently supported component shapes the 

1417 direction of the centre of the component. 

1418 

1419 

1420 Input Parameters: 

1421 which An index specifying which component. An integer between 0 and one less than the list length, inclusively 

1422 

1423 Example: 

1424 

1425 cl.open('crux.cl') 

1426 dir = cl.getrefdir(1) 

1427 

1428 -------------------------------------------------------------------------------- 

1429 

1430 """ 

1431 return _componentlist.componentlist_getrefdir(self, *args, **kwargs) 

1432 

1433 

1434 def getrefdirra(self, *args, **kwargs): 

1435 """ 

1436 getrefdirra(self, _which, _unit, _precision) -> string 

1437 

1438 

1439 

1440 Summary: 

1441 Get the RA of the reference direction. (Not implemented not) 

1442 

1443 Description: 

1444 

1445 

1446 

1447 

1448 

1449 Input Parameters: 

1450 which An index specifying which component. An integer between 0 and one less than the list length, inclusively 

1451 unit The angular unit of the returned value. Any string containing an angular unit or 'angle' or 'time' 

1452 precision The number of digits in the returned string. Numbers between 1 and 16 make the most sense 

1453 

1454 -------------------------------------------------------------------------------- 

1455 

1456 """ 

1457 return _componentlist.componentlist_getrefdirra(self, *args, **kwargs) 

1458 

1459 

1460 def getrefdirdec(self, *args, **kwargs): 

1461 """ 

1462 getrefdirdec(self, _which, _unit, _precision) -> string 

1463 

1464 

1465 

1466 Summary: 

1467 Get the declination of the reference direction.(Not implemented yet) 

1468 

1469 Description: 

1470 

1471 

1472 

1473 The getrefdirdec function returns the declination of the reference 

1474 direction of the component as a formatted string. If the reference 

1475 frame is something other than J2000 or B1950 the value returned is 

1476 the longitude or the altitude. 

1477 

1478 See the getrefdirra function for a description of the unit and 

1479 precision arguments. 

1480 

1481 

1482 

1483 Input Parameters: 

1484 which An index specifying which component. An integer between 0 and one less than the list length, inclusively 

1485 unit The angular unit of the returned value. Any string containing an angular unit or 'angle' or 'time' 

1486 precision The number of digits in the returned string. Numbers between 1 and 16 make the most sense 

1487 

1488 Example: 

1489 

1490 See the example for the 

1491 getrefdirra function. 

1492 

1493 -------------------------------------------------------------------------------- 

1494 

1495 """ 

1496 return _componentlist.componentlist_getrefdirdec(self, *args, **kwargs) 

1497 

1498 

1499 def getrefdirframe(self, *args, **kwargs): 

1500 """ 

1501 getrefdirframe(self, _which) -> string 

1502 

1503 

1504 

1505 Summary: 

1506 Get the reference frame of the reference direction. 

1507 

1508 Description: 

1509 

1510 

1511 The getrefdirframe function returns the reference frame of the reference 

1512 direction of the component as a string. The returned string is 

1513 always in upper case. Common frames are, 'J2000', 'B1950' and 'GALACTIC'. 

1514 

1515 

1516 

1517 Input Parameters: 

1518 which An index specifying which component. An integer between 0 and one less than the list length, inclusively 

1519 

1520 Example: 

1521 

1522 See the example for the 

1523 getrefdirra function. 

1524 

1525 -------------------------------------------------------------------------------- 

1526 

1527 """ 

1528 return _componentlist.componentlist_getrefdirframe(self, *args, **kwargs) 

1529 

1530 

1531 def setrefdir(self, *args, **kwargs): 

1532 """ 

1533 setrefdir(self, _which, _ra, _dec, _log) -> bool 

1534 

1535 

1536 

1537 Summary: 

1538 Set the reference direction 

1539 

1540 Description: 

1541 

1542 

1543 The setrefdir function sets the reference direction of the 

1544 specified components to a new value. The direction is defined by 

1545 separately specifying the right ascension and the declination. 

1546 

1547 The right ascension is specified as a string or a real number 

1548 

1549 Ra can be in standard angle units 'deg', 'rad', or time formatted as such 'HH:MM:SS.sss' 

1550 eg., '19:34:63.8' or angle formatted as such '+DDD.MM.SS.sss' eg., 

1551 '127.23.12.37'. 

1552 

1553 Similarly the declination is specified as a string or a real 

1554 number and the decunit can be any angular unit or 'angle' or 

1555 'time'. 

1556 

1557 

1558 Input Parameters: 

1559 which A vector of indices specifying the components to modify. A vector with indices between 0 and one less than the list length, inclusively 

1560 ra The RA of the new direction, A formatted string or a number 

1561 dec The declination of the new direction. A formatted string or a number 

1562 log Send a message to the logger 

1563 

1564 Example: 

1565 

1566 cl.simulate(3) 

1567 cl.setrefdir(0, '12:26:35.9', '-63.5.56') 

1568 cl.setrefdir(1, '12h26m35.9', '-63d5m56') 

1569 cl.setrefdir(2, '-173.35deg', '-1.10128rad') 

1570 cl.rename('testcls.cl') 

1571 cl.close() # write to disk 

1572 

1573 -------------------------------------------------------------------------------- 

1574 

1575 """ 

1576 return _componentlist.componentlist_setrefdir(self, *args, **kwargs) 

1577 

1578 

1579 def setrefdirframe(self, *args, **kwargs): 

1580 """ 

1581 setrefdirframe(self, _which, _frame, _log) -> bool 

1582 

1583 

1584 

1585 Summary: 

1586 Set the reference frame for the direction 

1587 

1588 Description: 

1589 

1590 

1591 

1592 The setrefdirframe function sets the reference frame for the 

1593 reference direction of the specified components (what a mouthful)! 

1594 

1595 Currently the reference frame does not include additional 

1596 information like when and where the observation took place. Hence 

1597 only reference frames that are independent of this information can be 

1598 used. This includes the common ones of 'J2000', 'B1950', and 

1599 'Galactic'. The measures module contains a 

1600 complete listing of all possible reference frames. The parsing of 

1601 the reference frame string is case-insensitive. 

1602 

1603 

1604 

1605 Input Parameters: 

1606 which A vector of indices specifying the components to modify. A vector with indices between 0 and one less than the list length, inclusively 

1607 frame The new reference frame, A string like 'B1950', 'J2000' or 'galactic' 

1608 log Send a message to the logger 

1609 

1610 Example: 

1611 

1612 cl.open('crux.cl'); 

1613 cl.setrefdirframe(0, 'B1950'); 

1614 

1615 -------------------------------------------------------------------------------- 

1616 

1617 """ 

1618 return _componentlist.componentlist_setrefdirframe(self, *args, **kwargs) 

1619 

1620 

1621 def convertrefdir(self, *args, **kwargs): 

1622 """ 

1623 convertrefdir(self, _which, _frame) -> bool 

1624 

1625 

1626 

1627 Summary: 

1628 Convert the reference direction to a new frame 

1629 

1630 Description: 

1631 

1632 

1633 The convertrefdir function changes the specified components to use a 

1634 new direction reference frame. Using this function will change the 

1635 right-ascension and declination of the component(s), unlike the 

1636 setrefdirframe which does not. 

1637 

1638 Please see the 

1639 setrefdirframe 

1640 function for a description of what frames are allowed. 

1641 

1642 

1643 

1644 Input Parameters: 

1645 which A vector of indices specifying the components to modify. A vector with indices between 0 and one less than the list length, inclusively 

1646 frame The new reference frame A string like 'B1950', 'J2000' or 'galactic' 

1647 

1648 Example: 

1649 

1650 cl.open('crux.cl'); 

1651 cl.convertrefdirframe(0, 'J2000'); 

1652 

1653 -------------------------------------------------------------------------------- 

1654 

1655 """ 

1656 return _componentlist.componentlist_convertrefdir(self, *args, **kwargs) 

1657 

1658 

1659 def shapetype(self, *args, **kwargs): 

1660 """ 

1661 shapetype(self, _which) -> string 

1662 

1663 

1664 

1665 Summary: 

1666 Returns the shape type of the component 

1667 

1668 Description: 

1669 

1670 

1671 The shapetype function returns the current shape of the specified 

1672 component. The shape defines how the flux of the component varies 

1673 with direction on the sky. Currently there are three shapes 

1674 available. These are 'Point', 'Gaussian', and 'Disk'. This 

1675 function returns one of these four strings. 

1676 

1677 

1678 

1679 Input Parameters: 

1680 which An index specifying which component. An integer between 0 and one less than the list length, inclusively 

1681 

1682 Example: 

1683 

1684 cl.open('crux.cl') 

1685 print 'The first component has a', cl.shapetype(0), ' shape' 

1686 

1687 -------------------------------------------------------------------------------- 

1688 

1689 """ 

1690 return _componentlist.componentlist_shapetype(self, *args, **kwargs) 

1691 

1692 

1693 def getshape(self, *args, **kwargs): 

1694 """ 

1695 getshape(self, _which) -> record * 

1696 

1697 

1698 

1699 Summary: 

1700 Return the shape parameters the component 

1701 

1702 Description: 

1703 

1704 

1705 

1706 The getshape function returns the shape parameters of a component 

1707 in a record. As different shapes can have a differing number and 

1708 type of parameters the shape parameters are returned in a record 

1709 with fields that correspond to parameters relevant to the current 

1710 shape. 

1711 

1712 For a point shape there are only two fields; type and 

1713 direction. These are the shape type, and the reference 

1714 direction. These values are also returned by the 

1715 shapetype and 

1716 getrefdir 

1717 functions. 

1718 

1719 For both the Gaussian and disk shapes there are three additional 

1720 fields; majoraxis, minoraxis, positionangle. These are angular 

1721 quantities, and hence are records with a value 

1722 and a unit. 

1723 

1724 

1725 

1726 Input Parameters: 

1727 which An index specifying which component. An integer between 0 and one less than the list length, inclusively 

1728 

1729 Example: 

1730 

1731 See the examples for the 

1732 setshape and 

1733 convertshape 

1734 functions. 

1735 

1736 -------------------------------------------------------------------------------- 

1737 

1738 """ 

1739 return _componentlist.componentlist_getshape(self, *args, **kwargs) 

1740 

1741 

1742 def setshape(self, *args, **kwargs): 

1743 """ 

1744 setshape(self, _which, _type, _majoraxis, _minoraxis, _positionangle, _majoraxiserror, _minoraxiserror, _positionangleerror, _optionalparms, _log) -> bool 

1745 

1746 

1747 

1748 Summary: 

1749 Change the shape of the component 

1750 

1751 Description: 

1752 

1753 

1754 The setshape function changes the shape of the specified components 

1755 to the user specified shape. 

1756 

1757 The type argument defines what the sort of new shape to use. This 

1758 can be either 'point', 'Gaussian', or 'disk'. 

1759 The parsing of this string is case insensitive. 

1760 

1761 

1762 If the shape type is 'point' then the remaining arguments in this 

1763 function are ignored. There are no other parameters needed to 

1764 specify a point shape. 

1765 

1766 But if the shape is 'Gaussian', or 'disk', 

1767 the remaining arguments are needed to fully specify the shape. 

1768 The majoraxis, minoraxis and positionangle arguments are quantities (see the 

1769 quanta module for a definition of a 

1770 quantity). Hence they can be specified either as with string eg., 

1771 '1arcsec' or with a record eg., [value=1, unit='deg']. 

1772 

1773 The major axis is the width of the larger axis. For the Gaussian 

1774 shape this is the full width at half maximum. And the minor axis 

1775 is the width of the orthogonal axis. The positionangle is the 

1776 specifies the rotation of these two axes with respect to a line 

1777 connecting the poles of the current direction reference frame. If 

1778 the angle is positive the the north point of the component moves 

1779 in the eastern direction. 

1780 

1781 

1782 

1783 Input Parameters: 

1784 which A vector of indices specifying the components to modify. A vector with indices between 0 and one less than the list length, inclusively 

1785 type The new shape type. A string that is either 'point', 'Gaussian', or 'disk' 

1786 majoraxis The width of the larger axis. A quantity with angular units 

1787 minoraxis The width of the smaller axis. A quantity with angular units 

1788 positionangle The rotation of the axes with respect to the reference frame. A quantity with angular units 

1789 majoraxiserror Error of width of the larger axis. A quantity with angular units 

1790 minoraxiserror Error of the width of the smaller axis. A quantity with angular units 

1791 positionangleerror Error of the rotation of the axes with respect to the reference frame. A quantity with angular units 

1792 optionalparms optional parameters in a vector (for future use)  

1793 log Send a message to the logger 

1794 

1795 Example: 

1796 

1797 cl.open('crux.cl', nomodify=False) 

1798 cl.setshape(3, 'disk', '45mas', '45mas') 

1799 print cl.getshape(3)['majoraxis'] 

1800 

1801 -------------------------------------------------------------------------------- 

1802 

1803 """ 

1804 return _componentlist.componentlist_setshape(self, *args, **kwargs) 

1805 

1806 

1807 def convertshape(self, *args, **kwargs): 

1808 """ 

1809 convertshape(self, _which, _majoraxis, _minoraxis, _positionangle) -> bool 

1810 

1811 

1812 

1813 Summary: 

1814 Change the units of the shape parameters (Not implemented yet) 

1815 

1816 Description: 

1817 

1818 

1819 

1820 

1821 

1822 Input Parameters: 

1823 which A vector of indices specifying the components to modify. A vector with indices between 0 and one less than the list length, inclusively 

1824 majoraxis The units to use on the larger axis. A string with angular units 

1825 minoraxis The units to use on the smaller axis. A string with angular units 

1826 positionangle The units to use for the rotation of these axes. A string with angular units 

1827 

1828 -------------------------------------------------------------------------------- 

1829 

1830 """ 

1831 return _componentlist.componentlist_convertshape(self, *args, **kwargs) 

1832 

1833 

1834 def spectrumtype(self, *args, **kwargs): 

1835 """ 

1836 spectrumtype(self, _which) -> string 

1837 

1838 

1839 

1840 Summary: 

1841 Returns the spectral shape of the component 

1842 

1843 Description: 

1844 

1845 

1846 The spectrumtype function returns the current spectral shape of the 

1847 specified component. The spectral shape defines how the flux of 

1848 the component varies with frequency. Returns one of 'Constant', 

1849 'Spectral Index', 'Tabular Spectrum', and 'Power Logarithmic Polynomial'. 

1850 

1851 

1852 

1853 Input Parameters: 

1854 which An index specifying which component. An integer between 0 and one less than the list length, inclusively 

1855 

1856 Example: 

1857 

1858 cl.open('crux.cl') 

1859 print 'The first component has a', cl.spectrumtype(1), ' spectrum' 

1860 

1861 -------------------------------------------------------------------------------- 

1862 

1863 """ 

1864 return _componentlist.componentlist_spectrumtype(self, *args, **kwargs) 

1865 

1866 

1867 def getspectrum(self, *args, **kwargs): 

1868 """ 

1869 getspectrum(self, _which) -> record * 

1870 

1871 

1872 

1873 Summary: 

1874 Return the spectral parameters the component 

1875 

1876 Description: 

1877 

1878 

1879 

1880 The getspectrum function returns the spectral parameters of a 

1881 component in a record. As different spectral shapes can have a 

1882 differing number and type of parameters the spectral parameters 

1883 are returned in a record with fields that correspond to parameters 

1884 relevant to the current spectral shape. 

1885 

1886 For a constant spectrum there are only two fields; type and 

1887 frequency. These are the spectral type, and the reference 

1888 frequency. These values are also returned by the 

1889 spectrumtype and 

1890 getfreq 

1891 functions. 

1892 

1893 For the spectral index spectral shape there is also an index 

1894 field. This contains a vector with four numbers, these are the 

1895 spectral indicies for the I,Q,U,V components of the flux. 

1896 

1897 The dictionary associated with a power log polynomial spectrum has the following structure: 

1898 

1899 { 

1900 'coeffs': array([ 1., 2., 3.]), 

1901 'frequency': { 

1902 'type': 'frequency', 

1903 'm0': {'value': 1.4200000000000002, 'unit': 'GHz'}, 

1904 'refer': 'LSRK' 

1905 }, 

1906 'type': 'Power Logarithmic Polynomial', 

1907 'error': array([ 0., 0., 0.]) 

1908 } 

1909 

1910 The 'error' value is currently not used. 

1911 

1912 

1913 

1914 

1915 Input Parameters: 

1916 which An index specifying which component. An integer between 0 and one less than the list length, inclusively 

1917 

1918 Example: 

1919 

1920 See the examples for the 

1921 setspectrum and 

1922 getspectrum 

1923 functions. 

1924 

1925 -------------------------------------------------------------------------------- 

1926 

1927 """ 

1928 return _componentlist.componentlist_getspectrum(self, *args, **kwargs) 

1929 

1930 

1931 def setstokesspectrum(self, *args, **kwargs): 

1932 """ 

1933 setstokesspectrum(self, _which, _type, _index, _tabularfreqs, _tabulari, _tabularq, _tabularu, _tabularv, _reffreq, _frame) -> bool 

1934 

1935 

1936 

1937 Summary: 

1938 Change the spectrum of the component 

1939 

1940 Description: 

1941 

1942 

1943 The setstokesspectrum function changes the spectrum of the specified components 

1944 to the user specified spectrum. This is different from setspectrum as it provides ways to control variation of all 4 Stokes parameters with frequency. If only I variation is needed please use setspectrum 

1945 

1946 The type argument defines what the sort of new spectrum to use. This 

1947 can be either 'constant' or 'spectral index' or 'tabular'. The parsing of this 

1948 string is case insensitive. 

1949 

1950 If the spectrum type is 'constant' then the remaining arguments in 

1951 this function are ignored. There are no other parameters needed to 

1952 specify a constant spectrum. 

1953 

1954 But if the spectrum is 'spectral index', the 'index' argument is 

1955 needed. It is a 4 element vector. 

1956 

1957 The first element ($alpha_0$) is the spectral index of stokes I ($ I(nu)=I(nu_0)({{nu}over{nu_0}})^{alpha_0} $) 

1958 

1959 The second element ($alpha_1$) is a spectral index for the fractional linear polarization ( $sqrt{{{(Q(nu)^2+U(nu)^2)}over{I(nu)^2}}} = sqrt{{{(Q(nu_0)^2+U(nu_0)^2)}over{I(nu_0)^2}}}({{nu}over{nu_0}})^{alpha_1}$). $alpha_1=0$ implies constant fractional linear polarization w.r.t frequency. 

1960 

1961 The third element is a 'Rotation Measure' factor, i.e angle of rotation $theta= alpha_2 (lambda^2 - lambda_0^2)$ of the linear polarization at frequency $nu$ w.r.t frequency $nu_0$. 

1962 

1963 The fourth element is a spectral index for the fractional spectral polarization ( $ {{V(nu)}over{I(nu)}} = {{V(nu_0)}over{I(nu_0)}}({{nu}over{nu_0}})^{alpha_3}$ 

1964 

1965 If the spectrum is 'tabular', then {tt index} is ignored but the six parameters 

1966 {tt tabularfreqs, tabulari, tabularq, tabularu, tabularv and tabularframe} are considered. {tt tabularfreqs} and {tt tabulari, tabularq, tabularu, tabularv} have to be list of same lengths and larger than 2. You need at least 2 samples to interpolate the spectral value in between. 

1967 The Stokes parameters of the source is interpolated from these values. Extrappolation outside the range given in {tt tabularfreqs} is not done. 

1968 {tt tabularfreqs} should be float values in 'Hz' 

1969 {tt tabulari, tabularq, tabularu, tabularv} should be float values in 'Jy' 

1970 

1971 

1972 You should ensure that the reference 

1973 frequency is set to the value you desire, using the 

1974 setfreq 

1975 function if you change to the spectral index shape. 

1976 

1977 

1978 

1979 Input Parameters: 

1980 which The index specifying the component to modify. A value between 0 and one less than the list length, inclusively 

1981 type The new spectrum type. A string that is either 'constant or 'spectral index' or 'tabular' 

1982 index The spectral index. 

1983 tabularfreqs The frequencies of for the tabular values, in Hz 

1984 tabulari tabular Stokes I values, in Jy (same length as tabularfreqs) 

1985 tabularq tabular Stokes Q values, in Jy (same length as tabularfreqs) 

1986 tabularu tabular Stokes U values, in Jy (same length as tabularfreqs) 

1987 tabularv tabular Stokes V values, in Jy (same length as tabularfreqs) 

1988 reffreq The reference frequency for spectral index  

1989 frame The frame for which the frequencies given are in 

1990 

1991 Example: 

1992 

1993 This example add a point source model and revises the model point source spectral variation changing the spectral index and setting the reference flux to be at 2GHz. 

1994 I is assigned a spectral index of 1. fractional linear pol is assigned a spectral index of 0.4 and similarly for fraction circular pol and the linear pol angle is kept fixed with frequency. 

1995 

1996 cl.addcomponent(shape='point', flux=[10.0, 0.4, -0.2, 0.1], dir='J2000 19h00m00 -20d00m00') 

1997 cl.setstokesspectrum(which=0, type='spectral index', index=[1.0, 0.4, 0, 0.4], reffreq='2.0GHz') 

1998 cl.rename('my19hcomp.cl') 

1999 cl.done() 

2000 

2001 

2002 

2003 In this example a componentlist is created from scratch and 2 sources are added 

2004 One whose spectral variation is defined by a spectral index and the other one as 

2005 tabular values. Both components have full Stokes parameters spectral variation 

2006 defined. 

2007 

2008 cl.done() ### effectively resets state of cl tool 

2009 ###add first component 

2010 cl.addcomponent(flux=[10, 0.5, -0.3, 0.2], dir='J2000 15h22m00 5d04m00') 

2011 cl.setstokesspectrum(which=0, type='spectral index', index=[1.0, 0.4, 0, 0.4], reffreq='2.0GHz') 

2012 ###adding second component; flux value is unimportant as the tabular values will 

2013 ###will set it 

2014 cl.addcomponent(flux=[1.0, 0, 0, 0],dir='J2000 15h22m30 5d05m00') 

2015 ##define the IQUV flux variation as tabular values at different frequencies. 

2016 cl.setstokesspectrum(which=1, type='tabular', tabularfreqs=[1.0e9, 1.1e9, 1.2e9, 1.3e9, 1.4e9, 1.5e9, 1.6e9], tabulari=[10.0, 10.1, 10.2, 10.2, 10.25, 10.3, 1.4], tabularq=[0.2, 0.2, 0.22, 0.23, 0.22, 0.24, 0.25], tabularu=[-0.1, -0.12, -0.13, -0.13, -0.12, -0.14, -0.15], tabularv=[0.1, 0.2, 0.2, 0.2, 0.3, 0.1, 0.15]) 

2017 ###saving the componentlist to disk 

2018 cl.rename('two_comp.cl') 

2019 cl.done() ###done is needed to sync to disk 

2020 

2021 -------------------------------------------------------------------------------- 

2022 

2023 """ 

2024 return _componentlist.componentlist_setstokesspectrum(self, *args, **kwargs) 

2025 

2026 

2027 def setspectrum(self, *args, **kwargs): 

2028 """ 

2029 setspectrum(self, _which, _type, _index, _tabularfreqs, _tabularflux, _tabularframe) -> bool 

2030 

2031 

2032 

2033 Summary: 

2034 Change the spectrum of the component 

2035 

2036 Description: 

2037 

2038 

2039 The setspectrum function changes the spectrum of the specified components 

2040 to the user specified spectrum. 

2041 

2042 The type argument defines what the sort of new spectrum to use. This 

2043 can be one of 'constant', 'tabular', 'plp', or 'spectral index'. Minimal 

2044 match, case insensitive. 

2045 

2046 If the spectrum type is 'constant' then the remaining arguments in 

2047 this function are ignored. There are no other parameters needed to 

2048 specify a constant spectrum. The reference frequency is set to be 

2049 the same value as the component being replaced. Although this is 

2050 unimportant for a constant spectrum, it may be important if 

2051 the spectral model of the component in question is changed again 

2052 later. See rules to how the reference frequencies of various spectral 

2053 models are set in the description below. 

2054 

2055 If the spectrum is 'spectral index', the 'index' argument is 

2056 needed to fully specify the spectrum by using the index argument. The 

2057 index parameter may be in the form of a single numerical value, or 

2058 an array containing a numerical value. In the case of the array containing 

2059 multiple values, the zeroth value is used as the value of index, while 

2060 subsequent values are tacitly ignored. The functional form of this model 

2061 is 

2062 

2063 R = x^(alpha) 

2064 

2065 where R = I_nu/I_nu0 is the ratio of the intensities at observed frequency nu 

2066 and the reference frequency nu_0, x = nu/nu_0, and alpha is the specified 

2067 spectral index. The reference frequency is tacitly set to that of the component 

2068 being replaced. and can be changed by a subsequent call to setfreq(). 

2069 

2070 If spectrum = 'plp', then the spectral model is set to a power log polynomial. 

2071 The functional form of this model is 

2072 

2073 R = x^(c_0 + c_1*(ln(x)) + c_2*(ln(x))^2 + c_3*(ln(x))^3 + ... + c_n*(ln(x))^n) 

2074 

2075 where R = I_nu/I_nu0 is the ratio of the intensities at observed frequency nu 

2076 and the reference frequency nu_0, x = nu/nu_0, ln is the natural logarithm, and 

2077 c_0 ... c_n are the coefficients specified by index. In this case, index should 

2078 be an array of numerical values, and the array length is unconstrained. The 

2079 reference frequency is tacitly set to that of the component being replaced, and 

2080 can be changed by a subsequent call to setfreq(). 

2081 

2082 If the spectrum is 'tabular', then 'index' is ignored but the 

2083 three parameters 'tabularfreqs', 'tabularflux' and 'tabularframe' 

2084 are considered. 'tabularfreqs' and 'tabularflux' have to be list 

2085 of same lengths and larger than 2. You need at least 2 samples to 

2086 interpolate the spectral value in between. The flux of the source 

2087 is interpolated from these values. Extrapolation outside the range 

2088 given in 'tabularfreqs' is not done. 

2089 'tabularfreqs' should be float values in 'Hz' 

2090 'tabularflux' should be float values in 'Jy' 

2091 The reference frequency is chosen to be the zeroth element of tabularfreqs. 

2092 

2093 

2094 

2095 You should ensure that the reference 

2096 frequency is set to the value you desire, using the 

2097 setfreq 

2098 function if you change to the spectral index shape. 

2099 

2100 

2101 

2102 Input Parameters: 

2103 which The index specifying the component to modify. A value between 0 and one less than the list length, inclusively 

2104 type The new spectrum type. A string that is one of 'constant', 'spectral index' 'tabular', or 'plp' (caseless, minimum match) 

2105 index The spectral index or coefficients for plp. 

2106 tabularfreqs The frequencies of for the tabular values, in Hz 

2107 tabularflux tabular flux density values, in Jy (same length as tabularfreqs) 

2108 tabularframe For tabular models, the frame of the provided frequencies. 

2109 

2110 Example: 

2111 

2112 cl.open('centarusA.cl') 

2113 cl.setspectrum(2, 'spectral index', -0.5) 

2114 print cl.getcomponent(2)['spectrum']['index'] 

2115 cl.done() 

2116 

2117 This example revises the model for Centaurus-A changing the 

2118 spectral index of all the components in the left lobe. The 

2119 output from the print statement is '[-0.5 0 0 0]' 

2120 

2121 cl.addcomponent(shape='point', flux=[1.0, 0.0, 0.0, 0.0], dir='J2000 19h00m00 -20d00m00') 

2122 cl.setspectrum(which=0, type='tabular', tabularfreqs=[1.0e9, 1.1e9, 1.4e9], tabularflux=[1.0, 0.9, 0.75]) 

2123 cl.rename('my19hcomp.cl') 

2124 cl.done() 

2125 

2126 In this example a component is created from scratch as a point 

2127 source The spectrum is set to, say, measured values at 3 

2128 frequencies (1GHz, 1.1GHz and 1.4GHz) to 1.0Jy, 0.9Jy, 0.75Jy 

2129 respectively. Any frequency in between the range 1 to 1.4 GHz 

2130 the flux will be estimated by interpolation. 

2131 

2132 cl.open('my.cl') 

2133 cl.addcomponent(shape='point', flux=[1.0, 0.0, 0.0, 0.0], dir='J2000 19h00m00 -20d00m00') 

2134 cl.setspectrum(which=0, type='plp', index=[1, 2, 3]) 

2135 

2136 In this example, the initial component's spectrum is modified to a power log polynomial 

2137 with the specified indices. 

2138 

2139 -------------------------------------------------------------------------------- 

2140 

2141 """ 

2142 return _componentlist.componentlist_setspectrum(self, *args, **kwargs) 

2143 

2144 

2145 def getfreq(self, *args, **kwargs): 

2146 """ 

2147 getfreq(self, _which) -> record * 

2148 

2149 

2150 

2151 Summary: 

2152 Get the reference frequency (Not implemented yet) 

2153 

2154 Description: 

2155 

2156 

2157 

2158 

2159 

2160 Input Parameters: 

2161 which An index specifying which component. An integer between 0 and one less than the list length, inclusively 

2162 

2163 -------------------------------------------------------------------------------- 

2164 

2165 """ 

2166 return _componentlist.componentlist_getfreq(self, *args, **kwargs) 

2167 

2168 

2169 def getfreqvalue(self, *args, **kwargs): 

2170 """ 

2171 getfreqvalue(self, _which) -> double 

2172 

2173 

2174 

2175 Summary: 

2176 Get the reference frequency value (Not implemeted yet) 

2177 

2178 Description: 

2179 

2180 

2181 

2182 

2183 

2184 Input Parameters: 

2185 which An index specifying which component. An integer between 0 and one less than the list length, inclusively 

2186 

2187 -------------------------------------------------------------------------------- 

2188 

2189 """ 

2190 return _componentlist.componentlist_getfreqvalue(self, *args, **kwargs) 

2191 

2192 

2193 def getfrequnit(self, *args, **kwargs): 

2194 """ 

2195 getfrequnit(self, _which) -> string 

2196 

2197 

2198 

2199 Summary: 

2200 Get the reference frequency unit (Not implemeted yet) 

2201 

2202 Description: 

2203 

2204 

2205 

2206 

2207 

2208 Input Parameters: 

2209 which An index specifying which component. An integer between 0 and one less than the list length, inclusively 

2210 

2211 Example: 

2212 

2213 See the example for the 

2214 getfreqvalue function. 

2215 

2216 -------------------------------------------------------------------------------- 

2217 

2218 """ 

2219 return _componentlist.componentlist_getfrequnit(self, *args, **kwargs) 

2220 

2221 

2222 def getfreqframe(self, *args, **kwargs): 

2223 """ 

2224 getfreqframe(self, _which) -> string 

2225 

2226 

2227 

2228 Summary: 

2229 Get the reference frequency frame (Not implemeted yet) 

2230 

2231 Description: 

2232 

2233 

2234 

2235 

2236 

2237 

2238 Input Parameters: 

2239 which An index specifying which component. An integer between 0 and one less than the list length, inclusively 

2240 

2241 Example: 

2242 

2243 See the example for the 

2244 getfreqvalue function. 

2245 

2246 -------------------------------------------------------------------------------- 

2247 

2248 """ 

2249 return _componentlist.componentlist_getfreqframe(self, *args, **kwargs) 

2250 

2251 

2252 def setfreq(self, *args, **kwargs): 

2253 """ 

2254 setfreq(self, _which, _value, _unit, _log) -> bool 

2255 

2256 

2257 

2258 Summary: 

2259 Set the reference frequency 

2260 

2261 Description: 

2262 

2263 

2264 

2265 The setfreq function sets the reference frequency of the specified 

2266 components to a new value. The frequency is defined by separately 

2267 specifying the value and its units. Use the 

2268 setfreqframe 

2269 function to set the frequency reference frame 

2270 

2271 

2272 

2273 Input Parameters: 

2274 which An index specifying the component to modify An integer between 0 and one less than the list length, inclusively 

2275 value The new frequency value. A number 

2276 unit The units of the frequency. Any string with the same dimensions as the 'Hz' 

2277 log Send a message to the logger 

2278 

2279 Example: 

2280 

2281 cl.open('centarusA.cl') 

2282 cl.setfreq(1, 1.415, 'GHz') 

2283 

2284 -------------------------------------------------------------------------------- 

2285 

2286 """ 

2287 return _componentlist.componentlist_setfreq(self, *args, **kwargs) 

2288 

2289 

2290 def setfreqframe(self, *args, **kwargs): 

2291 """ 

2292 setfreqframe(self, _which, _frame, _log) -> bool 

2293 

2294 

2295 

2296 Summary: 

2297 Set the reference frame for the frequency 

2298 

2299 Description: 

2300 

2301 

2302 

2303 The setfreqframe function sets the reference frame for the 

2304 reference frequency of the specified components. 

2305 

2306 Currently the reference frame does not include additional 

2307 information like when are where the observation took place. Hence 

2308 no conversion between reference frames is available. In the 

2309 interim I recommend you always use the same frame. 

2310 

2311 

2312 

2313 Input Parameters: 

2314 which An index specifying the component to modify. An integer between 0 and one less than the list length, inclusively 

2315 frame The new reference frame, A string like 'LSRK', 'LSRD', 'GEO' or 'TOPO 

2316 log Send a message to the logger 

2317 

2318 Example: 

2319 

2320 cl.open('centarusA.cl') 

2321 cl.setfreqframe(0, 'LSRK') 

2322 

2323 -------------------------------------------------------------------------------- 

2324 

2325 """ 

2326 return _componentlist.componentlist_setfreqframe(self, *args, **kwargs) 

2327 

2328 

2329 def convertfrequnit(self, *args, **kwargs): 

2330 """ 

2331 convertfrequnit(self, _which, _unit) -> bool 

2332 

2333 

2334 

2335 Summary: 

2336 Convert the reference frequency to a new unit 

2337 

2338 Description: 

2339 

2340 

2341 

2342 The convertfrequnit function changes the specified components to use 

2343 a new unit for the reference frequency. Using this function will 

2344 change the frequency value also so that the overall reference 

2345 frequency is not changed. It will affect the values and units 

2346 obtained with 

2347 setfreqvalue 

2348 function. 

2349 

2350 Any unit can be used that has the same dimensions as the 'Hz'. 

2351 

2352 

2353 

2354 Input Parameters: 

2355 which An index specifying the component to modify. An integer between 0 and one less than the list length, inclusively 

2356 unit The new frequency unit. Any string with the same dimensions as the 'Hz' 

2357 

2358 Example: 

2359 

2360 cl.open('centarusA.cl'); 

2361 cl.convertfrequnit(1, 'kHz'); 

2362 

2363 -------------------------------------------------------------------------------- 

2364 

2365 """ 

2366 return _componentlist.componentlist_convertfrequnit(self, *args, **kwargs) 

2367 

2368 

2369 def getcomponent(self, *args, **kwargs): 

2370 """ 

2371 getcomponent(self, _which, _iknow) -> record * 

2372 

2373 

2374 

2375 Summary: 

2376 Extract a component from the list. 

2377 

2378 Description: 

2379 

2380 

2381 

2382 The component function returns a record, showing the current state 

2383 of the specified component in the list. 

2384 

2385 Modifying the record that is returned by this function does not 

2386 modify the component in the list. To do this you must remove the 

2387 component from the list, using the 

2388 remove function, 

2389 and add the modified component using the 

2390 add function, or use 

2391 the replace object 

2392 function. This function will be removed in a future release of 

2393 and you are urged to use the get functions to extract 

2394 information about a component. 

2395 

2396 

2397 

2398 Input Parameters: 

2399 which index of which component to extract. integers between 0 and one less than the length of the list, inclusively 

2400 iknow Suppress the warning message 

2401 

2402 -------------------------------------------------------------------------------- 

2403 

2404 """ 

2405 return _componentlist.componentlist_getcomponent(self, *args, **kwargs) 

2406 

2407 

2408 def add(self, *args, **kwargs): 

2409 """ 

2410 add(self, _thecomponent, _iknow) -> bool 

2411 

2412 

2413 

2414 Summary: 

2415 Add a component to the list. 

2416 

2417 Description: 

2418 

2419 

2420 The add function adds a component to the component 

2421 list. You cannot add components to a list that has been opened 

2422 read only. To use this function you need to know the details of 

2423 the record format. however this has been deprecated and you are 

2424 urged to use the set functions, in conjunction with the simulate 

2425 function to add a component to the list. 

2426 

2427 

2428 

2429 Input Parameters: 

2430 thecomponent A record that represents a component. any record that contains the required fields 

2431 iknow Suppress the warning message 

2432 

2433 -------------------------------------------------------------------------------- 

2434 

2435 """ 

2436 return _componentlist.componentlist_add(self, *args, **kwargs) 

2437 

2438 

2439 def replace(self, *args, **kwargs): 

2440 """ 

2441 replace(self, _which, _list, _whichones) -> bool 

2442 

2443 

2444 

2445 Summary: 

2446 Replace components in the list. {bf (Not implemented yet) } 

2447 

2448 Description: 

2449 

2450 

2451 

2452 The replace function replaces the components from the list with 

2453 the specified components from another list. The source list can be 

2454 opened readonly and the length of the vectors in the first and 

2455 third arguments must the the name. 

2456 

2457 You cannot replace components in a list that has been opened read 

2458 only. 

2459 

2460 

2461 

2462 Input Parameters: 

2463 which A vector of indices specifying the components to replace. A vector with indices between 0 and one less than the list length, inclusively 

2464 list The list containing the components to copy. A componentlist tool 

2465 whichones A vector of indices specifying the components to copy A vector with indices between 1 and the length of the list in the second argument 

2466 

2467 -------------------------------------------------------------------------------- 

2468 

2469 """ 

2470 return _componentlist.componentlist_replace(self, *args, **kwargs) 

2471 

2472 

2473 def summarize(self, *args, **kwargs): 

2474 """ 

2475 summarize(self, _which) -> bool 

2476 

2477 

2478 

2479 Summary: 

2480 Summarize the specified component to the logger 

2481 

2482 Description: 

2483 

2484 

2485 The summarize function summarizes the contents of the specified components to the logger. 

2486 

2487 

2488 Input Parameters: 

2489 which An index specifying which component. Unset or an integer between 0 and one less than the list length, inclusive 

2490 

2491 -------------------------------------------------------------------------------- 

2492 

2493 """ 

2494 return _componentlist.componentlist_summarize(self, *args, **kwargs) 

2495 

2496 

2497 def iscomponentlist(self, *args, **kwargs): 

2498 """ 

2499 iscomponentlist(self, _tool) -> bool 

2500 

2501 

2502 

2503 Summary: 

2504 Is the argument a componentlist tool? (Not implemented yet) 

2505 

2506 Description: 

2507 

2508 

2509 This global function can be used to determine if the supplied 

2510 argument is a componentlist tool. If so it returns True, otherwise 

2511 it returns False. 

2512 

2513 

2514 Input Parameters: 

2515 tool The variable that you wish to test 

2516 

2517 -------------------------------------------------------------------------------- 

2518 

2519 """ 

2520 return _componentlist.componentlist_iscomponentlist(self, *args, **kwargs) 

2521 

2522 __swig_destroy__ = _componentlist.delete_componentlist 

2523 __del__ = lambda self: None 

2524componentlist_swigregister = _componentlist.componentlist_swigregister 

2525componentlist_swigregister(componentlist) 

2526 

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

2528 

2529