# -------------- System variables my $currentdir = getcwd(); my $logdir = "Logs"; my $outdir = "Windoutput"; my $specdir = "Specfiles"; my $animdir = "Animfiles"; # -------------- End system variables # -------------- Main program variables my $framenumber = 1; my $frameplot; my $emin=300; my $emax=13000; my $xmin = log10($emin/1000); my $xmax = log10($emax/1000); my $ymin = log10(6E2); my $ymin2 = log10(2E4); my $ymax = log10(6E6); my $filename; # -------------- Prompted Variables print " Please enter number of frames (default = 100): "; my $nframes = ; chomp $nframes; $nframes = 100 if ($nframes eq ""); print " Processing frame:\n "; # -------------- Main program loop until ($framenumber>$nframes) { print "${framenumber}: "; $filename = "$animdir/frame_00${framenumber}.gif/gif" if ($framenumber<10); $filename = "$animdir/frame_0${framenumber}.gif/gif" if (($framenumber>9) and ($framenumber<100)); $filename = "$animdir/frame_${framenumber}.gif/gif" if $framenumber>99; print "$filename\n"; $frameplot = PDL::Graphics::PGPLOT::Window->new(Device => $filename, AxisColour => 'black', Font => 'Roman', WindowXSize => 8 , WindowYSize => 9.23, HardLW => 4); $frameplot = PDL::Graphics::PGPLOT::Window->new(Device => '/xs', AxisColour => 'black', Font => 'Roman', WindowXSize => 8 , WindowYSize => 9.23) if ($debug_level==1); # Prepare space for transmitted spectrum plot $frameplot->env($xmin,$xmax,$ymin,$ymax, { PlotPosition => [0.06, 0.99, 0.06, 0.639], Charsize => 0.8, Axis => 'LogXY', Xtitle => 'Energy (keV)', Ytitle => 'E L\dE\u [erg(erg/s/erg)]', }); my ($energy, $trans) = rcols "$animdir/${framenumber}_trans_spect.txt", {LINES => '4:-1'}; my ($junk, $emit) = rcols "$animdir/${framenumber}_emit_spect.txt", {LINES => '4:-1'}; my ($incenergy, $inclumin) = rcols "${xscortpath}/powerlaw.dat", {LINES => '2:-1'}; my $plotmask = which(($incenergy>$emin) & ($incenergy<$emax)); my $x = $incenergy->dice($plotmask); my $y = $inclumin->dice($plotmask); $frameplot->line(log10($x/1000), log10($y*1.60217646E-12*$x), {Colour => 'black'}); $plotmask = which(($energy>$emin) & ($energy<$emax)); $x = $energy->dice($plotmask); $y = $trans->dice($plotmask); $frameplot->line(log10($x/1000), log10($y*1.60217646E-12*$x), {Colour => 'blue'}); $y = $emit->dice($plotmask); $frameplot->line(log10($x/1000), log10($y*1.60217646E-12*$x), {Colour => 'red'}); $frameplot->env($xmin,$xmax,$ymin2,$ymax, { PlotPosition => [0.06, 0.99, 0.639, 0.99], Charsize => 0.8, Axis => ['BCSTL','BCNSTL'], Ytitle => 'E L\dE\u [erg(erg/s/erg)]', }); $plotmask = which(($incenergy>$emin) & ($incenergy<$emax)); $x = $incenergy->dice($plotmask); $y = $inclumin->dice($plotmask); $frameplot->line(log10($x/1000), log10($y*1.60217646E-12*$x), {Colour => 'black'}); $y = ($emit+$trans)->dice($plotmask); $frameplot->line(log10($x/1000), log10($y*1.60217646E-12*$x), {Colour => 'dark green'}); if ($debug_level==1) { print "Press return to continue..."; my $pause = ; } $frameplot->close(); $framenumber++; }