IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Jan 19, 2007, 5:24:59 PM (20 years ago)
Author:
eugene
Message:

converting to book version

File:
1 edited

Legend:

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

    r10745 r11210  
     1## this file contains the tasks for running the detrend processing stage
     2## these tasks use the book detRejectExp
    13
    2 ## this file contains the tasks for running the detrend processing stage
    3 
    4 # dettool -residdetrun -simple
    5 # 1      0    bias
    6 # DET_ID ITER TYPE
    7 
    8 # detrend_reject_exp.pl 1      0    bias
    9 # detrend_reject_exp.pl DET_ID ITER TYPE
    10 
    11 ## these tasks use the queue DetrendResidExp
    12 ## the DetrendRejectExp queue contains:
    13 ## STATE DET_ID ITER TYPE
    14 
    15 queueinit DetrendRejectExp
    164if ($?network == 0)
    175  $network = 1
     
    208  $parallel = 0
    219end
    22 
    23 $DetrendRejectExpFail = 0
    24 
    2510if ($?VERBOSE == 0)
    2611  echo "VERBOSE not defined: load pantasks.pro first"
     
    3116  break
    3217end
     18
    3319$LOGSUBDIR = $LOGDIR/detrend
    3420exec mkdir -p $LOGSUBDIR
    3521
     22book init detRejectExp
     23
    3624macro detreject.status
    37   queueprint DetrendRejectExp
    38   echo "DetrendRejectExpFail: $DetrendRejectExpFail"
     25  book listbook detRejectExp
    3926end
    4027
    4128# select images ready for copy
    42 # new entries are added to queue DetrendRejectExp
     29# new entries are added to detRejectExp
    4330# compare the new list with the ones already selected
    4431task           dettool.reject.load
     
    4936  periods      -timeout 30
    5037
    51   stdout $LOGSUBDIR/dettool.reject.log
     38  stdout NULL
    5239  stderr $LOGSUBDIR/dettool.reject.log
    5340
    5441  task.exec
    55     command dettool -residdetrun -simple -limit {$DetrendRejectExpFail + 20}
     42    command dettool -residdetrun -limit 20
    5643  end
    5744
    5845  # success
    5946  task.exit    0
    60     local i Nqueue
    61 
    62     # compare output with newImage queue
    63     # only add entries which don't exist in queue
    64     queuesize stdout -var Nqueue
    65     for i 0 $Nqueue
    66       queuepop stdout -var line
    67       if ($VERBOSE > 2)
    68         echo $line
    69       end
    70       list word -split $line
    71       $DET_ID   = $word:0
    72       $ITER     = $word:1
    73       $DET_TYPE = $word:2
    74       $MODE     = $word:3
    75       $CAMERA   = $word:4
    76       queuepush DetrendRejectExp -uniq -key 1:2 "NEW $DET_ID $ITER $DET_TYPE $MODE $CAMERA"
     47    # convert 'stdout' to book format
     48    ipptool2book stdout detRejectExp -key det_id:iteration -uniq
     49    if ($VERBOSE > 2)
     50      book listbook detRejectExp
    7751    end
    7852
    7953    # delete existing entries which are DONE
    80     queuedrop DetrendRejectExp -key 0 DONE
     54    book delpage detRejectExp -key state DONE
    8155  end
    8256
     
    9973
    10074  task.exec
    101     queuesize DetrendRejectExp -var N
     75    book npages detRejectExp -var N
    10276    if ($N == 0) break
    10377    if ($network == 0) break
    10478   
    105     # look for new images on the internal DetrendRejectExp queue
    106     # caution with these 'if' statements: syntax errors
    107     # will make the task fail without given a good status
    108     queuepop DetrendRejectExp -var line -key 0 NEW
    109     if ("$line" == "NULL") break
     79    # look for new images in detRejectExp
     80    book getpage detRejectExp 0 -var pageName -key state NULL
     81    if ($pageName == NULL) break
    11082
    111     strpop line state
    112     queuepush DetrendRejectExp -replace -key 1:2 "RUN $line"
    113 
    114     ## the DetrendRejectExp queue contains:
    115     ## STATE DET_ID ITER TYPE
    116     ## NOTE: the queue has the STATE prepended
    117     list word -split $line
    118     $DET_ID   = $word:0
    119     $ITER     = $word:1
    120     $DET_TYPE = $word:2
    121     $MODE     = $word:3
    122     $CAMERA   = $word:4
    123 
    124     # I'd like to add CAMERA to the log file...
    125     stdout $LOGSUBDIR/$CAMERA.$DET_TYPE.$DET_ID.$ITER.log
    126     stderr $LOGSUBDIR/$CAMERA.$DET_TYPE.$DET_ID.$ITER.log
     83    book setword detRejectExp $pageName state RUN
     84    book getword detRejectExp $pageName det_id    -var DET_ID   
     85    book getword detRejectExp $pageName iteration -var ITERATION     
     86    book getword detRejectExp $pageName det_type  -var DET_TYPE
     87    book getword detRejectExp $pageName mode      -var MODE     
     88    book getword detRejectExp $pageName camera    -var CAMERA   
    12789
    12890    # specify choice of remote host:
     
    13395    end
    13496
     97    # I'd like to add CAMERA to the log file...
     98    stdout $LOGSUBDIR/$CAMERA.$DET_TYPE.$DET_ID.$ITERATION.log
     99    stderr $LOGSUBDIR/$CAMERA.$DET_TYPE.$DET_ID.$ITERATION.log
     100
     101    # save the pageName for future reference below
     102    options $pageName
     103
    135104    # create example job options as a demonstration
    136     options "$line"
    137105    if ($VERBOSE > 1)
    138       echo command detrend_reject_exp.pl --det_id $DET_ID --iteration $ITER --det_type $DET_TYPE --camera $CAMERA
     106      echo command detrend_reject_exp.pl --det_id $DET_ID --iteration $ITERATION --det_type $DET_TYPE --camera $CAMERA
    139107    end
    140     command detrend_reject_exp.pl --det_id $DET_ID --iteration $ITER --det_type $DET_TYPE --camera $CAMERA
     108    command detrend_reject_exp.pl --det_id $DET_ID --iteration $ITERATION --det_type $DET_TYPE --camera $CAMERA
    141109 end
    142 
    143   # success
    144   task.exit 0
    145     queuepush DetrendRejectExp -replace -key 1:2 "DONE $options:0"
    146   end
    147110
    148111  # default exit status
    149112  task.exit    default
    150     showcommand failure
    151     queuepush DetrendRejectExp -replace -key 1:2 "FAIL $options:0"
    152     $DetrendRejectExpFail ++
     113    process_exit detRejectExp $options:0 state FAIL
    153114  end
    154115
     
    156117  task.exit    timeout
    157118    showcommand failure
    158     queuepush DetrendRejectExp -replace -key 1:2 "TIMEOUT $options:0"
    159    $DetrendRejectExpFail ++
     119    book setword detRejectExp $options:0 state TIMEOUT
    160120  end
    161121end
Note: See TracChangeset for help on using the changeset viewer.