#!/usr/bin/perl
#
# Create animated GIFs from individual GIF graphs we've already made
#

$debug = 1;


# earth-time simultaneity, 2500 - 2518
$cmd = "gifsicle --delay=80 simul_earth_[01]?.0.gif > simul_earth_a_anim.gif";
$ret = exec_cmd($cmd);


# earth-time simultaneity, 2530 - 2548
$cmd = "gifsicle --delay=80 simul_earth_[34]?.0.gif > simul_earth_b_anim.gif";
$ret = exec_cmd($cmd);


# earth-time simultaneity, 2560 - 2566
$cmd = "gifsicle --delay=80 simul_earth_[6]?.0.gif > simul_earth_c_anim.gif";
$ret = exec_cmd($cmd);


# red-ship-time simultaneity, 2500 - 2518
$cmd = "gifsicle --delay=80 simul_red_[01]?.0.gif > simul_red_a_anim.gif";
$ret = exec_cmd($cmd);






exit 0;


##############################################################################
# PROCEDURE: exec_cmd
#
# DESCRIPTION: Execute the given shell command line.  If the $debug flag
#              is set, we print to stdout the command line, and
#              also print out the result string.
#
# RETURNS:
#              the result of the command
#
#
sub exec_cmd {

  my($cmd, $ret);

  $cmd = $_[0];

  if ($debug > 0) {
    printf "cmd is ..$cmd.. \n";
  }
  $ret = `$cmd`;
  if ($debug > 0) {
    printf "ret is ..$ret.. \n";
  }

  return($ret);
}


