Changeset 10692
- Timestamp:
- Dec 12, 2006, 11:58:21 PM (20 years ago)
- Location:
- trunk/ippTasks
- Files:
-
- 6 edited
-
detrend.norm.pro (modified) (26 diffs)
-
detrend.process.pro (modified) (15 diffs)
-
detrend.reject.pro (modified) (9 diffs)
-
detrend.resid.pro (modified) (14 diffs)
-
detrend.stack.pro (modified) (9 diffs)
-
phase0.pro (modified) (8 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ippTasks/detrend.norm.pro
r9506 r10692 2 2 ## this file contains the tasks for running the detrend normalization stage 3 3 4 ## these tasks use the queue DetrendNorm alize5 ## the DetrendNorm alizequeue contains:4 ## these tasks use the queue DetrendNorm 5 ## the DetrendNorm queue contains: 6 6 ## STATE DET_ID ITER 7 7 8 queueinit DetrendNorm alize8 queueinit DetrendNorm 9 9 queueinit DetrendNormStat 10 queueinit DetrendNorm alizeExposures10 queueinit DetrendNormExp 11 11 if ($?network == 0) 12 12 $network = 1 … … 14 14 if ($?parallel == 0) 15 15 $parallel = 0 16 end 17 18 $DetrendNormFail = 0 19 $DetrendNormStatFail = 0 20 $DetrendNormExpFail = 0 21 22 if ($?VERBOSE == 0) 23 echo "VERBOSE not defined: load pantasks.pro first" 24 break 25 end 26 if ($?LOGDIR == 0) 27 echo "LOGDIR not defined: load pantasks.pro first" 28 break 29 end 30 $LOGSUBDIR = $LOGDIR/detrend 31 exec mkdir -p $LOGSUBDIR 32 33 macro detnorm.status 34 queueprint DetrendNorm 35 queueprint DetrendNormStat 36 queueprint DetrendNormExp 37 echo "DetrendNormFail: $DetrendNormFail" 38 echo "DetrendNormStatFail: $DetrendNormStatFail" 39 echo "DetrendNormExpFail: $DetrendNormExpFail" 16 40 end 17 41 … … 20 44 # compare the new list with the ones already selected 21 45 task dettool.normstat.load 22 command dettool -tonormalizedstat -simple23 46 host local 24 47 … … 27 50 periods -timeout 30 28 51 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 31 58 32 59 # success … … 41 68 for i 0 $Nqueue 42 69 queuepop stdout -var line 70 if ($VERBOSE > 2) 71 echo $line 72 end 43 73 list word -split $line 44 74 $DET_ID = $word:0 … … 56 86 # default exit status 57 87 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 64 98 end 65 99 end … … 73 107 task.exec 74 108 queuesize DetrendNormStat -var N 75 76 109 if ($N == 0) break 77 110 if ($network == 0) break … … 95 128 96 129 # XXX add $WORKDIR/$LOG_DIR 97 stdout $ CAMERA.$DET_TYPE.$DET_ID.$ITER.log98 stderr $ CAMERA.$DET_TYPE.$DET_ID.$ITER.log130 stdout $LOGSUBDIR/$CAMERA.$DET_TYPE.$DET_ID.$ITER.log 131 stderr $LOGSUBDIR/$CAMERA.$DET_TYPE.$DET_ID.$ITER.log 99 132 100 133 # specify choice of remote host: … … 107 140 # create example job options as a demonstration 108 141 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 110 145 command detrend_norm_calc.pl --det_id $DET_ID --iteration $ITER --det_type $DET_TYPE 111 146 end … … 118 153 # default exit status 119 154 task.exit default 155 if ($VERBOSE) 156 echo "failure detrend_norm_calc.pl $options:0" 157 end 120 158 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 125 167 queuepush DetrendNormStat -replace -key 1:3 "TIMEOUT $options:0" 168 $DetrendNormStatFail ++ 126 169 end 127 170 end 128 171 129 172 # select images ready for copy 130 # new entries are added to queue DetrendNorm alize173 # new entries are added to queue DetrendNorm 131 174 # compare the new list with the ones already selected 132 175 task dettool.norm.load 133 command dettool -tonormalize -simple134 176 host local 135 177 … … 138 180 periods -timeout 30 139 181 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 142 188 143 189 # success … … 152 198 for i 0 $Nqueue 153 199 queuepop stdout -var line 200 if ($VERBOSE > 2) 201 echo $line 202 end 154 203 list word -split $line 155 204 $DET_TYPE = $word:0 … … 160 209 $CLASS_ID = $word:5 161 210 $NORM = $word:6 162 queuepush DetrendNorm alize-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" 163 212 end 164 213 165 214 # delete existing entries which are DONE 166 queuedrop DetrendNorm alize-key 0 DONE215 queuedrop DetrendNorm -key 0 DONE 167 216 end 168 217 … … 170 219 # default exit status 171 220 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 178 231 end 179 232 end … … 186 239 187 240 task.exec 188 queuesize DetrendNormalize -var N 189 241 queuesize DetrendNorm -var N 190 242 if ($N == 0) break 191 243 if ($network == 0) break 192 244 193 # look for new images on the internal DetrendNorm alizequeue245 # look for new images on the internal DetrendNorm queue 194 246 # caution with these 'if' statements: syntax errors 195 247 # will make the task fail without given a good status 196 queuepop DetrendNorm alize-var line -key 0 NEW248 queuepop DetrendNorm -var line -key 0 NEW 197 249 if ("$line" == "NULL") break 198 250 199 251 strpop line state 200 queuepush DetrendNorm alize-replace -key 4:5 "RUN $line"201 202 # the DetrendNorm alizequeue contains:252 queuepush DetrendNorm -replace -key 4:5 "RUN $line" 253 254 # the DetrendNorm queue contains: 203 255 # STATE DET_ID ITER 204 256 list word -split $line … … 211 263 $NORM = $word:6 212 264 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 217 267 218 268 # specify choice of remote host: … … 225 275 # create example job options as a demonstration 226 276 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 228 280 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 229 281 end … … 231 283 # success 232 284 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 ++ 244 304 end 245 305 end 246 306 247 307 # select images ready for copy 248 # new entries are added to queue DetrendNorm alizeExposures308 # new entries are added to queue DetrendNormExp 249 309 # compare the new list with the ones already selected 250 310 task dettool.normexp.load 251 command dettool -tonormalizedexp -simple252 311 host local 253 312 … … 256 315 periods -timeout 30 257 316 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 260 323 261 324 # success … … 270 333 for i 0 $Nqueue 271 334 queuepop stdout -var line 335 if ($VERBOSE > 2) 336 echo $line 337 end 272 338 list word -split $line 273 339 $DET_ID = $word:0 … … 278 344 #$EXP_TYPE = $word:5 279 345 #$IMFILES = $word:6 280 queuepush DetrendNormalizeExp osures-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" 281 347 end 282 348 283 349 # delete existing entries which are DONE 284 queuedrop DetrendNorm alizeExposures-key 0 DONE350 queuedrop DetrendNormExp -key 0 DONE 285 351 end 286 352 … … 288 354 # default exit status 289 355 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 296 366 end 297 367 end … … 304 374 305 375 task.exec 306 queuesize DetrendNorm alizeExposures-var N376 queuesize DetrendNormExp -var N 307 377 308 378 if ($N == 0) break 309 379 if ($network == 0) break 310 380 311 # look for new images on the internal DetrendNorm alizeExposuresqueue381 # look for new images on the internal DetrendNormExp queue 312 382 # caution with these 'if' statements: syntax errors 313 383 # will make the task fail without given a good status 314 queuepop DetrendNorm alizeExposures-var line -key 0 NEW384 queuepop DetrendNormExp -var line -key 0 NEW 315 385 if ("$line" == "NULL") break 316 386 317 387 strpop line state 318 queuepush DetrendNorm alizeExposures-replace -key 1:2 "RUN $line"319 320 # the DetrendNorm alizeExposuresqueue contains:388 queuepush DetrendNormExp -replace -key 1:2 "RUN $line" 389 390 # the DetrendNormExp queue contains: 321 391 # STATE DET_ID ITER 322 392 list word -split $line … … 330 400 331 401 # XXX add $WORKDIR/$LOG_DIR 332 stdout $ CAMERA.$DET_TYPE.$DET_ID.$ITER.log333 stderr $ CAMERA.$DET_TYPE.$DET_ID.$ITER.log402 stdout $LOGSUBDIR/$CAMERA.$DET_TYPE.$DET_ID.$ITER.log 403 stderr $LOGSUBDIR/$CAMERA.$DET_TYPE.$DET_ID.$ITER.log 334 404 335 405 # specify choice of remote host: … … 342 412 # create example job options as a demonstration 343 413 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 345 417 command detrend_norm_exp.pl --det_id $DET_ID --iteration $ITER --camera $CAMERA --det_type $DET_TYPE 346 418 end … … 348 420 # success 349 421 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 442 end -
trunk/ippTasks/detrend.process.pro
r10542 r10692 22 22 end 23 23 24 $DetrendProcessImfileFail = 0 25 $DetrendProcessExpFail = 0 26 27 if ($?VERBOSE == 0) 28 echo "VERBOSE not defined: load pantasks.pro first" 29 break 30 end 31 if ($?LOGDIR == 0) 32 echo "LOGDIR not defined: load pantasks.pro first" 33 break 34 end 35 $LOGSUBDIR = $LOGDIR/detrend 36 exec mkdir -p $LOGSUBDIR 37 38 macro detproc.status 39 queueprint DetrendProcessImfiles 40 queueprint DetrendProcessExposures 41 echo "DetrendProcessImfileFail: $DetrendProcessImfileFail" 42 echo "DetrendProcessExpFail: $DetrendProcessExpFail" 43 end 44 24 45 # select images ready for copy 25 46 # new entries are added to queue DetrendProcessImfiles 26 47 # compare the new list with the ones already selected 27 48 task dettool.process.load 28 command dettool -toprocessedimfile -simple29 49 host local 30 50 … … 33 53 periods -timeout 30 34 54 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 37 61 38 62 # success … … 47 71 for i 0 $Nqueue 48 72 queuepop stdout -var line 73 if ($VERBOSE > 2) 74 echo $line 75 end 49 76 list word -split $line 50 77 $DET_ID = $word:0 … … 64 91 # error 65 92 task.exit default 66 echo "detrend.process: failure" 93 if ($VERBOSE) 94 echo "detrend.process: failure" 95 end 67 96 end 68 97 69 98 # operation times out? 70 99 task.exit timeout 71 echo "detrend.process: timeout" 100 if ($VERBOSE) 101 echo "detrend.process: timeout" 102 end 72 103 end 73 104 end … … 105 136 $CAMERA = $word:6 106 137 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 110 144 111 145 # specify choice of remote host: … … 118 152 # create example job options as a demonstration 119 153 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 121 157 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 122 158 end … … 130 166 # default exit status 131 167 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 133 171 queuepush DetrendProcessImfiles -replace -key 1:3:5 "FAIL $options:0" 172 $DetrendProcessImfileFail ++ 134 173 end 135 174 136 175 # operation times out? 137 176 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 141 183 end 142 184 … … 145 187 # compare the new list with the ones already selected 146 188 task dettool.processexp.load 147 command dettool -toprocessedexp -simple148 189 host local 149 190 … … 152 193 periods -timeout 30 153 194 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 156 201 157 202 # success … … 166 211 for i 0 $Nqueue 167 212 queuepop stdout -var line 213 if ($VERBOSE > 2) 214 echo $line 215 end 168 216 list word -split $line 169 217 $DET_ID = $word:0 … … 181 229 # error 182 230 task.exit default 183 echo "detrend.process: failure" 231 if ($VERBOSE) 232 echo "detrend.process: failure" 233 end 184 234 end 185 235 186 236 # operation times out? 187 237 task.exit timeout 188 echo "detrend.process: timeout" 238 if ($VERBOSE) 239 echo "detrend.process: timeout" 240 end 189 241 end 190 242 end … … 210 262 queuepush DetrendProcessExposures -replace -key 1:2:4 "RUN $line" 211 263 212 213 264 list word -split $line 214 265 $DET_ID = $word:0 … … 218 269 $CAMERA = $word:4 219 270 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 224 279 225 280 # specify choice of remote host: … … 232 287 # create example job options as a demonstration 233 288 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 235 292 command detrend_process_exp.pl --det_id $DET_ID --exp_tag $EXP_TAG --camera $CAMERA 236 293 end … … 243 300 # default exit status 244 301 task.exit default 302 if ($VERBOSE) 303 echo "failure for detrend_process_exp.pl: $options:0" 304 end 245 305 queuepush DetrendProcessExposures -replace -key 1:2:4 "FAIL $options:0" 306 $DetrendProcessExpFail ++ 246 307 end 247 308 248 309 # operation times out? 249 310 task.exit timeout 311 if ($VERBOSE) 312 echo "failure for detrend_process_exp.pl: $options:0" 313 end 250 314 queuepush DetrendProcessExposures -replace -key 1:2:4 "TIMEOUT $options:0" 251 end 252 end 315 $DetrendProcessExpFail ++ 316 end 317 end -
trunk/ippTasks/detrend.reject.pro
r10542 r10692 13 13 ## STATE DET_ID ITER TYPE 14 14 15 queueinit DetrendRejectExp osure15 queueinit DetrendRejectExp 16 16 if ($?network == 0) 17 17 $network = 1 … … 21 21 end 22 22 23 $DetrendRejectExpFail = 0 24 25 if ($?VERBOSE == 0) 26 echo "VERBOSE not defined: load pantasks.pro first" 27 break 28 end 29 if ($?LOGDIR == 0) 30 echo "LOGDIR not defined: load pantasks.pro first" 31 break 32 end 33 $LOGSUBDIR = $LOGDIR/detrend 34 exec mkdir -p $LOGSUBDIR 35 36 macro detreject.status 37 queueprint DetrendRejectExp 38 echo "DetrendRejectExpFail: $DetrendRejectExpFail" 39 end 40 23 41 # select images ready for copy 24 # new entries are added to queue DetrendRejectExp osure42 # new entries are added to queue DetrendRejectExp 25 43 # compare the new list with the ones already selected 26 44 task dettool.reject.load 27 command dettool -residdetrun -simple28 45 host local 29 46 … … 32 49 periods -timeout 30 33 50 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 36 57 37 58 # success … … 44 65 for i 0 $Nqueue 45 66 queuepop stdout -var line 67 if ($VERBOSE > 2) 68 echo $line 69 end 46 70 list word -split $line 47 71 $DET_ID = $word:0 … … 50 74 $MODE = $word:3 51 75 $CAMERA = $word:4 52 queuepush DetrendRejectExp osure-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" 53 77 end 54 78 55 79 # delete existing entries which are DONE 56 queuedrop DetrendRejectExp osure-key 0 DONE80 queuedrop DetrendRejectExp -key 0 DONE 57 81 end 58 82 59 83 # locked list 60 84 task.exit default 61 echo "detrend.reject: failure" 85 if ($VERBOSE) 86 echo "detrend.reject: failure" 87 end 62 88 end 63 89 64 90 # operation times out? 65 91 task.exit timeout 66 echo "detrend.reject: timeout" 92 if ($VERBOSE) 93 echo "detrend.reject: timeout" 94 end 67 95 end 68 96 end … … 75 103 76 104 task.exec 77 queuesize DetrendRejectExp osure-var N105 queuesize DetrendRejectExp -var N 78 106 if ($N == 0) break 79 107 if ($network == 0) break 80 108 81 # look for new images on the internal DetrendRejectExp osurequeue109 # look for new images on the internal DetrendRejectExp queue 82 110 # caution with these 'if' statements: syntax errors 83 111 # will make the task fail without given a good status 84 queuepop DetrendRejectExp osure-var line -key 0 NEW112 queuepop DetrendRejectExp -var line -key 0 NEW 85 113 if ("$line" == "NULL") break 86 114 87 115 strpop line state 88 queuepush DetrendRejectExp osure-replace -key 1:2 "RUN $line"116 queuepush DetrendRejectExp -replace -key 1:2 "RUN $line" 89 117 90 ## the DetrendRejectExp osurequeue contains:118 ## the DetrendRejectExp queue contains: 91 119 ## STATE DET_ID ITER TYPE 92 120 ## NOTE: the queue has the STATE prepended … … 98 126 99 127 # I'd like to add CAMERA to the log file... 100 stdout $ CAMERA.$DET_TYPE.$DET_ID.$ITER.log101 stderr $ CAMERA.$DET_TYPE.$DET_ID.$ITER.log128 stdout $LOGSUBDIR/$CAMERA.$DET_TYPE.$DET_ID.$ITER.log 129 stderr $LOGSUBDIR/$CAMERA.$DET_TYPE.$DET_ID.$ITER.log 102 130 103 131 # specify choice of remote host: … … 110 138 # create example job options as a demonstration 111 139 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 113 143 command detrend_reject_exp.pl --det_id $DET_ID --iteration $ITER --det_type $DET_TYPE --camera $CAMERA 114 144 end … … 116 146 # success 117 147 task.exit 0 118 queuepush DetrendRejectExp osure-replace -key 1:2 "DONE $options:0"148 queuepush DetrendRejectExp -replace -key 1:2 "DONE $options:0" 119 149 end 120 150 121 151 # default exit status 122 152 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 ++ 124 158 end 125 159 126 160 # operation times out? 127 161 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 ++ 129 167 end 130 168 end -
trunk/ippTasks/detrend.resid.pro
r10543 r10692 23 23 end 24 24 25 $DetrendResidImfileFail = 0 26 $DetrendResidExpFail = 0 27 28 if ($?VERBOSE == 0) 29 echo "VERBOSE not defined: load pantasks.pro first" 30 break 31 end 32 if ($?LOGDIR == 0) 33 echo "LOGDIR not defined: load pantasks.pro first" 34 break 35 end 36 $LOGSUBDIR = $LOGDIR/detrend 37 exec mkdir -p $LOGSUBDIR 38 39 macro detresid.status 40 queueprint DetrendResidImfiles 41 queueprint DetrendResidExposures 42 echo "DetrendResidImfileFail: $DetrendResidImfileFail" 43 echo "DetrendResidExpFail: $DetrendResidExpFail" 44 end 45 25 46 # select images ready for copy 26 47 # new entries are added to queue DetrendResidImfiles 27 48 # compare the new list with the ones already selected 28 49 task dettool.resid.load 29 command dettool -toresidimfile -simple30 50 host local 31 51 … … 34 54 periods -timeout 30 35 55 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 38 62 39 63 # success … … 48 72 for i 0 $Nqueue 49 73 queuepop stdout -var line 74 if ($VERBOSE > 2) 75 echo $line 76 end 50 77 list word -split $line 51 78 $DET_ID = $word:0 … … 70 97 # default exit status 71 98 task.exit default 72 echo "detrend.resid: failure" 99 if ($VERBOSE) 100 echo "detrend.resid: failure" 101 end 73 102 end 74 103 75 104 # operation times out? 76 105 task.exit timeout 77 echo "detrend.resid: timeout" 106 if ($VERBOSE) 107 echo "detrend.resid: timeout" 108 end 78 109 end 79 110 end … … 113 144 $CAMERA = $word:8 114 145 115 $ DET_DIR = `dirname $URI_IN`116 $LOG_DIR = $WORKDIR/$DET_DIR117 118 stdout $LOG _DIR/$EXP_TAG.detresid.$DET_ID.$ITER.$CLASS_ID.log119 stderr $LOG _DIR/$EXP_TAG.detresid.$DET_ID.$ITER.$CLASS_ID.log146 $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 120 151 121 152 # specify choice of remote host: … … 130 161 # detrend_create_resid.pl DET_ID ITER EXP_TAG CLASS_ID TYPE (URI-DET) (URL-IN) (EXP_TAG ???) 131 162 # need to parse the subdir path for the detrend URL 132 $DET_URL = $DET_DIR/$CAMERA.$DET_TYPE.$DET_ID.$ITER.$CLASS_ID.fits133 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_UR L --input_uri $URI_IN--camera $CAMERA --mode $MODE134 command detrend_resid.pl --det_id $DET_ID --iteration $ITER --exp_tag $EXP_TAG --class_id $CLASS_ID --det_type $DET_TYPE --detrend $DET_UR L --input_uri $URI_IN--camera $CAMERA --mode $MODE163 # $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 135 166 end 136 167 … … 142 173 # default exit status 143 174 task.exit default 175 if ($VERBOSE) 176 echo "failure detrend_resid.pl $options:0" 177 end 144 178 queuepush DetrendResidImfiles -replace -key 1:2:5:6 "FAIL $options:0" 179 $DetrendResidImfileFail ++ 145 180 end 146 181 147 182 # operation times out? 148 183 task.exit timeout 184 if ($VERBOSE) 185 echo "failure detrend_resid.pl $options:0" 186 end 149 187 queuepush DetrendResidImfiles -replace -key 1:2:6:6 "TIMEOUT $options:0" 188 $DetrendResidImfileFail ++ 150 189 end 151 190 end … … 155 194 # compare the new list with the ones already selected 156 195 task dettool.residexp.load 157 command dettool -toresidexp -simple158 196 host local 159 197 … … 162 200 periods -timeout 30 163 201 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 166 208 167 209 # success … … 176 218 for i 0 $Nqueue 177 219 queuepop stdout -var line 220 if ($VERBOSE > 2) 221 echo $line 222 end 178 223 list word -split $line 179 224 $DET_ID = $word:0 … … 194 239 # default exit status 195 240 task.exit default 196 echo "detrend.residexp: failure" 241 if ($VERBOSE) 242 echo "detrend.residexp: failure" 243 end 197 244 end 198 245 199 246 # operation times out? 200 247 task.exit timeout 201 echo "detrend.residexp: timeout" 248 if ($VERBOSE) 249 echo "detrend.residexp: timeout" 250 end 202 251 end 203 252 end … … 235 284 $CAMERA = $word:6 236 285 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 240 294 241 295 # specify choice of remote host: … … 248 302 # create example job options as a demonstration 249 303 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 251 307 command detrend_reject_imfile.pl --det_id $DET_ID --iteration $ITER --exp_tag $EXP_TAG --det_type $DET_TYPE --camera $CAMERA 252 308 end … … 259 315 # default exit status 260 316 task.exit default 317 if ($VERBOSE) 318 echo "failure for detrend_reject_imfile.pl: $options:0" 319 end 261 320 queuepush DetrendResidExposures -replace -key 1:2:5 "FAIL $options:0" 321 $DetrendResidExpFail ++ 262 322 end 263 323 264 324 # operation times out? 265 325 task.exit timeout 326 if ($VERBOSE) 327 echo "failure for detrend_reject_imfile.pl: $options:0" 328 end 266 329 queuepush DetrendResidExposures -replace -key 1:2:5 "TIMEOUT $options:0" 267 end 268 end 330 $DetrendResidExpFail ++ 331 end 332 end -
trunk/ippTasks/detrend.stack.pro
r9506 r10692 9 9 # detrend_stack.pl 1 0 mc bias 10 10 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: 15 13 ## STATE DET_ID ITER TYPE CLASS_ID CAMERA 16 14 … … 23 21 end 24 22 23 $DetrendStackClassFail = 0 24 25 if ($?VERBOSE == 0) 26 echo "VERBOSE not defined: load pantasks.pro first" 27 break 28 end 29 if ($?LOGDIR == 0) 30 echo "LOGDIR not defined: load pantasks.pro first" 31 break 32 end 33 $LOGSUBDIR = $LOGDIR/detrend 34 exec mkdir -p $LOGSUBDIR 35 36 macro detstack.status 37 queueprint DetrendStackClass 38 echo "DetrendStackClassFail: $DetrendStackClassFail" 39 end 40 25 41 # select images ready for copy 26 42 # new entries are added to queue DetrendStackClass 27 43 # compare the new list with the ones already selected 28 44 task dettool.stack.load 29 command dettool -tostacked -simple30 45 host local 31 46 … … 34 49 periods -timeout 30 35 50 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 38 57 39 58 # success … … 46 65 for i 0 $Nqueue 47 66 queuepop stdout -var line 67 if ($VERBOSE > 2) 68 echo $line 69 end 48 70 list word -split $line 49 71 $DET_ID = $word:0 … … 61 83 # locked list 62 84 task.exit default 63 echo "detrend.stack: failure" 85 if ($VERBOSE) 86 echo "detrend.stack: failure" 87 end 64 88 end 65 89 66 90 # operation times out? 67 91 task.exit timeout 68 echo "detrend.stack: timeout" 92 if ($VERBOSE) 93 echo "detrend.stack: timeout" 94 end 69 95 end 70 96 end … … 78 104 task.exec 79 105 queuesize DetrendStackClass -var N 80 81 106 if ($N == 0) break 82 107 if ($network == 0) break … … 103 128 104 129 # XXX add $WORKDIR/$LOG_DIR 105 stdout $ CAMERA.$DET_TYPE.$DET_ID.$ITER.$CLASS_ID.log106 stderr $ CAMERA.$DET_TYPE.$DET_ID.$ITER.$CLASS_ID.log130 stdout $LOGSUBDIR/$CAMERA.$DET_TYPE.$DET_ID.$ITER.$CLASS_ID.log 131 stderr $LOGSUBDIR/$CAMERA.$DET_TYPE.$DET_ID.$ITER.$CLASS_ID.log 107 132 108 133 # specify choice of remote host: … … 115 140 # create example job options as a demonstration 116 141 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 119 145 command detrend_stack.pl --det_id $DET_ID --iteration $ITER --class_id $CLASS_ID --det_type $DET_TYPE --camera $CAMERA 120 146 end … … 127 153 # default exit status 128 154 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 ++ 130 160 end 131 161 132 162 # operation times out? 133 163 task.exit timeout 164 if ($VERBOSE) 165 echo "failure detrend_stack.pl $options:0" 166 end 134 167 queuepush DetrendStackClass -replace -key 1:2:4 "TIMEOUT $options:0" 168 $DetrendStackClassFail ++ 135 169 end 136 170 end -
trunk/ippTasks/phase0.pro
r10691 r10692 40 40 # compare the new list with the ones already selected 41 41 task phase0.imfile.load 42 command p0tool -pendingimfile -simple43 42 host local 44 43 … … 83 82 echo "phase0 pending imfiles: failure" 84 83 end 85 $Phase0ImfileFail ++86 84 end 87 85 … … 93 91 end 94 92 end 93 94 95 95 96 96 # run the phase0imfile script on pending images … … 166 166 end 167 167 queuepush Phase0Imfiles -replace -key 1 "TIMEOUT $options:0" 168 end 169 end 168 $Phase0ImfileFail ++ 169 end 170 end 171 172 170 173 171 174 ## these tasks use the queue Phase0Exposures … … 199 202 for i 0 $Nqueue 200 203 queuepop stdout -var line 204 if ($VERBOSE > 2) 205 echo $line 206 end 201 207 list word -split $line 202 208 $EXP_TAG = $word:0 … … 228 234 end 229 235 end 236 237 230 238 231 239 # run the phase0imfile script on pending images … … 285 293 # default exit status 286 294 task.exit default 295 if ($VERBOSE) 296 echo "failure for phase0exp.pl: $options:0" 297 end 287 298 queuepush Phase0Exposures -replace -key 1 "FAIL $options:0" 288 299 $Phase0ExpFail … … 291 302 # operation times out? 292 303 task.exit timeout 304 if ($VERBOSE) 305 echo "failure for phase0exp.pl: $options:0" 306 end 293 307 queuepush Phase0Exposures -replace -key 1 "TIMEOUT $options:0" 308 $Phase0ExpFail 294 309 end 295 310 end
Note:
See TracChangeset
for help on using the changeset viewer.
