Coverage for /wheeldirectory/casa-6.7.0-12-py3.10.el8/lib/py/lib/python3.10/site-packages/casatasks/importfitsidi.py: 89%

27 statements  

« prev     ^ index     » next       coverage.py v7.6.4, created at 2024-11-01 07:19 +0000

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

2##################### fedf829bc2603c34a92fe21c2ceaee4a ############################## 

3from __future__ import absolute_import 

4import numpy 

5from casatools.typecheck import CasaValidator as _val_ctor 

6_pc = _val_ctor( ) 

7from casatools.coercetype import coerce as _coerce 

8from casatools.errors import create_error_string 

9from .private.task_importfitsidi import importfitsidi as _importfitsidi_t 

10from casatasks.private.task_logging import start_log as _start_log 

11from casatasks.private.task_logging import end_log as _end_log 

12from casatasks.private.task_logging import except_log as _except_log 

13 

14class _importfitsidi: 

15 """ 

16 importfitsidi ---- Convert a FITS-IDI file to a CASA visibility data set 

17 

18  

19 Convert a FITS-IDI file to a CASA visiblity data set. 

20 If several files are given, they will be concatenated into one MS. 

21 

22 --------- parameter descriptions --------------------------------------------- 

23 

24 fitsidifile Name(s) of input FITS-IDI file(s) 

25 Default: none (must be supplied) 

26  

27 Examples:  

28 fitsidifile='3C273XC1.IDI' 

29 fitsidifile=['3C273XC1.IDI1','3C273XC1.IDI2'] 

30 vis Name of output visibility file 

31 Default: none 

32  

33 Example: outputvis='3C273XC1.ms' 

34 constobsid If True, give constant obs ID==0 to the data from all 

35 input fitsidi files (False = separate obs id for each file) 

36 Default: False (new obs id for each input file) 

37 Options: False|True 

38 scanreindexgap_s Min time gap (seconds) between integrations to start a 

39 new scan 

40 Default: 0. (no reindexing) 

41  

42 If > 0., a new scan is started whenever the gap 

43 between two integrations is > the given value 

44 (seconds) or when a new field starts or when the 

45 ARRAY_ID changes. 

46 specframe This frame will be used to set the spectral reference 

47 frame for all spectral windows in the output MS 

48 Default: GEO (geocentric) 

49 Options: GEO|TOPO|LSRK|BARY 

50  

51 NOTE: if specframe is set to TOPO, the reference 

52 location will be taken from the Observatories 

53 table in the CASA data repository for the given 

54 name of the observatory. You can edit that table 

55 and add new rows. 

56 

57 --------- examples ----------------------------------------------------------- 

58 

59  

60 FOR MORE INFORMATION, SEE THE TASK PAGES OF IMPORTFITSIDI IN CASA DOCS: 

61 https://casa.nrao.edu/casadocs/ 

62  

63 

64 

65 """ 

66 

67 _info_group_ = """import/export""" 

68 _info_desc_ = """Convert a FITS-IDI file to a CASA visibility data set""" 

69 

70 def __call__( self, fitsidifile=[ ], vis='', constobsid=False, scanreindexgap_s=float(0.), specframe='GEO' ): 

71 schema = {'fitsidifile': {'type': 'cReqPathVec', 'coerce': [_coerce.to_list,_coerce.expand_pathvec]}, 'vis': {'type': 'cStr', 'coerce': _coerce.to_str}, 'constobsid': {'type': 'cBool'}, 'scanreindexgap_s': {'type': 'cFloat', 'coerce': _coerce.to_float}, 'specframe': {'type': 'cStr', 'coerce': _coerce.to_str}} 

72 doc = {'fitsidifile': fitsidifile, 'vis': vis, 'constobsid': constobsid, 'scanreindexgap_s': scanreindexgap_s, 'specframe': specframe} 

73 assert _pc.validate(doc,schema), create_error_string(_pc.errors) 

74 _logging_state_ = _start_log( 'importfitsidi', [ 'fitsidifile=' + repr(_pc.document['fitsidifile']), 'vis=' + repr(_pc.document['vis']), 'constobsid=' + repr(_pc.document['constobsid']), 'scanreindexgap_s=' + repr(_pc.document['scanreindexgap_s']), 'specframe=' + repr(_pc.document['specframe']) ] ) 

75 task_result = None 

76 try: 

77 task_result = _importfitsidi_t( _pc.document['fitsidifile'], _pc.document['vis'], _pc.document['constobsid'], _pc.document['scanreindexgap_s'], _pc.document['specframe'] ) 

78 except Exception as exc: 

79 _except_log('importfitsidi', exc) 

80 raise 

81 finally: 

82 task_result = _end_log( _logging_state_, 'importfitsidi', task_result ) 

83 return task_result 

84 

85importfitsidi = _importfitsidi( ) 

86