#! /bin/sh # This is the LHEA perl script: /cvmfs/extras-fp7.egi.eu/extras/heasoft/suzaku/x86_64-unknown-linux-gnu-libc2.19-0/bin/aemkreg # 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 /cvmfs/extras-fp7.egi.eu/extras/heasoft/suzaku/x86_64-unknown-linux-gnu-libc2.19-0/bin/aemkreg." exit 3 elif [ "$LHEAPERL" = noperl ]; then echo "During LHEA initialization, no acceptable version of Perl was found." echo "Cannot execute script /cvmfs/extras-fp7.egi.eu/extras/heasoft/suzaku/x86_64-unknown-linux-gnu-libc2.19-0/bin/aemkreg." 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 # Force Perl into 32-bit mode (to match the binaries) if necessary: if [ "x$HD_BUILD_ARCH_32_BIT" = xyes ]; then if [ `$LHEAPERL -V 2> /dev/null | grep -ic "USE_64_BIT"` -ne 0 ]; then VERSIONER_PERL_PREFER_32_BIT=yes export VERSIONER_PERL_PREFER_32_BIT fi fi exec $LHEAPERL -x $0 ${1+"$@"} fi ' if(0); # Do not delete anything above this comment from an installed LHEA script! #------------------------------------------------------------------------------- #!/usr/bin/perl -w # # aemkreg by Ken Ebisawa (ebisawa@isas.jaxa.jp) # & Yoshitaka Ishisaki (ishisaki@phys.metro-u.ac.jp) # # version 1.0 2004-05-16 K.Ebisawa # # version 2.0 2005-11-15 K.Ebisawa # XIS and HXD FOV are drawn # # version 3.0 2005-11-15 K.Ebisawa # HXD-preference position is drawn # XRS FOV is commented out. # # version 4.0 2005-12-18 Y.ISHISAKI # renamed to "aemkreg" # add "-xis", "-hxd", "-xrs" options # # version 5.0 2006-02-20 Y.ISHISAKI # bug fix in the comment of euler angles, reported by T.Tamura (ISAS) # # version 6.0 2009-03-08 Y.ISHISAKI # fix HXD FOV centered on HXD nominal, draw FWHM & FULL for PIN, GSO # # version 6.1 2009-03-12 Y.ISHISAKI # fix HXD PIN/GSO FOV size, pointed out by K.Nakazawa (U-Tokyo) # $progname = "aemkreg"; $version = "6.1"; $deg2radian = 0.0174532925199433; $radian2deg = 57.2957795130823; $arcmin2radian = $deg2radian / 60; $HXD_XCEN = -3.5; $HXD_YCEN = 0.0; sub usage { print <[0][0]= cos($theta); $matrix1->[0][1]= -sin($theta); $matrix1->[0][2]= 0.0E0; $matrix1->[1][0]= sin($theta); $matrix1->[1][1]= cos($theta); $matrix1->[1][2]= 0.0E0; $matrix1->[2][0]= 0.0E0; $matrix1->[2][1]= 0.0E0; $matrix1->[2][2]= 1.0E0; $matrix2->[0][0]= cos($delta); $matrix2->[0][1]= 0.0E0; $matrix2->[0][2]= sin($delta); $matrix2->[1][0]= 0.0E0; $matrix2->[1][1]= 1.0E0; $matrix2->[1][2]= 0.0E0; $matrix2->[2][0]= -sin($delta); $matrix2->[2][1]= 0.0E0; $matrix2->[2][2]= cos($delta); $matrix3->[0][0]= cos($alpha); $matrix3->[0][1]= -sin($alpha); $matrix3->[0][2]= 0.0E0; $matrix3->[1][0]= sin($alpha); $matrix3->[1][1]= cos($alpha); $matrix3->[1][2]= 0.0E0; $matrix3->[2][0]= 0.0E0; $matrix3->[2][1]= 0.0E0; $matrix3->[2][2]= 1.0E0; $_[3]=$matrix1; $_[4]=$matrix2; $_[5]=$matrix3; } sub multi_matrix{ my(@invect,$matrix,@outvect,$i,$j); $invect[0] =$_[0]; $invect[1] =$_[1]; $invect[2] =$_[2]; $matrix =$_[3]; for($i=0;$i<=2;$i++){ $outvect[$i]=0.0; for($j=0;$j<=2;$j++){ $outvect[$i] = $outvect[$i]+$matrix->[$i][$j]*$invect[$j]; } } $_[4]=$outvect[0]; $_[5]=$outvect[1]; $_[6]=$outvect[2]; } sub asin { atan2($_[0], sqrt(1 - $_[0] * $_[0])) } sub tan2alphadelta{ my(@outvect3,$alpha,$delta); $outvect3[0]=$_[0]; $outvect3[1]=$_[1]; $outvect3[2]=$_[2]; if($outvect3[0]==0.0E0){ if($outvect3[1]==0.0E0){ $alpha = 0.0E0; } elsif($outvect3[1] > 0.0){ $alpha= 90.0E0; } else{ $alpha= -90.0E0; } } else{ $alpha = atan2($outvect3[1],$outvect3[0])*$radian2deg; } if ($alpha<0.0){ $alpha = $alpha + 360.0E0; } if(abs($outvect3[2]) > 1.0) { print "Error!\n"; print "argument of asin below -1 or above 1\n"; print "argument of asin',$outvect3[2]<\n"; exit(0); } $delta = &asin($outvect3[2])*$radian2deg; $_[3]=$alpha; $_[4]=$delta; } # ;;; Local Variables: *** # ;;; mode:Perl *** # ;;; tab-width:8 *** # ;;; End: ***