Last modified: December 2022

URL: https://cxc.cfa.harvard.edu/ciao/ahelp/calvalid.html
AHELP for CIAO 4.16

calvalid

Context: Tools::CALDB

Synopsis

Validate index file of calibration database (CALDB) products.

Syntax

calvalid index keyconf caldb [--rmv_dupl y] [--rec_offln y]
[--rmv_inval y] [--add_miss y] [--verbose #]

Description

calvalid validates the CALDB index file (CIF). The validation process is conducted through three steps:

If no changes are made, calvalid reports that the validation passed; e.g.

calvalid:
  Index, './data/chandra/acis/caldb.indx', is validated and passed.

Otherwise, the tool reports that the file was updated and writes out the new index:

calvalid:
  Index, '/user/CALDB/caldb.indx', is validated and updated.
  The updated file is saved to './caldb.indx.upd' .

Examples

Example 1

calvalid /soft/ciao/CALDB/data/chandra/acis/caldb.indx
/soft/ciao/CALDB/data/chandra/acis/key.conf /soft/ciao/CALDB

A basic example of running calvalid on the ACIS directory of the Chandra CALDB. The "caldb.indx" file to be validated and the key config file ("key.conf") are both located in the /soft/ciao/CALDB/data/chandra/acis/ directory. The CALDB root is "/soft/ciao/CALDB".

Example 2

calvalid caldb.indx key.conf /soft/ciao/CALDB --rmv_dupl yes

The input file, "caldb.indx", is the index to be validated in conjunction with key config file, "key.conf". The "caldb" is the CALDB root pointing to "/soft/ciao/CALDB" directory. This example sets "--rmf_dupl yes" with an interactive mode only on "duplicate" situation but others defauts ("no").

Example 3

calvalid caldb.indx.inv key.config /soft/ciao/CALDB --rmv_dupl yes
--rec_offln y

This example is similar to the previous one, except another interactive mode is on ("--rec_offln y"). Note that a shorter value, "y", is used here and is valid to all other optinal arguments. The CAL_DEV entry of a row will be updated with "OFFLINE" if the calfile is inaccessible.

Example 4

calvalid caldb.indx.inv key.config /soft/ciao/CALDB --rmv_dupl y
--rec_offln y --rmv_inval y

The validation adds one more user's interaction on "--rmv_inval y". To check the entries of an individual row, the assembled calfile of a row is used in creating an index prototype along with the key config file. The prototype then serves back as a reference to the current row of the parent index. The entries of the current row of the index are checked against those of rows of the prototype. If the row of the index does not match any rows of the prototype, calvalid issues the warning "invalid entry". The tool removes the infected row, after prompting the user for confirmation.

Example 5

calvalid caldb.indx.inv key.config /soft/ciao/CALDB --rmv_dupl y
--rec_offln y --rmv_inval y --add_miss y

The example adds user interaction with "--add_miss y". If a row is missing in the CIF, calvalid notifies the user and prompts whether it should be added.


Parameters

name type ftype def min max reqd
index file input       yes
keyconf file input       yes
caldb string         yes
--rmv_dupl boolean   no      
--rec_offln boolean   no      
--rmv_inval boolean   no      
--add_miss boolean   no      
--verbose integer   0 0 5  

Detailed Parameter Descriptions

Parameter=index (file required filetype=input)

Input CALDB index file

A CALDB Index file created through "calindex" tool or an equivalent method. It should be conform to CALDB Standards of the latest Version 4. The FITS binary file has an extension named after "CIF", Calibration Index File. The index table contains the CALDB mandatory columns and the CALDB optional columns. The CIF may also have additional columns defined in key config file; see "keyconf" parameter description.

If the parameter value is not set, it defaults to "./caldb.indx".

The original CIF is not modified. If changes are required, an updated file named "<filename>.upd" is written to the working directory.

Parameter=keyconf (file required filetype=input)

Input key config file

An ASCII file containing rows of parameters with space-separated attributes. This should be the same key config file used in creating the CALDB index file. The named parameters in the key config file define optional columns of the index. calvalid checks that the CIF and key config files are consistent.

If the parameter value is not set, it defaults to "./key.conf".

Parameter=caldb (string required)

CALDB root path

A string which points to the root of calibration installation, e.g. "/soft/data/CALDB".

If the parameter value is not set, it defaults to the environment variable "CALDB".

Parameter=--rmv_dupl (boolean default=no)

Delete duplicate rows?

The prefix, "--", to "rmv_dupl" is an optional tag, followed by the value of the parameter. This parameter determines whether duplicated rows in the index should be deleted. If set to "yes" or "y", the tool will query the user for confirmation before deleting the row. Otherwise for default (to "no"), the tool issues a warning about the duplicate row but doesn't delete it.

Parameter=--rec_offln (boolean default=no)

Mark inaccessible files as "OFFLINE"?

This parameter determines whether the CAL_DEV entry of a row is updated with the value "OFFLINE" because the calfile is apparently inaccessible. If set to "yes", the tool will query the user for confirmation before updating the value. Otherwise, the tool issues a warning about the inaccessible file but doesn't change the CAL_DEV value.

Parameter=--rmv_inval (boolean default=no)

Delete rows with invalid entries?

This parameter determines whether invalid rows in the index should be deleted. If set to "yes", the tool will query the user for confirmation before deleting the row. Otherwise, the tool issues a warning about the invalid row but doesn't delete it.

Parameter=--add_miss (boolean default=no)

Add missing rows?

This parameter determines whether missing rows should be appending to the index file. Missing rows may be prototype rows which do not match the current index. If set to "yes", the tool will query the user for confirmation before adding the row at the end of the CIF. Otherwise, the tool issues a warning about the missing row but doesn't add it.

Parameter=--verbose (integer default=0 min=0 max=5)

Verbosity level of terminal display information to user.

There is no output message for default but more details printed out in ascending levels.


Bugs

There are no known bugs for this tool.

See Also

calibration
ardlib, caldb
tools::caldb
calindex, calmerge, calquiz
tools::utilities
check_ciao_caldb