|
|
|
|
SynopsisCreate a CALDB structure for use in other CALDB calls. SyntaxCaldb_Type calCreateInfo() Caldb_Type calCreateInfo( String_Type filename ) Error Return Value: NULL DescriptionThis 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:
The caldb module is not available by default; to use it in a S-Lang program, it must be loaded using the S-Lang require() function: require("caldb");Example 1
slsh> require("caldb");
slsh> cal = calCreateInfo();
slsh> print( cal );
Caldb_TypeIn 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: slsh> calPrintInfo( cal ); Telescope: - Instrument: - Detector: - Filter: - Start-Date: now Start-Time: 00:00:00 Expression: - Data: Example 2slsh> cal = calCreateInfo(); slsh> calSetTelescope( cal, "Chandra" ); slsh> calSetInstrument( cal, "ACIS" ); slsh> calSetData( cal, "DET_GAIN" ); slsh> 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. We can use the calPrintInfo() routine to see how the contents of the CALDB structure have changed compared to the previous example: slsh> calPrintInfo( cal ); Telescope: Chandra Instrument: ACIS Detector: - Filter: - Start-Date: now Start-Time: 00:00:00 Expression: - Data: DET_GAIN Example 3slsh> cal = calCreateInfo( "evt2.fits" ); slsh> calSetData( cal, "DET_GAIN" ); slsh> 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 KEYWORDSRequired keywordsWhen 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 keywordsThe following keywords are optional: DETNAM and FILTER. If they are not present their value is taken to be "-". BugsSee the bugs page for the caldb library on the CIAO website for an up-to-date listing of known bugs. See Also
|
![]() |
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. |