[CIG-SEISMO] Want more details of movie2gif.pl

胡元鑫 huanduh at gmail.com
Thu Sep 30 11:02:41 PDT 2010


Dear all,

I am not familiar with Perl. So, I did not understand some lines of
the Perl script movie2gif.pl. These lines are listed as follows:

if ($tran_to_gmt) {
  print "Transfer the movie data files to gmt xyz files \n";
  system("$bin/xcreate_movie_GMT_basin . $start $end . > movie.log");
  if ($? != 0) {die("Error create movie xyz files\n"); }
  (@junk) = split(" ", `grep '^ DT' movie.log`); $dt = $junk[2];
  (@junk) = split(" ", `grep '^NTSTEP_BETWEEN_FRAMES' DATA/Par_file`);
$nframe = $junk[2];
} else {
  if (not -f "movie.log") {die(" Check if movie log file exist or not\n");}
  (@junk) = split(" ", `grep '^ DT' movie.log`); $dt = $junk[2];
  (@junk) = split(" ", `grep '^NTSTEP_BETWEEN_FRAMES' DATA/Par_file`);
$nframe = $junk[2];
}
# figure out the maximum value
(@junk) = split(" ", `grep 'maximum absolute value' movie.log`);
$max = $junk[-1] / $fac_max;
print " The maximum value of all frames is : $max \n";

In above codes, I want more details about how to get the max value of
all frames or the meaning of $junk[-1], $junk[2] and @junk. Many
thanks.

Hu Yuan-xin

2010-10-1


More information about the CIG-SEISMO mailing list