#!/usr/bin/perl
#

$cmd = "median ";
$first = 1;
$last = 10;
$outfile="dark15.fts";

$n = $first;
while ($n <= $last) {
  $number = sprintf("dark15.%03d", $n);
  $cmd = $cmd . " $number ";
  $n = $n + 1;
}

# used to use "iqm" option here ...
$cmd = $cmd . " outfile=$outfile nomean verbose ";

printf "cmd is $cmd\n";
$result = `$cmd`;
printf "result of median is ..$result..\n";

$nframes = ($last - $first) + 1;
$datestr = `date`;
$comment = "median of $nframes dark frame, created $datestr";
$result  = `comment $outfile $comment`;
printf "result of comment is ..$result..\n";


exit 0;
  
