#!/usr1/local/bin/perl ########################################################################### # Change the Coordinate system # # v.0.1: 08/15/07 K. Hamaguchi # v.0.2: 08/17/07 K. Hamaguchi, Put 0.0 on TCRVL10 and TCRVL11 # ########################################################################### if($ARGV[0] eq "-h"){ print "This script puts 0.0 on the sky coordinate reference keywords (TCRVL10, TCRVL11) of event files in the current directory. The event file name has to be ae*.evt. You have to uncompress the event files before running this script.\n"; print " Usage: chcoord.pl\n"; die "If you have the file \"evtlist.txt\" in the current directory, you have to remove it.\n"; } $X_REF = 0.0; $Y_REF = 0.0; $EVENTFILELIST = "evtlist.txt"; if (-e $EVENTFILELIST){ die "File \"$EVENTFILELIST\" exists.\n"; } shellcom("ls ae*.evt > $EVENTFILELIST"); open(YOME, "<$EVENTFILELIST") || die "$EVENTFILELIST was not created"; while (){ chomp; $EVTFILE = "$_"."[1]"; shellcom("fparkey $X_REF $EVTFILE TCRVL10"); shellcom("fparkey $Y_REF $EVTFILE TCRVL11"); } unlink($EVENTFILELIST) || warn "having trouble deleting $EVENTFILELIST.\n"; sub shellcom { print "$_[0]\n"; system("$_[0]"); }