Synopsis
A record of the tools that were run, along with the parameter settings, on a file.
Description
Files created, or modified, by CIAO tools record the tool name and the parameter settings in the HISTORY section of the file. These records can be queried to find out these settings, which can be used to re-run a tool, perhaps on another file or to change a setting. This functionality complements the subspace information (ahelp subspace) which records what filters were applied to a file, whereas the history information records how the file was created or modified.
The history records are added by most CIAO tools, and many CIAO scripts, and can be queried with the dmhistory tool or with the following Crates routines from Python: add_record, get_all_records, get_comment_records, get_history_records, add_comment, delete_comments, add_history, delete_history, and print_history.
Examples
Example 1
unix% dmcopy "evt2.fits[sky=region(src.reg)][bin sky=::2]" img2.fits unix% dmhistory img2.fits dmcopy
List to the screen all the dmcopy records stored in the history header of img2.fits.
Example 2
unix% dmhistory src_grp.pi dmgroup action=pset unix% dmgroup src2.pi src2_grp.pi mode=h
Copy the dmgroup parameters used to create the file src_grp.pi file to the dmgroup parameter file (using action=pset). Run dmgroup with these settings (over-riding the infile and outfile values to apply them to a different file).
Example 3
>>> cr = pycrates.read_file('infile.fits') >>> history = cr.get_history_records()
Return a list of history entries from the file (using Crates to read in the file in Python).
Changes in CIAO 4.11
Crates now supports history records
Before CIAO 4.11, using Crates to read in a file and then write it out would cause the history information to be lost. Crates has also been updated with a range of routines to read and write these records.