FITS Translation Utility
|
||||||
The FITS Translation Utility (for short FTU), is a tool used to manipulate FITS files. One example of its usage, is at the telescope site where the FITS files produced by the instruments often need to have minor corrections introduced. A more typical usage however, might be astronomers who want to translate FITS files received from ESO, to adapt them to a specific context.
Some of the features provided in this release are:
Definition of the translation batch in a simple ASCII format (PAF format) in the so-called FTTs (FITS Translation Tables).
Inclusion of FTTs into other FTTs to obtain reusability.
Manipulation of FITS files using the FITS image extension. The way to address the individual extensions in the file is straightforward and simple.
Adding of keywords.
Changing values of existing keywords.
Renaming of keywords.
Moving of keywords from one extension to another.
Copying of keywords from one source key/header to another, or within the same header.
Removing lists of keywords using wildcards.
Execution of Internal and External Conversion Functions to convert the value or a set of values which is assigned to a key. The External Conversion Functions allows the user to implement his own Conversion Functions and 'plug' them into the tool.
Splitting of FITS files using the FITS Image Extension into single files.
Extraction of header information into ASCII files with or without adding a newline character after each keyword card.
Renaming of filenames.
Computation of statistics for each image extension found in the files and writing of the corresponding FITS keywords in the appropriate header. The statistics generated is: Minimum Pixel Value, Maximum Pixel Value, Sum of Pixel Values, Mean Value of Pixels, Median of Pixel Values and RMS of Pixel Values.
Computation of a CHECKSUM for the files, and writing of this in the primary FITS header.
Recording HISTORY of changes introduced in each header.
Marking files already changed with a special COMMENT and check of presence of this comment before translating files to avoid unexpected results.
Generation of log output in a file or on stdout + adjustment of log levels.
Although it is possible to operate the tool without the availability of Data Interface Dictionaries, it is preferable to make definitions available for new keywords added in the FITS files. This can either be done by referring to the appropriate Dictionaries in the FTT, or by specifying directly in the FTT the records for the keys.
There is a current plan to update the tool with more features. Users are welcome to propose features which might then be accepted and implemented. However, if a feature is needed which is specific to a user's context, usually this can be implemented using the concept of the External (Plug-In) Conversion Functions.
Since a normal FTT in PAF format is a pretty static definition, an API for managing FTTs within Python is provided. This makes it possible to make use of all Python constructs (loops, if statements, expressions, ...) to build up an FTT. This opens up for many possibilities for creating 'dynamic FTTs', and can even in some cases simplify FTTs as for instance for files using the FITS extension, it is often necessary to repeat the same Translation Actions for each header which is tedious. An FTT generated in Python programmatically, can either be executed within the FtuFtt Python class, or the contents can be dumped to a file and the FTU invoked 'manually' as done normally.
The following classes are provided to facilitate the creation and manipulation of FTTs within Python:
Class/Module
|
Description
|
FtuFtt | This is the main class used to contain the contents of an FTT. Methods are provided to load and save FTTs. It is possible to add and remove the various building blocks of the FTT from within this class. It is also possible to execute the FTT on a set of given files. |
FtuFttDefs | This module contains various definitions used when programming Python FTTs. |
FtuFttDicRec | Class used to handle the contents of an FTT Dictionary Record. |
FtuFttValueSrc | Class used to handle the information for an FTT Value Source indicating from where to take a value. |
FtuFttAction | This class is used to handle the Translation Actions: Add, Change, Rename, Move, Copy and Remove. |
FtuFttFilePath | Class to handle the parameters in connection with a File Path Definition. |
FtuFttFileRename | Class to handle the parameters in connection with a File Rename Definition. |
FtuFttFileSplit | Class to handle the parameters in connection with a File SplitDefinition |
For the complete and detailed documentation of the FTU FTT Python API, click here: FTU FTT Python API.
To download a Beta release of the FTU FTT Python API classes and pertinent files please contact: Jens Knudstrup (the FTU FTT API is not yet oficially released).
For an example of how an FTT can be build up in a Python script and executed click here: Python FTT Example.
For further information, download the FTU User Manual.
DISCLAIMER: Although the FTU tool has undergone thorough testing and is being intensively used around the ESO sites, no responsibility is taken from ESO's side should the usage of the tool produce improperly formatted FITS files. It is always advisable before using the FTU tool in a production system, to carefully test and verify that it performs correctly in the given context.
To download a statically linked version of the tool select the links below. A template FTT is included in the tar file which can be used as a starting point for building up FTTs. All tar files are GZIP'ed:
Send
comments to <Jens.Knudstrup@eso.org> |
|