Changeset 19089 for trunk/ippTasks/detrend.stack.pro
- Timestamp:
- Aug 16, 2008, 1:06:59 PM (18 years ago)
- File:
-
- 1 edited
-
trunk/ippTasks/detrend.stack.pro (modified) (7 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ippTasks/detrend.stack.pro
r18129 r19089 7 7 8 8 book init detPendingStackedImfile 9 book init detCleanupStackedImfile 9 10 10 11 macro detstack.reset 11 12 book init detPendingStackedImfile 13 book init detCleanupStackedImfile 12 14 end 13 15 … … 15 17 echo detPendingStackedImfile 16 18 book listbook detPendingStackedImfile 19 echo detCleanupStackedImfile 20 book listbook detCleanupStackedImfile 17 21 end 18 22 … … 24 28 active true 25 29 end 30 task detrend.cleanup.stack.load 31 active true 32 end 33 task detrend.cleanup.stack.run 34 active true 35 end 26 36 end 27 37 … … 33 43 active false 34 44 end 45 task detrend.cleanup.stack.load 46 active false 47 end 48 task detrend.cleanup.stack.run 49 active false 50 end 35 51 end 36 52 37 53 # this variable will cycle through the known database names 38 54 $detPendingStackedImfile_DB = 0 55 $detCleanupStackedImfile_DB = 0 39 56 40 57 # select images ready for detrend_stack.pl … … 50 67 51 68 stdout NULL 52 stderr $LOGDIR/detrend.stack.lo ad.log69 stderr $LOGDIR/detrend.stack.log 53 70 54 71 task.exec … … 122 139 sprintf outroot "%s/%s.%s.%s/%s.%s.%s.%s" $WORKDIR $CAMERA $DET_TYPE $DET_ID $CAMERA $DET_TYPE $DET_ID $ITERATION 123 140 124 stdout $LOGDIR/detrend.stack. run.log125 stderr $LOGDIR/detrend.stack. run.log126 127 $run = detrend_stack.pl --det_id $DET_ID --iteration $ITERATION --class_id $CLASS_ID --det_type $DET_TYPE --camera $CAMERA --outroot $outroot --redirect-output --verbose141 stdout $LOGDIR/detrend.stack.log 142 stderr $LOGDIR/detrend.stack.log 143 144 $run = detrend_stack.pl --det_id $DET_ID --iteration $ITERATION --class_id $CLASS_ID --det_type $DET_TYPE --camera $CAMERA --outroot $outroot --redirect-output 128 145 if ("$REDUCTION" != "NULL") 129 146 $run = $run --reduction $REDUCTION … … 152 169 end 153 170 end 171 172 ########## cleanup stack ########### 173 task detrend.cleanup.stack.load 174 host local 175 176 periods -poll $LOADPOLL 177 periods -exec $LOADEXEC 178 periods -timeout 30 179 npending 1 180 active true 181 182 stdout NULL 183 stderr $LOGDIR/detrend.cleanup.stack.log 184 185 task.exec 186 if ($DB:n == 0) 187 option DEFAULT 188 command dettool -pendingcleanup_stacked -limit 20 189 else 190 # save the DB name for the exit tasks 191 option $DB:$detCleanupStackedImfile_DB 192 command dettool -pendingcleanup_stacked -limit 20 -dbname $DB:$detCleanupStackedImfile_DB 193 $detCleanupStackedImfile_DB ++ 194 if ($detCleanupStackedImfile_DB >= $DB:n) set detCleanupStackedImfile_DB = 0 195 end 196 end 197 198 # success 199 task.exit 0 200 # convert 'stdout' to book format 201 ipptool2book stdout detCleanupStackedImfile -key det_id:iteration:class_id -uniq -setword dbname $options:0 -setword pantaskState INIT 202 if ($VERBOSE > 2) 203 book listbook detCleanupStackedImfile 204 end 205 206 # delete existing entries in the appropriate pantaskStates 207 process_cleanup detCleanupStackedImfile 208 end 209 210 # locked list 211 task.exit default 212 showcommand failure 213 end 214 215 # operation times out? 216 task.exit timeout 217 showcommand timeout 218 end 219 end 220 221 # run the ipp_cleanup.pl script on pending images 222 task detrend.cleanup.stack.run 223 periods -poll $RUNPOLL 224 periods -exec $RUNEXEC 225 periods -timeout 60 226 active true 227 228 task.exec 229 book npages detCleanupStackedImfile -var N 230 if ($N == 0) break 231 if ($NETWORK == 0) break 232 233 # look for new images in detCleanupStackedImfile (pantaskState == INIT) 234 book getpage detCleanupStackedImfile 0 -var pageName -key pantaskState INIT 235 if ("$pageName" == "NULL") break 236 237 book setword detCleanupStackedImfile $pageName pantaskState RUN 238 book getword detCleanupStackedImfile $pageName det_id -var DET_ID 239 book getword detCleanupStackedImfile $pageName iteration -var ITERATION 240 book getword detCleanupStackedImfile $pageName class_id -var CLASS_ID 241 book getword detCleanupStackedImfile $pageName camera -var CAMERA 242 book getword detCleanupStackedImfile $pageName state -var CLEANUP_MODE 243 book getword detCleanupStackedImfile $pageName dbname -var DBNAME 244 245 # specify choice of local or remote host based on camera and chip (class_id) 246 set.host.for.camera $CAMERA FPA 247 248 stdout $LOGDIR/detrend.cleanup.stack.log 249 stderr $LOGDIR/detrend.cleanup.stack.log 250 251 # XXX is everything listed here needed? 252 $run = ipp_cleanup.pl --stage detrend.stack.imfile --stage_id $DET_ID --iteration $ITERATION --class_id $CLASS_ID --camera $CAMERA --mode $CLEANUP_MODE 253 add_standard_args run 254 255 # save the pageName for future reference below 256 options $pageName 257 258 # create the command line 259 if ($VERBOSE > 1) 260 echo command $run 261 end 262 command $run 263 end 264 265 # default exit status 266 task.exit default 267 process_exit detCleanupStackedImfile $options:0 $JOB_STATUS 268 end 269 270 # operation timed out? 271 task.exit timeout 272 showcommand timeout 273 book setword detCleanupStackedImfile $options:0 pantaskState TIMEOUT 274 end 275 end 276
Note:
See TracChangeset
for help on using the changeset viewer.
