Table of Contents

Class: FtuFtt FtuFtt.py

The class handles FTT (FITS Translation Table) files which are used by the FITS Translation Tool for doing processing of the FITS headers of FITS files.

It is posible to load and save FTT files, and to manipulate their contents.

For further information about the issue of FTTs, consult the URL: http://archive.eso.org/ftu.

Methods   
__handlePccKeyList
__init__
addAction
addDicRec
addDicRef
addIncludeRef
dumpBuf
execute
getActionList
getActionNo
getActionsSameKey
getDicRecList
getDicRef
getDicRefList
getFilePathAction
getFileRenameAction
getFileSplitAction
getHdrDump
getIncludeRef
getIncludeRefList
getNoOfActions
getNoOfDicRefs
getNoOfIncludeRefs
load
save
setActionList
setDicRecList
setDicRefList
setHdrDump
setIncludeRefList
  __handlePccKeyList 
__handlePccKeyList (
        self,
        list,
        key,
        parameter,
        classMethod,
        )

Private method to handle the conversion from a list of strings (or partially consisting of strings), to contain only PccKey objects.

list: Source list to be checked and possible converted.

key: The keyword for the PccKey object, e.g. "INCLUDE" or "DICTIONARY".

parameter: Name of the input parameter of the method calling this method, referring to the list.

classMethod: Name of the class + method from where this method is called.

Returns: Converted/checked list of PccKey objects.

Exceptions   
exceptions.Exception

  __init__ 
__init__ ( self )

Constructor method initializing the class variables.

  addAction 
addAction ( self,  fttActionObj )

Add a Translation Action in the object.

fttActionObj: Reference to the Translation Action object (FtuFttAction).

Returns: Reference to the objct itself.

  addDicRec 
addDicRec ( self,  dicRec )

Add a FtuFttDicRec object to the class.

dicRec: Reference to the FtuFttDicRec object.

Returns: Reference to the object itself.

  addDicRef 
addDicRef ( self,  dicRef )

Add a reference to an included DID. This can be added either as a string or as a PccKey object.

dicRef: Referece to PccKey object or string containing the information about the included DID.

Returns: Reference to object itself.

  addIncludeRef 
addIncludeRef ( self,  includeRef )

Add a reference to an included FTT. This can be added either as a string or as a PccKey object.

includeRef: Referece to PccKey object or string containing the information about the included FTT.

Returns: Reference to object itself.

  dumpBuf 
dumpBuf ( self )

Dump the contents of the object into a string buffer.

Returns: Generated buffer with the keywords of the FTT.

  execute 
execute (
        self,
        fileList,
        fttName="",
        logFile="",
        logLevel=0,
        tolerant=0,
        force=0,
        test=0,
        noStat=0,
        noChecksum=0,
        noHistory=0,
        noComment=1,
        overwrite=0,
        targetDir="",
        targetFile="",
        skipFileOnError=0,
        timeOut=-1,
        )

Execute the FTU with the FTT contained in this object.

fileList: List of files to process. Should be given in the format: "<file> <file> <file> ...".

fttName: Name of the FTT which is generated by the class and used as input to the FTU. If set to "" a name will be generated.

logFile: Name of a log file if desriable that produces log output into a file. Note, the Log Level should be set with the parameter "logLevel".

logLevel: The intensity with which FTU should produce log output (0..5, 5 is the most intensive).

tolerant: Run the FTU in Tolerant Mode ignoring certain errors (0|1).

force: Force the translation of a FITS file, even though it has already been translated by the FTU with the same FTT (0|1).

test: Generate test target files, i.e. FITS files with "_test" appended to the name (0|1).

noStat: Don't generate statistics for the images in the FITS file(s) (0|1).

noChecksum: Don't generate and write the CHECKSUM in the FITS files (0|1).

noHistory: Don't generate HISTORY entries for modifications introduced in the FITS headers (0|1).

noComment: Don't write the FTU COMMENT indicating that this FITS file was translated by the FTU with the given FTT (0|1).

overwrite: Overwrite target files even if they exist. Normally if not specified, if a target file exists, the first free index (4 digit number) is found and appended to the target filenames (0|1).

targetDir: Name of Target Directory. This overwrites a possible definition of this in the FTT.

targetFile: Base name of target file. This overwrites a possible definition of this in the FTT.

skipFileOnError: Indicates to skip a file if an error occurs (0|1).

timeOut: Timeout to apply when translating the file. A timeout of "-1" indicates that no timeout should be used.

Returns: Void.

Exceptions   
exceptions.Exception

  getActionList 
getActionList ( self )

Return reference to internal Action List.

Returns: Reference to internal Action List.

  getActionNo 
getActionNo ( self,  no )

