Usage for unwrapCasaCommandLog

Return to directory of Todd's CASA extensions

Takes an ASCII file and unwraps the long lines (without breaking words) and writes a new file. This is useful for reformatting the casa_commands.log generated by the pipeline.

Usage:

import analyzemscal as amc
amc.unwrapCasaCommandLog(mylog, width=80, newlog='', strippath=False, maxlines=-1):
  • mylog: the full path to the casa log file to be processed
  • width: the character width parameter passed to textwrap.wrap()
  • newlog: (optional) name of output file
  • strippath: if True, then cull the leading directories and put a cd command at top
  • maxlines: how many lines to convert (for debugging purposes only)

Example:

CASA <3>: import analyzemscal as amc
CASA <4>: amc.unwrapCasaCommandLog('pipeline-20130131T050552/html/casa_commands.log')
New file left in: pipeline-20130131T050552/html/casa_commands.log.txt

-- ToddHunter - 2013-01-31

This topic: ALMA > TWikiUsers > ToddHunter > CasaExtensions > UnwrapCasaCommandLog
Topic revision: 2013-06-17, ToddHunter
This site is powered by FoswikiCopyright © by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding NRAO Public Wiki? Send feedback