About Chandra Archive Proposer Instruments & Calibration Newsletters Data Analysis HelpDesk Calibration Database NASA Archives & Centers Chandra Science Links

Skip the navigation links
Last modified: December 2006

URL: http://cxc.harvard.edu/ciao3.4/calcreateinfo.html
Hardcopy (PDF): A4 | Letter
AHELP for CIAO 3.4 calCreateInfo Context: caldb

Synopsis

Create a CALDB structure for use in other CALDB calls.

Syntax

Caldb_Type calCreateInfo()
Caldb_Type calCreateInfo( String_Type filename )

Error Return Value: NULL

Description

This routine creates a CALDB structure - returned as a Caldb_Type variable - which is then used in the other routines in the CALDB module. If no argument is given then a blank structure is returned. If an argument is given, then this is assumed to be the name of a file which the routine uses to fill in fields of the structure. The file used should normally be an event file, to make sure that all the required information is present, but other derived products - such as images - can be used. The list of keywords used is described in the "HEADER KEYWORDS" section after the examples.

You do not need to use this routine to query the calibration database. The calFindFile() routine can be called directly, by giving it all the information it requires. The calCreateInfo() routine is useful since:

  • it can be given the name of a file, rather than the specific details of an observation
  • the return value can be used in multiple calls to calFindFile()

Example 1

chips> require("caldb")
chips> cal = calCreateInfo()
chips> print( cal )
Caldb_Type

In this example we loaded the Caldb module and then called calCreateInfo() with no argument. This returned a variable of type Caldb_Type, whose contents can only be read or set using the other routines in the caldb module. As no argument was used when calling calCreateInfo() the resulting CALDB structure is empty, as shown below:

  chips> chips> calPrintInfo( cal )
  Telescope:      -
  Instrument:     -
  Detector:       -
  Filter:         -
  Start-Date:     now
  Start-Time:     00:00:00
  Expression:     -
  Data:

Example 2

chips> cal = calCreateInfo()
chips> calSetTelescope( cal, "Chandra" )
chips> calSetInstrument( cal, "ACIS" )
chips> calSetData( cal, "DET_GAIN" )
chips> gainfile = calFindFile( cal )

Here we use several routines from the caldb module to set fields in the CALDB structure, and then call calFindFile() to find the file from the database. For CALDB v2.27, the matching file is

$CALDB/data/chandra/acis/bcf/gain/acisD2000-08-12gainN0003.fits[AXAF_DETGAIN]

We can use the calPrintInfo() routine to see how the contents of the CALDB structure have changed compared to the previous example:

  chips> calPrintInfo( cal )
  Telescope:      Chandra
  Instrument:     ACIS
  Detector:       -
  Filter:         -
  Start-Date:     now
  Start-Time:     00:00:00
  Expression:     -
  Data:           DET_GAIN

Example 3

chips> cal = calCreateInfo( "evt2.fits" )
chips> calSetData( cal, "DET_GAIN" )
chips> gainfile = calFindFile( cal )

Here we let the calCreateInfo() routine find out the settings it needs from the header of the file evt2.fits. If this file was from a recent ACIS observation then the call to calFindFile() would return the same information as does the previous example.

HEADER KEYWORDS

Required keywords

When using a file to set up the CALDB structure, the following keywords must be present in its header: TELESCOP, INSTRUME, DATE-OBS, and DATE-END. If the DATE-OBS keyword does not contain the time (ie are not in "<date>T<time>" format) then the TIME-OBS keyword is also necessary. This also holds for DATE-END and TIME-END.

Optional keywords

The following keywords are optional: DETNAM and FILTER. If they are not present their value is taken to be "-".

Bugs

See the bugs page for the caldb library on the CIAO website for an up-to-date listing of known bugs.

Hardcopy (PDF): A4 | Letter
Last modified: December 2006



The Chandra X-Ray Center (CXC) is operated for NASA by the Smithsonian Astrophysical Observatory.
60 Garden Street, Cambridge, MA 02138 USA.    Email: cxcweb@head.cfa.harvard.edu
Smithsonian Institution, Copyright © 1998-2004. All rights reserved.