Return a specific Translation Action according to its number.

no: Number of Translation Action in object. First key is number 0.

Returns: A PccKey object for the requested keyword.

  getActionsSameKey 
getActionsSameKey (
        self,
        action,
        key,
        )

Return a list with PccKey objects for the same type of Translation Actions manipulating a specific key (maybe in different headers).

action: Translation Action Type.

key: Name of the key to look for.

  getDicRecList 
getDicRecList ( self )

Return reference to the list containing the FtuFttDicRec objects.

Returns: Reference to list with the FtuFttDicRec objects.

  getDicRef 
getDicRef ( self,  no )

Return a specific reference to an included DID.

no: Number (index) of the specific DID (first has number 0).

Returns: PccKey object with the information about the included DID.

  getDicRefList 
getDicRefList ( self )

Return reference to the internal list with included DIDs. See also setDicRefList().

Returns: Reference to list with included DIDs.

  getFilePathAction 
getFilePathAction ( self )

Return reference to the File Path Action object (FtuFttFilePath object).

Returns: Reference to the internal FtuFttFilePath Action object.

  getFileRenameAction 
getFileRenameAction ( self )

Return reference to the File Rename Action object (FtuFttFileRename object).

Returns: Reference to the internal FtuFttFileRename Action object.

  getFileSplitAction 
getFileSplitAction ( self )

Return reference to the File Split Action object (FtuFttFileSplit object).

Returns: Reference to the internal FtuFttFileSplit Action object.

  getHdrDump 
getHdrDump ( self )

Return reference to the Header Dump PccKey object.

Returns: Reference to Header Dump PccKey object.

  getIncludeRef 
getIncludeRef ( self,  no )

Return a specific reference to an included FTT.

no: Number (index) of the specific FTT (first has number 0).

Returns: PccKey object with the information about the included FTT.

  getIncludeRefList 
getIncludeRefList ( self )

Return reference to the internal list with included FTTs. See also setIncludeRefList().

Returns: Reference to list with included FTTs.

  getNoOfActions 
getNoOfActions ( self )

Return the number of Translation Actions contained in the object.

Returns: Number of Translation Actions (integer).

  getNoOfDicRefs 
getNoOfDicRefs ( self )

Return the number of included DIDs.

Returns: Number of included DIDs.

  getNoOfIncludeRefs 
getNoOfIncludeRefs ( self )

Return the number of included FTTs.

Returns: Number of included FTTs.

  load 
load ( self,  fttFileName )

Loads an FTT PAF file into this instance of the FttFtu class.

fttFileName: Complete name of the FTT file to load.

Returns: Reference to object itself.

Exceptions   
exceptions.Exception

  save 
save ( self,  targetFttName )

Save the FTT keywords contained in the object into the referenced FTT (PAF) file.

targetFttName: Filename of FTT to generate (complete path).

Returns: Reference to the object itself.

  setActionList 
setActionList ( self,  actionList )

Make the internal list of FtuFttAction objects refer to a new, externally generated list.

actionList: Refers to list of FtuFttAction objects.

Returns: Reference to object itself.

  setDicRecList 
setDicRecList ( self,  dicRecList )

Set the list referring to the DID records defined in the FTT. The "dicRecList" is a list containing FtuFttDicRec objects.

dicRecList: List containing the FtuFttDicRec objects.

Returns: Reference to object itself.

  setDicRefList 
setDicRefList ( self,  dicRefList )

Set the list referring to the included DIDs. If there is already referred to a list, the contents of the old list is forgotten.

dicRefList: Reference to list containing PccKey objects where the key is set to "DICTIONARY" and the key value to the FTT to include. It is also possible to give in a list of strings with the names of the DIDs to include. This will then be converted to PccKey objects internally.

Returns: Reference to object itself.

  setHdrDump 
setHdrDump ( self,  hdrDump )

Set the Header Dump Action. This can either be as a string ("NEWLINE", "NO_NEWLINE"), or as a PccKey object with key set to "HDR.DUMP" and one of the values listed previously.

hdrDump: PccKey object or string with the information about the Header Dump Action.

Returns: Reference to object itself.

Exceptions   
exceptions.Exception

  setIncludeRefList 
setIncludeRefList ( self,  includeRefList )

Set the list referring to the included FTTs. If there is already referred to a list, the contents of the old list is forgotten.

includeRefList: Reference to list containing PccKey objects where the key is set to "INCLUDE" and the key value to the FTT to include. It is also possible to give in a list of strings with the names of the files to include. This will then be converted to PccKey objects internally.

Returns: Reference to object itself.


Table of Contents

This document was automatically generated on Thu Feb 22 17:08:59 2001 by HappyDoc version r1_3