#! /bin/sh # This is the LHEA perl script: xsl_asca_sis_makeresp # The purpose of this special block is to make this script work with # the user's local perl, regardless of where that perl is installed. # The variable LHEAPERL is set by the initialization script to # point to the local perl installation. #------------------------------------------------------------------------------- eval ' if [ "x$LHEAPERL" = x ]; then echo "Please run standard LHEA initialization before attempting to run xsl_asca_sis_makeresp." exit 3 elif [ "$LHEAPERL" = noperl ]; then echo "During LHEA initialization, no acceptable version of Perl was found." echo "Cannot execute script xsl_asca_sis_makeresp." exit 3 elif [ `$LHEAPERL -v < /dev/null 2> /dev/null | grep -ic "perl"` -eq 0 ]; then echo "LHEAPERL variable does not point to a usable perl." exit 3 else exec $LHEAPERL -x $0 ${1+"$@"} fi ' if(0); # Do not delete anything above this comment from an installed LHEA script! #------------------------------------------------------------------------------- #! /usr/bin/perl $version ="1.10"; $date ="2002-11-28"; $author = "kaa"; # This script makes the ASCA SIS rmf and arf. It is run by the xselect # routine xsl_rspsav. # Check that we were given an input filename if(@ARGV < 1 || @ARGV > 2) { print "\n usage : xsl_asca_sis_makeresp infile extended?\n"; exit(0); } $infile = $ARGV[0]; $extended = "no"; if(@ARGV == 2 && $ARGV[1] eq "yes") { $extended = "yes"; } $dot = index($infile,"."); $rootname = substr($infile, 0, $dot); $rmffile = $rootname . ".rmf"; $arffile = $rootname . ".arf"; # run sisrmg to make the rmf $command = "sisrmg infile=$infile rmfile=$rmffile arfile=NONE"; print "\n",$command,"\n\n"; system($command); # run ascaarf to make the arf if ($extended eq "yes") { $command = "ascaarf phafile=$infile rmffile=$rmffile outfile=$arffile point=no"; } else { $command = "ascaarf phafile=$infile rmffile=$rmffile outfile=$arffile point=yes simple=yes"; } print "\n",$command,"\n\n"; system($command); # set the RESPFILE and ANCRFILE keywords in the spectrum to point to the # files that have been created $command = "fparkey value=$rmffile fitsfile=$infile\[SPECTRUM\] keyword=RESPFILE"; system($command); $command = "fparkey value=$arffile fitsfile=$infile\[SPECTRUM\] keyword=ANCRFILE"; system($command);