Coverage for /wheeldirectory/casa-6.7.0-12-py3.10.el8/lib/py/lib/python3.10/site-packages/casatasks/imhistory.py: 56%
27 statements
« prev ^ index » next coverage.py v7.6.4, created at 2024-10-31 17:39 +0000
« prev ^ index » next coverage.py v7.6.4, created at 2024-10-31 17:39 +0000
1##################### generated by xml-casa (v2) from imhistory.xml #################
2##################### bb68db34e36ca4abbe694ff07ec721b1 ##############################
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_imhistory import imhistory as _imhistory_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
14class _imhistory:
15 """
16 imhistory ---- Retrieve and modify image history
19 Retrieve and modify image history.
21 This task provides access to the logtable of an image, where generally
22 history information is stored. Two operation modes are supported. When
23 mode="list", the history messages are returned as an array of
24 strings. If verbose=True, this information is also written to the
25 logger. When mode="append", a specified message (along with its
26 specified origin) are appended to the logtable and True is returned if
27 successful.
29 --------- parameter descriptions ---------------------------------------------
31 imagename Name of the input (CASA or FITS) image
32 Default: none
34 Example: imagename='ngc5921.im'
35 mode Operating mode.
36 Default: 'list' (retrieve history)
37 Options: 'list|append' ('append' to append a
38 record to history)
39 verbose Write history to logger if mode="list"?
40 Subparameter of mode='list'
41 Default: True
42 Options: True|False
43 origin Origin of appended message.
44 Subparameter of mode='append'
45 Default: 'imhistory'
47 The user can specify any string. This string will
48 appear as a tag at the start of the appended line
49 in the image history. Only used for mode="append".
50 message Message to append.
51 Subparameter of mode='append'
52 Default: none
54 Only used of mode="append".
55 [1;42mRETURNS[1;m variant
57 --------- examples -----------------------------------------------------------
60 FOR MORE INFORMATION, SEE THE TASK PAGES OF IMHISTORY IN CASA DOCS:
61 https://casa.nrao.edu/casadocs/
64 """
66 _info_group_ = """information,analysis"""
67 _info_desc_ = """Retrieve and modify image history"""
69 def __call__( self, imagename='', mode='list', verbose=True, origin='imhistory', message='' ):
70 schema = {'imagename': {'type': 'cReqPath', 'coerce': _coerce.expand_path}, 'mode': {'type': 'cStr', 'coerce': _coerce.to_str}, 'verbose': {'type': 'cBool'}, 'origin': {'type': 'cStr', 'coerce': _coerce.to_str}, 'message': {'type': 'cStr', 'coerce': _coerce.to_str}}
71 doc = {'imagename': imagename, 'mode': mode, 'verbose': verbose, 'origin': origin, 'message': message}
72 assert _pc.validate(doc,schema), create_error_string(_pc.errors)
73 _logging_state_ = _start_log( 'imhistory', [ 'imagename=' + repr(_pc.document['imagename']), 'mode=' + repr(_pc.document['mode']), 'verbose=' + repr(_pc.document['verbose']), 'origin=' + repr(_pc.document['origin']), 'message=' + repr(_pc.document['message']) ] )
74 task_result = None
75 try:
76 task_result = _imhistory_t( _pc.document['imagename'], _pc.document['mode'], _pc.document['verbose'], _pc.document['origin'], _pc.document['message'] )
77 except Exception as exc:
78 _except_log('imhistory', exc)
79 raise
80 finally:
81 task_result = _end_log( _logging_state_, 'imhistory', task_result )
82 return task_result
84imhistory = _imhistory( )