IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Dec 12, 2006, 11:58:21 PM (20 years ago)
Author:
eugene
Message:

added global logdirs, VERBOSE output, failure tracking

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/ippTasks/detrend.reject.pro

    r10542 r10692  
    1313## STATE DET_ID ITER TYPE
    1414
    15 queueinit DetrendRejectExposure
     15queueinit DetrendRejectExp
    1616if ($?network == 0)
    1717  $network = 1
     
    2121end
    2222
     23$DetrendRejectExpFail = 0
     24
     25if ($?VERBOSE == 0)
     26  echo "VERBOSE not defined: load pantasks.pro first"
     27  break
     28end
     29if ($?LOGDIR == 0)
     30  echo "LOGDIR not defined: load pantasks.pro first"
     31  break
     32end
     33$LOGSUBDIR = $LOGDIR/detrend
     34exec mkdir -p $LOGSUBDIR
     35
     36macro detreject.status
     37  queueprint DetrendRejectExp
     38  echo "DetrendRejectExpFail: $DetrendRejectExpFail"
     39end
     40
    2341# select images ready for copy
    24 # new entries are added to queue DetrendRejectExposure
     42# new entries are added to queue DetrendRejectExp
    2543# compare the new list with the ones already selected
    2644task           dettool.reject.load
    27   command      dettool -residdetrun -simple
    2845  host         local
    2946
     
    3249  periods      -timeout 30
    3350
    34   stdout dettool.reject.log
    35   stderr dettool.reject.log
     51  stdout $LOGSUBDIR/dettool.reject.log
     52  stderr $LOGSUBDIR/dettool.reject.log
     53
     54  task.exec
     55    command dettool -residdetrun -simple -limit {$DetrendRejectExpFail + 20}
     56  end
    3657
    3758  # success
     
    4465    for i 0 $Nqueue
    4566      queuepop stdout -var line
     67      if ($VERBOSE > 2)
     68        echo $line
     69      end
    4670      list word -split $line
    4771      $DET_ID   = $word:0
     
    5074      $MODE     = $word:3
    5175      $CAMERA   = $word:4
    52       queuepush DetrendRejectExposure -uniq -key 1:2 "NEW $DET_ID $ITER $DET_TYPE $MODE $CAMERA"
     76      queuepush DetrendRejectExp -uniq -key 1:2 "NEW $DET_ID $ITER $DET_TYPE $MODE $CAMERA"
    5377    end
    5478
    5579    # delete existing entries which are DONE
    56     queuedrop DetrendRejectExposure -key 0 DONE
     80    queuedrop DetrendRejectExp -key 0 DONE
    5781  end
    5882
    5983  # locked list
    6084  task.exit    default
    61     echo       "detrend.reject: failure"
     85    if ($VERBOSE)
     86      echo       "detrend.reject: failure"
     87    end
    6288  end
    6389
    6490  # operation times out?
    6591  task.exit    timeout
    66     echo       "detrend.reject: timeout"
     92    if ($VERBOSE)
     93      echo       "detrend.reject: timeout"
     94    end
    6795  end
    6896end
     
    75103
    76104  task.exec
    77     queuesize DetrendRejectExposure -var N
     105    queuesize DetrendRejectExp -var N
    78106    if ($N == 0) break
    79107    if ($network == 0) break
    80108   
    81     # look for new images on the internal DetrendRejectExposure queue
     109    # look for new images on the internal DetrendRejectExp queue
    82110    # caution with these 'if' statements: syntax errors
    83111    # will make the task fail without given a good status
    84     queuepop DetrendRejectExposure -var line -key 0 NEW
     112    queuepop DetrendRejectExp -var line -key 0 NEW
    85113    if ("$line" == "NULL") break
    86114
    87115    strpop line state
    88     queuepush DetrendRejectExposure -replace -key 1:2 "RUN $line"
     116    queuepush DetrendRejectExp -replace -key 1:2 "RUN $line"
    89117
    90     ## the DetrendRejectExposure queue contains:
     118    ## the DetrendRejectExp queue contains:
    91119    ## STATE DET_ID ITER TYPE
    92120    ## NOTE: the queue has the STATE prepended
     
    98126
    99127    # I'd like to add CAMERA to the log file...
    100     stdout $CAMERA.$DET_TYPE.$DET_ID.$ITER.log
    101     stderr $CAMERA.$DET_TYPE.$DET_ID.$ITER.log
     128    stdout $LOGSUBDIR/$CAMERA.$DET_TYPE.$DET_ID.$ITER.log
     129    stderr $LOGSUBDIR/$CAMERA.$DET_TYPE.$DET_ID.$ITER.log
    102130
    103131    # specify choice of remote host:
     
    110138    # create example job options as a demonstration
    111139    options "$line"
    112     echo command detrend_reject_exp.pl --det_id $DET_ID --iteration $ITER --det_type $DET_TYPE --camera $CAMERA
     140    if ($VERBOSE > 1)
     141      echo command detrend_reject_exp.pl --det_id $DET_ID --iteration $ITER --det_type $DET_TYPE --camera $CAMERA
     142    end
    113143    command detrend_reject_exp.pl --det_id $DET_ID --iteration $ITER --det_type $DET_TYPE --camera $CAMERA
    114144 end
     
    116146  # success
    117147  task.exit 0
    118     queuepush DetrendRejectExposure -replace -key 1:2 "DONE $options:0"
     148    queuepush DetrendRejectExp -replace -key 1:2 "DONE $options:0"
    119149  end
    120150
    121151  # default exit status
    122152  task.exit    default
    123     queuepush DetrendRejectExposure -replace -key 1:2 "FAIL $options:0"
     153    if ($VERBOSE)
     154      echo "failure detrend_reject_exp.pl $options:0"
     155    end
     156    queuepush DetrendRejectExp -replace -key 1:2 "FAIL $options:0"
     157    $DetrendRejectExpFail ++
    124158  end
    125159
    126160  # operation times out?
    127161  task.exit    timeout
    128     queuepush DetrendRejectExposure -replace -key 1:2 "TIMEOUT $options:0"
     162    if ($VERBOSE)
     163      echo "failure detrend_reject_exp.pl $options:0"
     164    end
     165    queuepush DetrendRejectExp -replace -key 1:2 "TIMEOUT $options:0"
     166   $DetrendRejectExpFail ++
    129167  end
    130168end
Note: See TracChangeset for help on using the changeset viewer.