#!/usr/bin/perl
#

$ensemble_dir = "/w/wiyn/jan_2016/ensemble";

$target = "_v404cyg";
#$target = "_pg1633_";
$filter = "I";
$uc_filter = uc($filter);
$lc_filter = lc($filter);

$aper = "5";
$infile = sprintf "multi%s%s_%s.out", $target, $aper, $lc_filter;
$outfile = sprintf "solve%s%s_%s.out", $target, $aper, $lc_filter;
$sigfile = sprintf "solve%s%s_%s.sig", $target, $aper, $lc_filter;
$imgfile = sprintf "solve%s%s_%s.img", $target, $aper, $lc_filter;


  $cmd = "$ensemble_dir/solvepht infile=$infile outfile=$outfile imfile=$imgfile sigfile=$sigfile ";
  $cmd .= " niter=2 ";

#  $cmd .= " varmin=12 ";
      $cmd .= " varstar=98 ";       # the target
#      $cmd .= " varstar=482 varstar=964 varstar=900 varstar=655 ";    # sat
#      $cmd .= " varstar=41 varstar=70 varstar=684 varstar=759  ";
#      $cmd .= " varstar=507 varstar=834 varstar=40 ";

#  $cmd .= " badim=10 badim=11 badim=12 badim=13 ";
  $cmd .= " badim=0 ";

printf "%s\n", $cmd;
$retval = `$cmd`;
printf "retval is ..%s..\n", $retval;

exit 0;
