findRMFΒΆ

findRMF is used for finding the corresponding response matrix file from event file.

Input: .evt event file name

Output: .rmf response matrix file name

Example:

./findRMF
Please input the FITS filename:
sw00271019000xpcw2po_cl.evt
: Warning: cannot read 'XRTVSUB' keyword in file 'sw00271019000xpcw2po_cl.evt'
: Warning: using default value '0'
: Info: CallQuzcif: Running quzcif SWIFT XRT - - matrix 2007-03-18 07:37:09 "datamode.eq.photon.and.grade.eq.G0:12.and.XRTVSUB.eq.0" retrieve+ clobber=yes
CallQuzcif: Info: Output 'quzcif' Command:
CallQuzcif: Info:/Applications/heasoft/CALDB_LOCAL/data/swift/xrt/cpf/rmf/swxpc0to12s0_20070101v012.rmf   1

Source code:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
#!/usr/bin/perl

require "libswxrt.pl";
use File::Copy;

# Task info

our %Task = (
    name        => 'findRMF',
    version     => '0.2',
    releasedate => "2016-03-13",
    chatter     => 2,
    status      => 0,
    errmess     => '',
    stem        => '',
    author      => 'Y.Wang',
);

# Initial

my $isCopy = 0;    # 0 is no, 1 is yes.

# Main #

return 0 if $Task{status};

## read parameter
my $filename = $ARGV[0] if ( $ARGV[0] );

unless ( defined $filename ) {
    &PrntChty( 1, "Please input the FITS filename (eg. sw00271019000xwtw2po_cl.evt):\n" );
    chomp( $filename = <STDIN> );
}

## get response matrix file
&GetRmfFile($filename);

&Error if $Task{status};

## copy rmf file to current folder
$copied = copy( $rmfFilename, "./" ) if $rmfFilename and $isCopy;
&PrntChty( 2, "\nRMF file has been copied to current folder.\n" ) if $copied;