Changeset 11011 for branches/eam_branch_00/ippTasks/detrend.stack.pro
- Timestamp:
- Jan 10, 2007, 12:12:35 PM (20 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branch_00/ippTasks/detrend.stack.pro
r10745 r11011 1 1 ## this file contains the tasks for running the detrend stacking stage 2 2 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 3 if ($?network == 0) 17 4 $network = 1 … … 20 7 $parallel = 0 21 8 end 22 23 $DetrendStackClassFail = 024 25 9 if ($?VERBOSE == 0) 26 10 echo "VERBOSE not defined: load pantasks.pro first" … … 31 15 break 32 16 end 17 33 18 $LOGSUBDIR = $LOGDIR/detrend 34 19 exec mkdir -p $LOGSUBDIR 20 21 book init DetrendStackClass 35 22 36 23 macro detstack.status … … 39 26 end 40 27 41 # select images ready for copy42 # new entries are added to queueDetrendStackClass28 # select images ready for detrend_stack.pl 29 # new entries are added to DetrendStackClass 43 30 # compare the new list with the ones already selected 44 31 task dettool.stack.load … … 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 DetrendStackClass -key det_id:iter:class_id -uniq 49 if ($VERBOSE > 2) 50 book listbook DetrendStackClass 77 51 end 78 52 79 53 # delete existing entries which are DONE 80 queuedrop DetrendStackClass -key 0DONE54 book delpage DetrendStackClass -key state DONE 81 55 end 82 56 … … 99 73 100 74 task.exec 101 queuesizeDetrendStackClass -var N75 book npages DetrendStackClass -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 DetrendStackClass 80 book getpage DetrendStackClass 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 DetrendStackClass $pageName state RUN 84 book getword DetrendStackClass $pageName det_id -var DET_ID 85 book getword DetrendStackClass $pageName iter -var ITER 86 book getword DetrendStackClass $pageName det_type -var DET_TYPE 87 book getword DetrendStackClass $pageName class_id -var CLASS_ID 88 book getword DetrendStackClass $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 stdout $LOGSUBDIR/$CAMERA.$DET_TYPE.$DET_ID.$ITER.$CLASS_ID.log 99 stderr $LOGSUBDIR/$CAMERA.$DET_TYPE.$DET_ID.$ITER.$CLASS_ID.log 100 101 # save the pageName for future reference below 102 options $pageName 103 104 # create the command line 138 105 if ($VERBOSE > 1) 139 106 echo command detrend_stack.pl --det_id $DET_ID --iteration $ITER --class_id $CLASS_ID --det_type $DET_TYPE --camera $CAMERA … … 144 111 # success 145 112 task.exit 0 146 queuepush DetrendStackClass -replace -key 1:2:4 "DONE $options:0"113 book setword DetrendStackClass $options:0 state DONE 147 114 end 148 115 … … 150 117 task.exit default 151 118 showcommand failure 152 queuepush DetrendStackClass -replace -key 1:2:4 "FAIL $options:0" 153 $DetrendStackClassFail ++ 119 book setword DetrendStackClass $options:0 state FAIL 154 120 end 155 121 … … 157 123 task.exit timeout 158 124 showcommand timeout 159 queuepush DetrendStackClass -replace -key 1:2:4 "TIMEOUT $options:0" 160 $DetrendStackClassFail ++ 125 book setword DetrendStackClass $options:0 state TIMEOUT 161 126 end 162 127 end
Note:
See TracChangeset
for help on using the changeset viewer.
