#! /opt/local/bin/perl -P ;# Usage: l1km [yymmddhh] ;# where yymmddhh is given in UT ;# #include "/home/stormy/marka/perlutil/changetime.pl"; #include "/home/stormy/marka/perlutil/expandtime.pl"; $| = 1; if( ($pos = rindex($0, "/")) >= $[ ) { $command = substr($0, $pos+1); } else { $command = $0; } $duration = 6; # Default value $timestep = 1; # Default value $ARGV[0] =~ m#([^/]*)/?([^/]*)/?([^/]*)#; $end = $1; if( $2 ) { $duration = $2; } if( $3 ) { $timestep = $3; } if( $timestep < 1 ) { $timestep = 1; } $dir = "/usr/local/ldm/images/" . substr($command, 1); # when $end equals current time subtract 26 minutes $end = &expandtime( $end, 1560. ); $begin = &changetime( $end, -1 * $duration ); # print "$duration---$timestep\n$begin--$end\n"; for( $time=$end; $time>=$begin; ) { if( -e "$dir/$time.gif" ) { $looptimes = "$dir/$time.gif " . $looptimes; $time = &changetime( $time, -1 * $timestep ); } else { $time = &changetime( $time, -1 ); } } # print "$looptimes\n\n"; exit 0; $xloopdir = "/home/disk/stormy/marka/X/xloop"; if( $looptimes =~ m#^([/\w\.]+) (([/\w\.]+ )*)([/\w\.]+) $# ) { $time_first = $1; $looptimes = $2; $time_last = $4; print "To exit loop use Shift-middle button ..."; system( "$xloopdir/xloop -nsc -dwell 120 -in $time_first $looptimes $time_last" ); # system("xanim -geom +100+100 +Ca +Sr +j2000 $time_first +j100 $looptimes +j2000 $time_last 2>/dev/null"); print "\n\n"; } else { print "Insufficient images available to loop.\n"; } exit 0;