IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 10692 for trunk/ippTasks


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

added global logdirs, VERBOSE output, failure tracking

Location:
trunk/ippTasks
Files:
6 edited

Legend:

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

    r9506 r10692  
    22## this file contains the tasks for running the detrend normalization stage
    33
    4 ## these tasks use the queue DetrendNormalize
    5 ## the DetrendNormalize queue contains:
     4## these tasks use the queue DetrendNorm
     5## the DetrendNorm queue contains:
    66## STATE DET_ID ITER
    77
    8 queueinit DetrendNormalize
     8queueinit DetrendNorm
    99queueinit DetrendNormStat
    10 queueinit DetrendNormalizeExposures
     10queueinit DetrendNormExp
    1111if ($?network == 0)
    1212  $network = 1
     
    1414if ($?parallel == 0)
    1515  $parallel = 0
     16end
     17
     18$DetrendNormFail = 0
     19$DetrendNormStatFail = 0
     20$DetrendNormExpFail = 0
     21
     22if ($?VERBOSE == 0)
     23  echo "VERBOSE not defined: load pantasks.pro first"
     24  break
     25end
     26if ($?LOGDIR == 0)
     27  echo "LOGDIR not defined: load pantasks.pro first"
     28  break
     29end
     30$LOGSUBDIR = $LOGDIR/detrend
     31exec mkdir -p $LOGSUBDIR
     32
     33macro detnorm.status
     34  queueprint DetrendNorm
     35  queueprint DetrendNormStat
     36  queueprint DetrendNormExp
     37  echo "DetrendNormFail: $DetrendNormFail"
     38  echo "DetrendNormStatFail: $DetrendNormStatFail"
     39  echo "DetrendNormExpFail: $DetrendNormExpFail"
    1640end
    1741
     
    2044# compare the new list with the ones already selected
    2145task           dettool.normstat.load
    22   command      dettool -tonormalizedstat -simple
    2346  host         local
    2447
     
    2750  periods      -timeout 30
    2851
    29   stdout dettool.normstat.log
    30   stderr dettool.normstat.log
     52  stdout $LOGSUBDIR/dettool.normstat.log
     53  stderr $LOGSUBDIR/dettool.normstat.log
     54
     55  task.exec
     56    command      dettool -tonormalizedstat -simple -limit {$DetrendNormStatFail + 20}
     57  end
    3158
    3259  # success
     
    4168    for i 0 $Nqueue
    4269      queuepop stdout -var line
     70      if ($VERBOSE > 2)
     71        echo $line
     72      end
    4373      list word -split $line
    4474      $DET_ID   = $word:0
     
    5686  # default exit status
    5787  task.exit    default
    58     echo       "detrend.norm: failure"
    59   end
    60 
    61   # operation times out?
    62   task.exit    timeout
    63     echo       "detrend.norm: timeout"
     88    if ($VERBOSE)
     89      echo       "detrend.norm: failure"
     90    end
     91  end
     92
     93  # operation times out?
     94  task.exit    timeout
     95    if ($VERBOSE)
     96      echo       "detrend.norm: timeout"
     97    end
    6498  end
    6599end
     
    73107  task.exec
    74108    queuesize DetrendNormStat -var N
    75    
    76109    if ($N == 0) break
    77110    if ($network == 0) break
     
    95128
    96129    # XXX add $WORKDIR/$LOG_DIR
    97     stdout $CAMERA.$DET_TYPE.$DET_ID.$ITER.log
    98     stderr $CAMERA.$DET_TYPE.$DET_ID.$ITER.log
     130    stdout $LOGSUBDIR/$CAMERA.$DET_TYPE.$DET_ID.$ITER.log
     131    stderr $LOGSUBDIR/$CAMERA.$DET_TYPE.$DET_ID.$ITER.log
    99132
    100133    # specify choice of remote host:
     
    107140    # create example job options as a demonstration
    108141    options "$line"
    109     echo command detrend_norm_calc.pl --det_id $DET_ID --iteration $ITER --det_type $DET_TYPE
     142    if ($VERBOSE > 1)
     143      echo command detrend_norm_calc.pl --det_id $DET_ID --iteration $ITER --det_type $DET_TYPE
     144    end
    110145    command detrend_norm_calc.pl --det_id $DET_ID --iteration $ITER --det_type $DET_TYPE
    111146  end
     
    118153  # default exit status
    119154  task.exit    default
     155    if ($VERBOSE)
     156      echo "failure detrend_norm_calc.pl $options:0"
     157    end
    120158    queuepush DetrendNormStat -replace -key 1:3 "FAIL $options:0"
    121   end
    122 
    123   # operation times out?
    124   task.exit    timeout
     159    $DetrendNormStatFail ++
     160  end
     161
     162  # operation times out?
     163  task.exit    timeout
     164    if ($VERBOSE)
     165      echo "failure detrend_norm_calc.pl $options:0"
     166    end
    125167    queuepush DetrendNormStat -replace -key 1:3 "TIMEOUT $options:0"
     168   $DetrendNormStatFail ++
    126169  end
    127170end
    128171
    129172# select images ready for copy
    130 # new entries are added to queue DetrendNormalize
     173# new entries are added to queue DetrendNorm
    131174# compare the new list with the ones already selected
    132175task           dettool.norm.load
    133   command      dettool -tonormalize -simple
    134176  host         local
    135177
     
    138180  periods      -timeout 30
    139181
    140   stdout dettool.norm.log
    141   stderr dettool.norm.log
     182  stdout $LOGSUBDIR/dettool.norm.log
     183  stderr $LOGSUBDIR/dettool.norm.log
     184
     185  task.exec
     186    command      dettool -tonormalize -simple -limit {$DetrendNormFail + 20}
     187  end
    142188
    143189  # success
     
    152198    for i 0 $Nqueue
    153199      queuepop stdout -var line
     200      if ($VERBOSE > 2)
     201        echo $line
     202      end
    154203      list word -split $line
    155204      $DET_TYPE = $word:0
     
    160209      $CLASS_ID = $word:5
    161210      $NORM     = $word:6
    162       queuepush DetrendNormalize -uniq -key 4:5 "NEW $DET_TYPE $CAMERA $URI $DET_ID $ITER $CLASS_ID $NORM"
     211      queuepush DetrendNorm -uniq -key 4:5 "NEW $DET_TYPE $CAMERA $URI $DET_ID $ITER $CLASS_ID $NORM"
    163212    end
    164213
    165214    # delete existing entries which are DONE
    166     queuedrop DetrendNormalize -key 0 DONE
     215    queuedrop DetrendNorm -key 0 DONE
    167216  end
    168217
     
    170219  # default exit status
    171220  task.exit    default
    172     echo       "detrend.norm: failure"
    173   end
    174 
    175   # operation times out?
    176   task.exit    timeout
    177     echo       "detrend.norm: timeout"
     221    if ($VERBOSE)
     222      echo       "detrend.norm: failure"
     223    end
     224  end
     225
     226  # operation times out?
     227  task.exit    timeout
     228    if ($VERBOSE)
     229      echo       "detrend.norm: timeout"
     230    end
    178231  end
    179232end
     
    186239
    187240  task.exec
    188     queuesize DetrendNormalize -var N
    189    
     241    queuesize DetrendNorm -var N
    190242    if ($N == 0) break
    191243    if ($network == 0) break
    192244   
    193     # look for new images on the internal DetrendNormalize queue
     245    # look for new images on the internal DetrendNorm queue
    194246    # caution with these 'if' statements: syntax errors
    195247    # will make the task fail without given a good status
    196     queuepop DetrendNormalize -var line -key 0 NEW
     248    queuepop DetrendNorm -var line -key 0 NEW
    197249    if ("$line" == "NULL") break
    198250
    199251    strpop line state
    200     queuepush DetrendNormalize -replace -key 4:5 "RUN $line"
    201 
    202     # the DetrendNormalize queue contains:
     252    queuepush DetrendNorm -replace -key 4:5 "RUN $line"
     253
     254    # the DetrendNorm queue contains:
    203255    # STATE DET_ID ITER
    204256    list word -split $line
     
    211263    $NORM     = $word:6
    212264
    213     $LOG_DIR = `dirname $URI`
    214 
    215     stdout $WORKDIR/$LOG_DIR/$CAMERA.$DET_TYPE.$DET_ID.$ITER.log
    216     stderr $WORKDIR/$LOG_DIR/$CAMERA.$DET_TYPE.$DET_ID.$ITER.log
     265    stdout $LOGSUBDIR/$CAMERA.$DET_TYPE.$DET_ID.$ITER.log
     266    stderr $LOGSUBDIR/$CAMERA.$DET_TYPE.$DET_ID.$ITER.log
    217267
    218268    # specify choice of remote host:
     
    225275    # create example job options as a demonstration
    226276    options "$line"
    227     echo command detrend_norm_apply.pl --det_id $DET_ID --iteration $ITER --class_id $CLASS_ID --value $NORM --input_uri $URI --camera $CAMERA --det_type $DET_TYPE
     277    if ($VERBOSE > 1)
     278      echo command detrend_norm_apply.pl --det_id $DET_ID --iteration $ITER --class_id $CLASS_ID --value $NORM --input_uri $URI --camera $CAMERA --det_type $DET_TYPE
     279    end
    228280    command detrend_norm_apply.pl --det_id $DET_ID --iteration $ITER --class_id $CLASS_ID --value $NORM --input_uri $URI --camera $CAMERA --det_type $DET_TYPE
    229281  end
     
    231283  # success
    232284  task.exit 0
    233     queuepush DetrendNormalize -replace -key 4:5 "DONE $options:0"
    234   end
    235 
    236   # default exit status
    237   task.exit    default
    238     queuepush DetrendNormalize -replace -key 4:5 "FAIL $options:0"
    239   end
    240 
    241   # operation times out?
    242   task.exit    timeout
    243     queuepush DetrendNormalize -replace -key 4:5 "TIMEOUT $options:0"
     285    queuepush DetrendNorm -replace -key 4:5 "DONE $options:0"
     286  end
     287
     288  # default exit status
     289  task.exit    default
     290    if ($VERBOSE)
     291      echo "failure detrend_norm_apply.pl $options:0"
     292    end
     293    queuepush DetrendNorm -replace -key 4:5 "FAIL $options:0"
     294    $DetrendNormFail ++
     295  end
     296
     297  # operation times out?
     298  task.exit    timeout
     299    if ($VERBOSE)
     300      echo "failure detrend_norm_apply.pl $options:0"
     301    end
     302    queuepush DetrendNorm -replace -key 4:5 "TIMEOUT $options:0"
     303    $DetrendNormFail ++
    244304  end
    245305end
    246306
    247307# select images ready for copy
    248 # new entries are added to queue DetrendNormalizeExposures
     308# new entries are added to queue DetrendNormExp
    249309# compare the new list with the ones already selected
    250310task           dettool.normexp.load
    251   command      dettool -tonormalizedexp -simple
    252311  host         local
    253312
     
    256315  periods      -timeout 30
    257316
    258   stdout dettool.normexp.log
    259   stderr dettool.normexp.log
     317  stdout $LOGSUBDIR/dettool.normexp.log
     318  stderr $LOGSUBDIR/dettool.normexp.log
     319
     320  task.exec
     321    command      dettool -tonormalizedexp -simple -limit {$DetrendNormExpFail + 20}
     322  end
    260323
    261324  # success
     
    270333    for i 0 $Nqueue
    271334      queuepop stdout -var line
     335      if ($VERBOSE > 2)
     336        echo $line
     337      end
    272338      list word -split $line
    273339      $DET_ID   = $word:0
     
    278344      #$EXP_TYPE = $word:5
    279345      #$IMFILES  = $word:6
    280       queuepush DetrendNormalizeExposures -uniq -key 1:2 "NEW $DET_ID $ITER $DET_TYPE $CAMERA"
     346      queuepush DetrendNormalizeExp -uniq -key 1:2 "NEW $DET_ID $ITER $DET_TYPE $CAMERA"
    281347    end
    282348
    283349    # delete existing entries which are DONE
    284     queuedrop DetrendNormalizeExposures -key 0 DONE
     350    queuedrop DetrendNormExp -key 0 DONE
    285351  end
    286352
     
    288354  # default exit status
    289355  task.exit    default
    290     echo       "detrend.norm: failure"
    291   end
    292 
    293   # operation times out?
    294   task.exit    timeout
    295     echo       "detrend.norm: timeout"
     356    if ($VERBOSE)
     357      echo       "detrend.norm: failure"
     358    end
     359  end
     360
     361  # operation times out?
     362  task.exit    timeout
     363    if ($VERBOSE)
     364      echo       "detrend.norm: timeout"
     365    end
    296366  end
    297367end
     
    304374
    305375  task.exec
    306     queuesize DetrendNormalizeExposures -var N
     376    queuesize DetrendNormExp -var N
    307377   
    308378    if ($N == 0) break
    309379    if ($network == 0) break
    310380   
    311     # look for new images on the internal DetrendNormalizeExposures queue
     381    # look for new images on the internal DetrendNormExp queue
    312382    # caution with these 'if' statements: syntax errors
    313383    # will make the task fail without given a good status
    314     queuepop DetrendNormalizeExposures -var line -key 0 NEW
     384    queuepop DetrendNormExp -var line -key 0 NEW
    315385    if ("$line" == "NULL") break
    316386
    317387    strpop line state
    318     queuepush DetrendNormalizeExposures -replace -key 1:2 "RUN $line"
    319 
    320     # the DetrendNormalizeExposures queue contains:
     388    queuepush DetrendNormExp -replace -key 1:2 "RUN $line"
     389
     390    # the DetrendNormExp queue contains:
    321391    # STATE DET_ID ITER
    322392    list word -split $line
     
    330400
    331401    # XXX add $WORKDIR/$LOG_DIR
    332     stdout $CAMERA.$DET_TYPE.$DET_ID.$ITER.log
    333     stderr $CAMERA.$DET_TYPE.$DET_ID.$ITER.log
     402    stdout $LOGSUBDIR/$CAMERA.$DET_TYPE.$DET_ID.$ITER.log
     403    stderr $LOGSUBDIR/$CAMERA.$DET_TYPE.$DET_ID.$ITER.log
    334404
    335405    # specify choice of remote host:
     
    342412    # create example job options as a demonstration
    343413    options "$line"
    344     echo command detrend_norm_exp.pl --det_id $DET_ID --iteration $ITER --camera $CAMERA --det_type $DET_TYPE
     414    if ($VERBOSE > 1)
     415      echo command detrend_norm_exp.pl --det_id $DET_ID --iteration $ITER --camera $CAMERA --det_type $DET_TYPE
     416    end
    345417    command detrend_norm_exp.pl --det_id $DET_ID --iteration $ITER --camera $CAMERA --det_type $DET_TYPE
    346418  end
     
    348420  # success
    349421  task.exit 0
    350     queuepush DetrendNormalizeExposures -replace -key 1:2 "DONE $options:0"
    351   end
    352 
    353   # default exit status
    354   task.exit    default
    355     queuepush DetrendNormalizeExposures -replace -key 1:2 "FAIL $options:0"
    356   end
    357 
    358   # operation times out?
    359   task.exit    timeout
    360     queuepush DetrendNormalizeExposures -replace -key 1:2 "TIMEOUT $options:0"
    361   end
    362 end
     422    queuepush DetrendNormExp -replace -key 1:2 "DONE $options:0"
     423  end
     424
     425  # default exit status
     426  task.exit    default
     427    if ($VERBOSE)
     428      echo "failure detrend_norm_exp.pl $options:0"
     429    end
     430    queuepush DetrendNormExp -replace -key 1:2 "FAIL $options:0"
     431   $DetrendNormExpFail ++
     432  end
     433
     434  # operation times out?
     435  task.exit    timeout
     436    if ($VERBOSE)
     437      echo "failure detrend_norm_exp.pl $options:0"
     438    end
     439    queuepush DetrendNormExp -replace -key 1:2 "TIMEOUT $options:0"
     440   $DetrendNormExpFail ++
     441  end
     442end
  • trunk/ippTasks/detrend.process.pro

    r10542 r10692  
    2222end
    2323
     24$DetrendProcessImfileFail = 0
     25$DetrendProcessExpFail = 0
     26
     27if ($?VERBOSE == 0)
     28  echo "VERBOSE not defined: load pantasks.pro first"
     29  break
     30end
     31if ($?LOGDIR == 0)
     32  echo "LOGDIR not defined: load pantasks.pro first"
     33  break
     34end
     35$LOGSUBDIR = $LOGDIR/detrend
     36exec mkdir -p $LOGSUBDIR
     37
     38macro detproc.status
     39  queueprint DetrendProcessImfiles
     40  queueprint DetrendProcessExposures
     41  echo "DetrendProcessImfileFail: $DetrendProcessImfileFail"
     42  echo "DetrendProcessExpFail: $DetrendProcessExpFail"
     43end
     44
    2445# select images ready for copy
    2546# new entries are added to queue DetrendProcessImfiles
    2647# compare the new list with the ones already selected
    2748task           dettool.process.load
    28   command      dettool -toprocessedimfile -simple
    2949  host         local
    3050
     
    3353  periods      -timeout 30
    3454
    35   stdout dettool.process.log
    36   stderr dettool.process.log
     55  stdout $LOGSUBDIR/detproc.imfile.log
     56  stderr $LOGSUBDIR/detproc.imfile.log
     57
     58  task.exec
     59    command dettool -toprocessedimfile -simple -limit {$DetrendProcessImfileFail + 20}
     60  end
    3761
    3862  # success
     
    4771    for i 0 $Nqueue
    4872      queuepop stdout -var line
     73      if ($VERBOSE > 2)
     74        echo $line
     75      end
    4976      list word -split $line
    5077      $DET_ID   = $word:0
     
    6491  # error
    6592  task.exit    default
    66     echo       "detrend.process: failure"
     93    if ($VERBOSE)
     94      echo       "detrend.process: failure"
     95    end
    6796  end
    6897
    6998  # operation times out?
    7099  task.exit    timeout
    71     echo       "detrend.process: timeout"
     100    if ($VERBOSE)
     101      echo       "detrend.process: timeout"
     102    end
    72103  end
    73104end
     
    105136    $CAMERA   = $word:6
    106137
    107     $LOG_DIR = `dirname $URI`
    108     stdout $WORKDIR/$LOG_DIR/$EXP_TAG.detproc.$DET_ID.$CLASS_ID.log
    109     stderr $WORKDIR/$LOG_DIR/$EXP_TAG.detproc.$DET_ID.$CLASS_ID.log
     138    $word = `basename $EXP_TAG | tr '.' ' '`
     139    list word -split $word
     140    $base = $word:0
     141    stdout $LOGSUBDIR/$base/$EXP_TAG.detproc.$DET_ID.$CLASS_ID.log
     142    stderr $LOGSUBDIR/$base/$EXP_TAG.detproc.$DET_ID.$CLASS_ID.log
     143    exec mkdir -p $LOGSUBDIR/$base
    110144
    111145    # specify choice of remote host:
     
    118152    # create example job options as a demonstration
    119153    options "$line"
    120     echo command detrend_process_imfile.pl --det_id $DET_ID --exp_tag $EXP_TAG --class_id $CLASS_ID --det_type $DET_TYPE --input_uri $URI --camera $CAMERA
     154    if ($VERBOSE > 1)
     155      echo command detrend_process_imfile.pl --det_id $DET_ID --exp_tag $EXP_TAG --class_id $CLASS_ID --det_type $DET_TYPE --input_uri $URI --camera $CAMERA
     156    end
    121157    command detrend_process_imfile.pl --det_id $DET_ID --exp_tag $EXP_TAG --class $CLASS --class_id $CLASS_ID --det_type $DET_TYPE --input_uri $URI --camera $CAMERA
    122158  end
     
    130166  # default exit status
    131167  task.exit    default
    132     echo "failure detrend_process_imfile.pl $options:0"
     168    if ($VERBOSE)
     169      echo "failure detrend_process_imfile.pl $options:0"
     170    end
    133171    queuepush DetrendProcessImfiles -replace -key 1:3:5 "FAIL $options:0"
     172    $DetrendProcessImfileFail ++
    134173  end
    135174
    136175  # operation times out?
    137176  task.exit    timeout
    138     echo "timeout detrend_process_imfile.pl $options:0"
    139     queuepush DetrendProcessImfiles -replace -key 1:3:5 "TIMEOUT $options:0"
    140   end
     177    if ($VERBOSE)
     178      echo "timeout detrend_process_imfile.pl $options:0"
     179    end
     180    queuepush DetrendProcessImfiles -replace -key 1:3:5 "TIMEOUT $options:0"
     181    $DetrendProcessImfileFail ++
     182 end
    141183end
    142184
     
    145187# compare the new list with the ones already selected
    146188task           dettool.processexp.load
    147   command      dettool -toprocessedexp -simple
    148189  host         local
    149190
     
    152193  periods      -timeout 30
    153194
    154   stdout dettool.processexp.log
    155   stderr dettool.processexp.log
     195  stdout $LOGSUBDIR/detproc.exp.log
     196  stderr $LOGSUBDIR/detproc.exp.log
     197
     198  task.exec
     199    command dettool -toprocessedexp -simple -limit {$DetrendProcessExpFail + 20}
     200  end
    156201
    157202  # success
     
    166211    for i 0 $Nqueue
    167212      queuepop stdout -var line
     213      if ($VERBOSE > 2)
     214        echo $line
     215      end
    168216      list word -split $line
    169217      $DET_ID   = $word:0
     
    181229  # error
    182230  task.exit    default
    183     echo       "detrend.process: failure"
     231    if ($VERBOSE)
     232      echo       "detrend.process: failure"
     233    end
    184234  end
    185235
    186236  # operation times out?
    187237  task.exit    timeout
    188     echo       "detrend.process: timeout"
     238    if ($VERBOSE)
     239      echo       "detrend.process: timeout"
     240    end
    189241  end
    190242end
     
    210262    queuepush DetrendProcessExposures -replace -key 1:2:4 "RUN $line"
    211263
    212 
    213264    list word -split $line
    214265    $DET_ID   = $word:0
     
    218269    $CAMERA   = $word:4
    219270
    220     # XXX need the classID in dettool -toprocessedexp -simple output
    221     $CLASS_ID = isp
    222     stdout $EXP_TAG.detproc.$DET_ID.log
    223     stderr $EXP_TAG.detproc.$DET_ID.log
     271    # XXX this is still a lame rule
     272    $word = `basename $EXP_TAG | tr '.' ' '`
     273    list word -split $word
     274    $base = $word:0
     275
     276    stdout $LOGSUBDIR/$base/$EXP_TAG.detproc.$DET_ID.log
     277    stderr $LOGSUBDIR/$base/$EXP_TAG.detproc.$DET_ID.log
     278    exec mkdir -p $LOGSUBDIR/$base
    224279
    225280    # specify choice of remote host:
     
    232287    # create example job options as a demonstration
    233288    options "$line"
    234     echo command detrend_process_exp.pl --det_id $DET_ID --exp_tag $EXP_TAG --camera $CAMERA
     289    if ($VERBOSE > 1)
     290      echo command detrend_process_exp.pl --det_id $DET_ID --exp_tag $EXP_TAG --camera $CAMERA
     291    end
    235292    command detrend_process_exp.pl --det_id $DET_ID --exp_tag $EXP_TAG --camera $CAMERA
    236293  end
     
    243300  # default exit status
    244301  task.exit    default
     302    if ($VERBOSE)
     303      echo "failure for detrend_process_exp.pl: $options:0"
     304    end
    245305    queuepush DetrendProcessExposures -replace -key 1:2:4 "FAIL $options:0"
     306    $DetrendProcessExpFail ++
    246307  end
    247308
    248309  # operation times out?
    249310  task.exit    timeout
     311    if ($VERBOSE)
     312      echo "failure for detrend_process_exp.pl: $options:0"
     313    end
    250314    queuepush DetrendProcessExposures -replace -key 1:2:4 "TIMEOUT $options:0"
    251   end
    252 end
     315    $DetrendProcessExpFail ++
     316  end
     317end
  • 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
  • trunk/ippTasks/detrend.resid.pro

    r10543 r10692  
    2323end
    2424
     25$DetrendResidImfileFail = 0
     26$DetrendResidExpFail = 0
     27
     28if ($?VERBOSE == 0)
     29  echo "VERBOSE not defined: load pantasks.pro first"
     30  break
     31end
     32if ($?LOGDIR == 0)
     33  echo "LOGDIR not defined: load pantasks.pro first"
     34  break
     35end
     36$LOGSUBDIR = $LOGDIR/detrend
     37exec mkdir -p $LOGSUBDIR
     38
     39macro detresid.status
     40  queueprint DetrendResidImfiles
     41  queueprint DetrendResidExposures
     42  echo "DetrendResidImfileFail: $DetrendResidImfileFail"
     43  echo "DetrendResidExpFail: $DetrendResidExpFail"
     44end
     45
    2546# select images ready for copy
    2647# new entries are added to queue DetrendResidImfiles
    2748# compare the new list with the ones already selected
    2849task           dettool.resid.load
    29   command      dettool -toresidimfile -simple
    3050  host         local
    3151
     
    3454  periods      -timeout 30
    3555
    36   stdout dettool.resid.log
    37   stderr dettool.resid.log
     56  stdout $LOGSUBDIR/detresid.log
     57  stderr $LOGSUBDIR/detresid.log
     58
     59  task.exec
     60    command dettool -toresidimfile -simple -limit {$DetrendResidImfileFail + 20}
     61  end
    3862
    3963  # success
     
    4872    for i 0 $Nqueue
    4973      queuepop stdout -var line
     74      if ($VERBOSE > 2)
     75        echo $line
     76      end
    5077      list word -split $line
    5178      $DET_ID   = $word:0
     
    7097  # default exit status
    7198  task.exit    default
    72     echo       "detrend.resid: failure"
     99    if ($VERBOSE)
     100      echo       "detrend.resid: failure"
     101    end
    73102  end
    74103
    75104  # operation times out?
    76105  task.exit    timeout
    77     echo       "detrend.resid: timeout"
     106    if ($VERBOSE)
     107      echo       "detrend.resid: timeout"
     108    end
    78109  end
    79110end
     
    113144    $CAMERA   = $word:8
    114145
    115     $DET_DIR = `dirname $URI_IN`
    116     $LOG_DIR = $WORKDIR/$DET_DIR
    117 
    118     stdout $LOG_DIR/$EXP_TAG.detresid.$DET_ID.$ITER.$CLASS_ID.log
    119     stderr $LOG_DIR/$EXP_TAG.detresid.$DET_ID.$ITER.$CLASS_ID.log
     146    $word = `basename $EXP_TAG | tr '.' ' '`
     147    list word -split $word
     148    $base = $word:0
     149    stdout $LOGSUBDIR/$base/$EXP_TAG.detresid.$DET_ID.$ITER.$CLASS_ID.log
     150    stderr $LOGSUBDIR/$base/$EXP_TAG.detresid.$DET_ID.$ITER.$CLASS_ID.log
    120151
    121152    # specify choice of remote host:
     
    130161    # detrend_create_resid.pl DET_ID ITER EXP_TAG CLASS_ID TYPE (URI-DET) (URL-IN) (EXP_TAG ???)
    131162    # need to parse the subdir path for the detrend URL
    132     $DET_URL = $DET_DIR/$CAMERA.$DET_TYPE.$DET_ID.$ITER.$CLASS_ID.fits
    133     echo command detrend_resid.pl --det_id $DET_ID --iteration $ITER --exp_tag $EXP_TAG --class_id $CLASS_ID --det_type $DET_TYPE --detrend $DET_URL --input_uri $URI_IN --camera $CAMERA --mode $MODE
    134     command detrend_resid.pl --det_id $DET_ID --iteration $ITER --exp_tag $EXP_TAG --class_id $CLASS_ID --det_type $DET_TYPE --detrend $DET_URL --input_uri $URI_IN --camera $CAMERA --mode $MODE
     163    # $DET_URL = $DET_DIR/$CAMERA.$DET_TYPE.$DET_ID.$ITER.$CLASS_ID.fits
     164    echo command detrend_resid.pl --det_id $DET_ID --iteration $ITER --exp_tag $EXP_TAG --class_id $CLASS_ID --det_type $DET_TYPE --detrend $DET_URI --input_uri $URI --camera $CAMERA --mode $MODE
     165    command detrend_resid.pl --det_id $DET_ID --iteration $ITER --exp_tag $EXP_TAG --class_id $CLASS_ID --det_type $DET_TYPE --detrend $DET_URI --input_uri $URI --camera $CAMERA --mode $MODE
    135166  end
    136167
     
    142173  # default exit status
    143174  task.exit    default
     175    if ($VERBOSE)
     176      echo "failure detrend_resid.pl $options:0"
     177    end
    144178    queuepush DetrendResidImfiles -replace -key 1:2:5:6 "FAIL $options:0"
     179    $DetrendResidImfileFail ++
    145180  end
    146181
    147182  # operation times out?
    148183  task.exit    timeout
     184    if ($VERBOSE)
     185      echo "failure detrend_resid.pl $options:0"
     186    end
    149187    queuepush DetrendResidImfiles -replace -key 1:2:6:6 "TIMEOUT $options:0"
     188    $DetrendResidImfileFail ++
    150189  end
    151190end
     
    155194# compare the new list with the ones already selected
    156195task           dettool.residexp.load
    157   command      dettool -toresidexp -simple
    158196  host         local
    159197
     
    162200  periods      -timeout 30
    163201
    164   stdout dettool.residexp.log
    165   stderr dettool.residexp.log
     202  stdout $LOGSUBDIR/detresid.exp.log
     203  stderr $LOGSUBDIR/detresid.exp.log
     204
     205  task.exec
     206  command      dettool -toresidexp -simple -limit {$DetrendResidExpFail + 20}
     207  end
    166208
    167209  # success
     
    176218    for i 0 $Nqueue
    177219      queuepop stdout -var line
     220      if ($VERBOSE > 2)
     221        echo $line
     222      end
    178223      list word -split $line
    179224      $DET_ID   = $word:0
     
    194239  # default exit status
    195240  task.exit    default
    196     echo       "detrend.residexp: failure"
     241    if ($VERBOSE)
     242      echo       "detrend.residexp: failure"
     243    end
    197244  end
    198245
    199246  # operation times out?
    200247  task.exit    timeout
    201     echo       "detrend.residexp: timeout"
     248    if ($VERBOSE)
     249      echo       "detrend.residexp: timeout"
     250    end
    202251  end
    203252end
     
    235284    $CAMERA   = $word:6
    236285
    237     # XXX add $WORKDIR/$LOG_DIR
    238     stdout $EXP_TAG.detresid.$DET_ID.$ITER.log
    239     stderr $EXP_TAG.detresid.$DET_ID.$ITER.log
     286    # XXX this is still a lame rule
     287    $word = `basename $EXP_TAG | tr '.' ' '`
     288    list word -split $word
     289    $base = $word:0
     290
     291    stdout $LOGSUBDIR/$base/$EXP_TAG.detresid.$DET_ID.$ITER.log
     292    stderr $LOGSUBDIR/$base/$EXP_TAG.detresid.$DET_ID.$ITER.log
     293    exec mkdir -p $LOGSUBDIR/$base
    240294
    241295    # specify choice of remote host:
     
    248302    # create example job options as a demonstration
    249303    options "$line"
    250     echo command detrend_reject_imfile.pl --det_id $DET_ID --iteration $ITER --exp_tag $EXP_TAG --det_type $DET_TYPE --camera $CAMERA
     304    if ($VERBOSE > 1)
     305      echo command detrend_reject_imfile.pl --det_id $DET_ID --iteration $ITER --exp_tag $EXP_TAG --det_type $DET_TYPE --camera $CAMERA
     306    end
    251307    command detrend_reject_imfile.pl --det_id $DET_ID --iteration $ITER --exp_tag $EXP_TAG --det_type $DET_TYPE --camera $CAMERA
    252308  end
     
    259315  # default exit status
    260316  task.exit    default
     317    if ($VERBOSE)
     318      echo "failure for detrend_reject_imfile.pl: $options:0"
     319    end
    261320    queuepush DetrendResidExposures -replace -key 1:2:5 "FAIL $options:0"
     321    $DetrendResidExpFail ++
    262322  end
    263323
    264324  # operation times out?
    265325  task.exit    timeout
     326    if ($VERBOSE)
     327      echo "failure for detrend_reject_imfile.pl: $options:0"
     328    end
    266329    queuepush DetrendResidExposures -replace -key 1:2:5 "TIMEOUT $options:0"
    267   end
    268 end
     330    $DetrendResidExpFail ++
     331  end
     332end
  • trunk/ippTasks/detrend.stack.pro

    r9506 r10692  
    99# detrend_stack.pl 1 0 mc bias
    1010
    11 ## these tasks use the queue DetrendClassIDtoStack
    12 
    13 ## these tasks use the queue DetrendImfilesToProcess
    14 ## the DetrendClassIDtoStack queue contains:
     11## these tasks use the queue DetrendStackClass
     12## the DetrendStackClass queue contains:
    1513## STATE DET_ID ITER TYPE CLASS_ID CAMERA
    1614
     
    2321end
    2422
     23$DetrendStackClassFail = 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 detstack.status
     37  queueprint DetrendStackClass
     38  echo "DetrendStackClassFail: $DetrendStackClassFail"
     39end
     40
    2541# select images ready for copy
    2642# new entries are added to queue DetrendStackClass
    2743# compare the new list with the ones already selected
    2844task           dettool.stack.load
    29   command      dettool -tostacked -simple
    3045  host         local
    3146
     
    3449  periods      -timeout 30
    3550
    36   stdout dettool.stack.log
    37   stderr dettool.stack.log
     51  stdout $LOGSUBDIR/detstack.log
     52  stderr $LOGSUBDIR/detstack.log
     53
     54  task.exec
     55    command dettool -tostacked -simple -limit {$DetrendStackClassFail + 20}
     56  end
    3857
    3958  # success
     
    4665    for i 0 $Nqueue
    4766      queuepop stdout -var line
     67      if ($VERBOSE > 2)
     68        echo $line
     69      end
    4870      list word -split $line
    4971      $DET_ID   = $word:0
     
    6183  # locked list
    6284  task.exit    default
    63     echo       "detrend.stack: failure"
     85    if ($VERBOSE)
     86      echo       "detrend.stack: failure"
     87    end
    6488  end
    6589
    6690  # operation times out?
    6791  task.exit    timeout
    68     echo       "detrend.stack: timeout"
     92    if ($VERBOSE)
     93      echo       "detrend.stack: timeout"
     94    end
    6995  end
    7096end
     
    78104  task.exec
    79105    queuesize DetrendStackClass -var N
    80    
    81106    if ($N == 0) break
    82107    if ($network == 0) break
     
    103128
    104129    # XXX add $WORKDIR/$LOG_DIR
    105     stdout $CAMERA.$DET_TYPE.$DET_ID.$ITER.$CLASS_ID.log
    106     stderr $CAMERA.$DET_TYPE.$DET_ID.$ITER.$CLASS_ID.log
     130    stdout $LOGSUBDIR/$CAMERA.$DET_TYPE.$DET_ID.$ITER.$CLASS_ID.log
     131    stderr $LOGSUBDIR/$CAMERA.$DET_TYPE.$DET_ID.$ITER.$CLASS_ID.log
    107132
    108133    # specify choice of remote host:
     
    115140    # create example job options as a demonstration
    116141    options "$line"
    117     # detrend_stack.pl --det_id 1 --iteration 0 --class_id isp --det_type bias --camera ISP || exit 1
    118     echo command detrend_stack.pl --det_id $DET_ID --iteration $ITER --class_id $CLASS_ID --det_type $DET_TYPE --camera $CAMERA
     142    if ($VERBOSE > 1)
     143      echo command detrend_stack.pl --det_id $DET_ID --iteration $ITER --class_id $CLASS_ID --det_type $DET_TYPE --camera $CAMERA
     144    end
    119145    command detrend_stack.pl --det_id $DET_ID --iteration $ITER --class_id $CLASS_ID --det_type $DET_TYPE --camera $CAMERA
    120146  end
     
    127153  # default exit status
    128154  task.exit    default
    129     queuepush DetrendStackClass -replace -key 1:2:4 "FAIL $options:0"
     155    if ($VERBOSE)
     156      echo "failure detrend_stack.pl $options:0"
     157    end
     158   queuepush DetrendStackClass -replace -key 1:2:4 "FAIL $options:0"
     159   $DetrendStackClassFail ++
    130160  end
    131161
    132162  # operation times out?
    133163  task.exit    timeout
     164    if ($VERBOSE)
     165      echo "failure detrend_stack.pl $options:0"
     166    end
    134167    queuepush DetrendStackClass -replace -key 1:2:4 "TIMEOUT $options:0"
     168    $DetrendStackClassFail ++
    135169  end
    136170end
  • trunk/ippTasks/phase0.pro

    r10691 r10692  
    4040# compare the new list with the ones already selected
    4141task           phase0.imfile.load
    42   command      p0tool -pendingimfile -simple
    4342  host         local
    4443
     
    8382      echo "phase0 pending imfiles: failure"
    8483    end
    85     $Phase0ImfileFail ++
    8684  end
    8785
     
    9391  end
    9492end
     93
     94
    9595
    9696# run the phase0imfile script on pending images
     
    166166    end
    167167    queuepush Phase0Imfiles -replace -key 1 "TIMEOUT $options:0"
    168   end
    169 end
     168    $Phase0ImfileFail ++
     169  end
     170end
     171
     172
    170173
    171174## these tasks use the queue Phase0Exposures
     
    199202    for i 0 $Nqueue
    200203      queuepop stdout -var line
     204      if ($VERBOSE > 2)
     205        echo $line
     206      end
    201207      list word -split $line
    202208      $EXP_TAG   = $word:0
     
    228234  end
    229235end
     236
     237
    230238
    231239# run the phase0imfile script on pending images
     
    285293  # default exit status
    286294  task.exit    default
     295    if ($VERBOSE)
     296      echo "failure for phase0exp.pl: $options:0"
     297    end
    287298    queuepush Phase0Exposures -replace -key 1 "FAIL $options:0"
    288299    $Phase0ExpFail
     
    291302  # operation times out?
    292303  task.exit    timeout
     304    if ($VERBOSE)
     305      echo "failure for phase0exp.pl: $options:0"
     306    end
    293307    queuepush Phase0Exposures -replace -key 1 "TIMEOUT $options:0"
     308    $Phase0ExpFail
    294309  end
    295310end
Note: See TracChangeset for help on using the changeset viewer.