NAME
cgbm_findrmf - Find and optionally retrieve from the CGBM CALDB the appropriate RMF files for specific time, position (RA and DEC), detector, gain and attitude file.
USAGE
cgbm_findrmf datetime ra dec attfile outfile
DESCRIPTION
The CALET Gamma Ray Burst Monitor (CGBM) on CALET is composed of two hard X-ray
detectors (HXM1 and HXM2) and a soft Gamma-ray detector (SGM) detectors, collecting data
in high and low gain with a large field of view. The experiment is located on the
International Space Station (ISS).
A library of responses have been generated and placed in CALDB. The responses are
for each of the detector (HXM1, HXM2 and SGM), gain and positions, express in polar
coordinates theta and phi with a resolution of 5 degree for each coordinates.
The filename of the responses are in the form of :
cgbm_det_thxxx_phyyy_xg_20000101v001.rmf
where
- det is set to 'sgm' or 'hx1' or 'hx2' to specify the detector
- xxx and yyy are three digits to specify the angles (e.g 085 is 85 deg)
- xg is to 'lg' or 'hg' to specify the low and high gain
The script locates in CALDB and optionally retrive, the appropriate RMF file based upon
the input time, position (RA and DEC), detector, gain and ISS attitude. The RMF may be
retrived for ALL detectors or a specific detector (see parameter 'detector') as well as
for ALL gain or specific gain (see parameter 'gain').
The script matches the input time to the closer time in the attitude file to locate
the appropriate quaterian. The polar coordinates are calculated from the input RA/DEC,
the quaternian from the attitude, the location of CALET on the ISS and the location of
the detectors respect to CALET.
The polar coordinates, detector and gain are used to query CALDB and retrive the names
of all RMFs that satisfy these conditions. For each detector and gain the final RMF is
choosen among the closer to the polar coordinates and written in the parameter file
(see parameters 'thetahxm' , 'phihxm' , 'thetasgm', 'phisgm', 'rmfhx1h', 'rmfhx1l',
'rmfhx2h', 'rmfhx2l', 'rmfsgmh', 'rmfsgml')
If the parameter 'output' is specified, the information of the calculation as well as
the location and RMF filename are written in the outfile file.
If the parameter 'download' is set to 'yes', the RMF are retrived from CALDB and placed in
the directory where the script is run.
CALDB must be pre-defined to run the script. If not, the script will not provide
or retrive the the RMF but writes out the polar coordinates for each of the requested
detectors.
PARAMETERS
- datetime [string]
- The UTC input time of the event/observation. in ISO format (YYYY-MM-DDTHH:mm:ss).
- ra [real]
- Right ascension value in degrees.
- dec [real]
- Declination value in degrees.
- attfile [filename]
- Name of input ISS attitude file (*.iat).
- outfile [filename]
- The name of the output text file where is recorded the RMF filenames for each
detector, gain and polar coordinates. If NONE or blank no output is written
- detector [string]
- Detector on CGBM. Allowed values are : SGM,HXM1,HXM2, or ALL. If set to ALL (default)
RMF are the three detectors.
- gain [string]
- High or low gain used for observation. HIGH, LOW, or ALL. Default: ALL
- (timetoler=15) [integer]
- Time tolerance in seconds used in matching the input datetime parameter with the time written in the
ISS attitude file. Default = 15.
- (download= no) [boolean]
- Download the RMF files from CALDB in the current directory (yes/[no]).
If set to 'yes' the RMF files are copied in the current directory. Default is 'no'.
- (chatter)
- Control the amount of screen output from the code. Currently not used.
- (thetahxm)
- Result of the script calculation: theta angle value for the HXM1 and HXM2 detectors.
- (phihxm)
- Result of the script calculation : phi angle value for the HXM1 and HXM2 detectors.
- (thetasgm)
- Result of the script calculation : theta angle value for the SGM detector
- (phisgm)
- Result of the script calculation : phi angle value for the SGM detector.
- (rmfhx1h)
- Result of the script calculation : name and location of the HXM1 high gain RMF
- (rmfhx2h)
- Result of the script calculation : name and location of the HXM2 high gain RMF
- (rmfhx1l)
- Result of the script calculation : name and location of the HXM1 low gain RMF
- (rmfhx2l)
- Result of the script calculation : name and location of the HXM2 low gain RMF
- (rmfsgmh)
- Result of the script calculation : name and location of the SGM high gain RMF
- (rmfsgml)
- Result of the script calculation : name and location of the SGM low gain RMF
- (clobber = no) [boolen]
-
If the output file already exists, then setting "clobber = yes" will cause it to be overwritten.
- (mode = ql) [string ql|hl|q]
- Mode to query the parameter file.
Acceptable values include: "ql (query and learn/remember), "hl" (hidden and learn/remember), "q" (query but don't remember), "h" (hidden).(Optional)
EXAMPLE
1. Find the RMFs for all detectors and gains for the input time, ra, dec and attitude and write the result in an output file .
cgbm_findrmf datetime='2015-10-06T09:54:60' ra='147.4256' dec='70.5036' attfile='cgbm_20151006.iat.gz' output='alldet_allgain' detector='ALL' gain='ALL '
2. Find and Retrieve the RMF for only the low gain SGM detector
cgbm_findrmf datetime='2016-08-21T20:36:21.911' ra='171.248' dec='42.343' attfile= 'cgbm_20160821.iat.gz' ouput='sgm_low.txt' detector='SGM' gain='LOW' download=yes'
SEE ALSO
LAST MODIFIED
June 2023