Create a CALDB structure for use in other CALDB calls.
Caldb_Type calCreateInfo()
Caldb_Type calCreateInfo( String_Type filename )
Error Return Value: NULL
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()
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:
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
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.
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.
The following keywords are optional: DETNAM and FILTER.
If they are not present their value is taken to be "-".
- caldb
-
calcreateinfo,
calfindfile,
calgetdata,
calgetdate,
calgetdetector,
calgeterror,
calgetfilter,
calgetinstrument,
calgetquery,
calgettelescope,
calgettime,
calprintinfo,
calsetdata,
calsetdate,
calsetdetector,
calsetexpression,
calsetfilter,
calsetinstrument,
calsettelescope,
calsettime
- modules
-
caldb
|