IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Jul 14, 2021, 10:00:13 AM (5 years ago)
Author:
eugene
Message:

fix minor bugs, update output names for consistency

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tools/eam/teleff/diffmask.pro

    r41717 r41719  
    22
    33$VERBOSE    = 1       
    4 $COPYMASKS  = 1
     4$COPYMASKS  = 0
    55$OUTDIR     = .
    6 $OUTVERSION = XXX
     6if (not($?OUTVERSION))
     7  $OUTVERSION = XXX
     8end
    79
    810$DIFF_MODE_WW = 1
     
    5254  if ($VERBOSE) echo "loaded Rref[] sources from reference $refsrcs"
    5355
     56  # delete any existing output vectors
     57  foreach field $SMF_FIELDS_DIF $REF_FIELDS_DIF $XTR_FIELDS_DIF
     58    delete -q $field\_out
     59  end
     60
    5461  # find matching entries in cmf files and measure mask fraction
    5562  for i 0 $diffMask:n
     
    6774    end
    6875
    69    foreach field SMF_FIELDS_DIF
     76   foreach field $SMF_FIELDS_DIF
    7077     concat $field\_found $field\_out
    7178     delete $field\_found
    7279   end
    73    foreach field REF_FIELDS_DIF $XTR_FIELDS_DIF
     80   foreach field $REF_FIELDS_DIF $XTR_FIELDS_DIF
    7481     concat $field\_onchp $field\_out
    7582     delete $field\_onchp
     
    7885
    7986  $OUT_FIELDS =
    80   foreach field $SMP_FIELDS_DIF $REF_FIELDS_DIF $XTR_FIELDS_DIF
     87  foreach field $SMF_FIELDS_DIF $REF_FIELDS_DIF $XTR_FIELDS_DIF
    8188    $OUT_FIELDS = $OUT_FIELDS $field\_out
    8289  end
    8390
    84   sprintf output "%s/%s.%s.diff.stf" $OUTDIR $expname $OUTVERSION
     91  sprintf output "%s/%s.%s.dif.stf" $OUTDIR $expname $OUTVERSION
    8592  write -fits DATA $output $OUT_FIELDS
    8693end
     
    128135
    129136  # generate a subset of sources which are within the boundaries of the skycell
    130   set keep = (XrefS >= 0) && (XrefS <= $NAXIS1) && (YrefS >= 0) && (YrefS <= $NAXIS2)
     137  set keep = (Xref_tmp >= 0) && (Xref_tmp <= $NAXIS1) && (Yref_tmp >= 0) && (Yref_tmp <= $NAXIS2)
    131138  foreach field $REF_FIELDS_DIF Nref Xref Yref
    132139    subset $field\_onchp = $field\_tmp if keep
     
    201208 for i 0 $diffPath:n
    202209   sprintf filename "%s.mask.fits" $diffPath:$i
     210   break -auto off   
    203211   $diffMask:$i = `neb-locate -p $filename`
    204    if ($COPYMASKS) exec neb-copy $filename $OUTDIR
     212   break -auto on
     213   if ("$diffMask:$i" == "")
     214     echo "skipping $filename"
     215   else
     216     if ($COPYMASKS) exec neb-copy $filename $OUTDIR
     217   end
    205218
    206219   sprintf filename "%s.cmf" $diffPath:$i
     
    274287 
    275288 if ($npages < 1)
    276   echo "ERROR: missing exposure : $command"
     289  # try the template versoin
    277290  book delete mybook
    278   next
     291 
     292  $command = difftool -dbname $dbname -listrun -exp_name $expname -warp_id $warpID -diff_mode $diffMode -template
     293 
     294  queueload  myqueue -x "$command"
     295  queue2book myqueue mybook
     296 
     297  book npages mybook -var npages
     298 
     299  if ($npages < 1)
     300   echo "ERROR: missing exposure : $command"
     301   book delete mybook
     302   return
     303  end
    279304 end
    280305 
     
    282307  echo "ERROR: too many exposures : $command"
    283308  book delete mybook
    284   next
     309  return
    285310 end
    286311 
Note: See TracChangeset for help on using the changeset viewer.