Changeset 11210 for trunk/ippTasks/detrend.stack.pro
- Timestamp:
- Jan 19, 2007, 5:24:59 PM (19 years ago)
- File:
-
- 1 edited
-
trunk/ippTasks/detrend.stack.pro (modified) (7 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ippTasks/detrend.stack.pro
r10745 r11210 1 1 ## this file contains the tasks for running the detrend stacking stage 2 ## these tasks use the book detPendingStackedImfile 2 3 3 # get a list of imfiles to stack4 # dettool -tostack -simple5 # 1 0 bias mc6 # DET_ID ITER TYPE CLASS_ID7 8 # function to stack the imfiles:9 # detrend_stack.pl 1 0 mc bias10 11 ## these tasks use the queue DetrendStackClass12 ## the DetrendStackClass queue contains:13 ## STATE DET_ID ITER TYPE CLASS_ID CAMERA14 15 queueinit DetrendStackClass16 4 if ($?network == 0) 17 5 $network = 1 … … 20 8 $parallel = 0 21 9 end 22 23 $DetrendStackClassFail = 024 25 10 if ($?VERBOSE == 0) 26 11 echo "VERBOSE not defined: load pantasks.pro first" … … 31 16 break 32 17 end 18 33 19 $LOGSUBDIR = $LOGDIR/detrend 34 20 exec mkdir -p $LOGSUBDIR 35 21 22 book init detPendingStackedImfile 23 36 24 macro detstack.status 37 queueprint DetrendStackClass 38 echo "DetrendStackClassFail: $DetrendStackClassFail" 25 book listbook detPendingStackedImfile 39 26 end 40 27 41 # select images ready for copy42 # new entries are added to queue DetrendStackClass28 # select images ready for detrend_stack.pl 29 # new entries are added to detPendingStackedImfile 43 30 # compare the new list with the ones already selected 44 31 task dettool.stack.load … … 49 36 periods -timeout 30 50 37 51 stdout $LOGSUBDIR/detstack.log38 stdout NULL 52 39 stderr $LOGSUBDIR/detstack.log 53 40 54 41 task.exec 55 command dettool -tostacked - simple -limit {$DetrendStackClassFail + 20}42 command dettool -tostacked -limit 20 56 43 end 57 44 58 45 # success 59 46 task.exit 0 60 local i Nqueue 61 62 # compare output with newImage queue 63 # only add entries which do not 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 $CLASS_ID = $word:3 75 $CAMERA = $word:4 76 queuepush DetrendStackClass -uniq -key 1:2:4 "NEW $DET_ID $ITER $DET_TYPE $CLASS_ID $CAMERA" 47 # convert 'stdout' to book format 48 ipptool2book stdout detPendingStackedImfile -key det_id:iteration:class_id -uniq 49 if ($VERBOSE > 2) 50 book listbook detPendingStackedImfile 77 51 end 78 52 79 53 # delete existing entries which are DONE 80 queuedrop DetrendStackClass -key 0DONE54 book delpage detPendingStackedImfile -key state DONE 81 55 end 82 56 … … 99 73 100 74 task.exec 101 queuesize DetrendStackClass-var N75 book npages detPendingStackedImfile -var N 102 76 if ($N == 0) break 103 77 if ($network == 0) break 104 78 105 # look for new images on the internal DetrendStackClass queue 106 # caution with these 'if' statements: syntax errors 107 # will make the task fail without given a good status 108 queuepop DetrendStackClass -var line -key 0 NEW 109 if ("$line" == "NULL") break 79 # look for new images in detPendingStackedImfile 80 book getpage detPendingStackedImfile 0 -var pageName -key state NULL 81 if ($pageName == NULL) break 110 82 111 strpop line state 112 queuepush DetrendStackClass -replace -key 1:2:4 "RUN $line" 113 114 # the DetrendStackClass queue contains: 115 # STATE DET_ID ITER TYPE CLASS_ID 116 ## NOTE: the queue has the STATE prepended 117 # use local variables 118 list word -split $line 119 $DET_ID = $word:0 120 $ITER = $word:1 121 $DET_TYPE = $word:2 122 $CLASS_ID = $word:3 123 $CAMERA = $word:4 124 125 # XXX add $WORKDIR/$LOG_DIR 126 stdout $LOGSUBDIR/$CAMERA.$DET_TYPE.$DET_ID.$ITER.$CLASS_ID.log 127 stderr $LOGSUBDIR/$CAMERA.$DET_TYPE.$DET_ID.$ITER.$CLASS_ID.log 83 book setword detPendingStackedImfile $pageName state RUN 84 book getword detPendingStackedImfile $pageName det_id -var DET_ID 85 book getword detPendingStackedImfile $pageName iteration -var ITERATION 86 book getword detPendingStackedImfile $pageName det_type -var DET_TYPE 87 book getword detPendingStackedImfile $pageName class_id -var CLASS_ID 88 book getword detPendingStackedImfile $pageName camera -var CAMERA 128 89 129 90 # specify choice of remote host: … … 134 95 end 135 96 136 # create example job options as a demonstration 137 options "$line" 97 # XXX add $WORKDIR/$LOG_DIR 98 # XXX use ipp_filename.pl to lookup output file names 99 stdout $LOGSUBDIR/$CAMERA.$DET_TYPE.$DET_ID.$ITERATION.$CLASS_ID.log 100 stderr $LOGSUBDIR/$CAMERA.$DET_TYPE.$DET_ID.$ITERATION.$CLASS_ID.log 101 102 # save the pageName for future reference below 103 options $pageName 104 105 # create the command line 138 106 if ($VERBOSE > 1) 139 echo command detrend_stack.pl --det_id $DET_ID --iteration $ITER --class_id $CLASS_ID --det_type $DET_TYPE --camera $CAMERA107 echo command detrend_stack.pl --det_id $DET_ID --iteration $ITERATION --class_id $CLASS_ID --det_type $DET_TYPE --camera $CAMERA 140 108 end 141 command detrend_stack.pl --det_id $DET_ID --iteration $ITER --class_id $CLASS_ID --det_type $DET_TYPE --camera $CAMERA 142 end 143 144 # success 145 task.exit 0 146 queuepush DetrendStackClass -replace -key 1:2:4 "DONE $options:0" 109 command detrend_stack.pl --det_id $DET_ID --iteration $ITERATION --class_id $CLASS_ID --det_type $DET_TYPE --camera $CAMERA 147 110 end 148 111 149 112 # default exit status 150 113 task.exit default 151 showcommand failure 152 queuepush DetrendStackClass -replace -key 1:2:4 "FAIL $options:0" 153 $DetrendStackClassFail ++ 114 process_exit detPendingStackedImfile $options:0 $JOB_STATUS 154 115 end 155 116 … … 157 118 task.exit timeout 158 119 showcommand timeout 159 queuepush DetrendStackClass -replace -key 1:2:4 "TIMEOUT $options:0" 160 $DetrendStackClassFail ++ 120 book setword detPendingStackedImfile $options:0 state TIMEOUT 161 121 end 162 122 end
Note:
See TracChangeset
for help on using the changeset viewer.
