Changeset 9081 for trunk/ippTasks/detrend.resid.pro
- Timestamp:
- Sep 30, 2006, 12:27:01 PM (20 years ago)
- File:
-
- 1 edited
-
trunk/ippTasks/detrend.resid.pro (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ippTasks/detrend.resid.pro
r8691 r9081 13 13 ## the DetrendResidImfiles queue contains: 14 14 ## STATE ITER TYPE DET_ID EXP_KEY CLASS_ID URI_IN 15 16 queueinit DetrendResidImfiles 17 queueinit DetrendResidExp 18 if ($?network == 0) 19 $network = 1 20 end 21 if ($?parallel == 0) 22 $parallel = 0 23 end 15 24 16 25 # select images ready for copy … … 23 32 periods -poll 1 24 33 periods -exec 5 25 periods -timeout 30 34 periods -timeout 5 35 36 stdout dettool.resid.log 37 stderr dettool.resid.log 26 38 27 39 # success … … 38 50 list word -split $line 39 51 $ITER = $word:0 40 $ TYPE= $word:152 $DET_TYPE = $word:1 41 53 $DET_ID = $word:2 42 54 $EXP_KEY = $word:3 43 55 $CLASS_ID = $word:4 44 56 $URI_IN = $word:5 45 queuepush DetrendResidImfiles -uniq -key 1:3:4:5 "NEW $ITER $TYPE $DET_ID $EXP_KEY $CLASS_ID $URI_IN" 57 ## XXX need to include the detID and iter in the key (if we have two running at the same time...) 58 ## Also needed to be in the output file (or path) 59 queuepush DetrendResidImfiles -uniq -key 1:3:4:5 "NEW $ITER $DET_TYPE $DET_ID $EXP_KEY $CLASS_ID $URI_IN" 46 60 end 47 61 … … 69 83 task dettool.resid.process 70 84 periods -poll 0.5 71 periods -exec 1.072 periods -timeout 585 periods -exec 5.0 86 periods -timeout 15 73 87 74 88 task.exec … … 90 104 ## NOTE: the queue has the STATE prepended 91 105 list word -split $line 92 $ITER = $word:1 93 $TYPE = $word:2 94 $DET_ID = $word:3 95 $EXP_KEY = $word:4 96 $CLASS_ID = $word:5 97 $URI_IN = $word:6 106 $ITER = $word:0 107 $DET_TYPE = $word:1 108 $DET_ID = $word:2 109 $EXP_KEY = $word:3 110 $CLASS_ID = $word:4 111 $URI_IN = $word:5 112 113 stdout $EXP_KEY.detresid.$DET_ID.$ITER.$CLASS_ID.log 114 stderr $EXP_KEY.detresid.$DET_ID.$ITER.$CLASS_ID.log 98 115 99 116 # specify choice of remote host: 100 host anyhost 117 if ($parallel) 118 host anyhost 119 else 120 host local 121 end 101 122 102 123 # create example job options as a demonstration 103 124 options "$line" 104 125 # detrend_create_resid.pl DET_ID ITER EXP_KEY CLASS_ID TYPE (URI-DET) (URL-IN) (EXP_KEY ???) 105 $URL_DET = $TYPE\_$CLASS_ID\_$DET_ID\_$ITER.fit 106 command detrend_create_resid.pl $DET_ID $ITER $EXP_KEY $CLASS_ID $TYPE $URI_DET $URL_IN $EXP_KEY 126 $URL_DET = isp.$DET_TYPE.$DET_ID.$ITER.$CLASS_ID.fits 127 # $URL_DET = $CAMERA.$DET_TYPE.$DET_ID.$ITER.$CLASS_ID.fits 128 echo command detrend_create_resid.pl --det_id $DET_ID --iteration $ITER --exp_id $EXP_KEY --class_id $CLASS_ID --det_type $DET_TYPE --detrend $URL_DET --input_uri $URI_IN 129 command detrend_create_resid.pl --det_id $DET_ID --iteration $ITER --exp_id $EXP_KEY --class_id $CLASS_ID --det_type $DET_TYPE --detrend $URL_DET --input_uri $URI_IN 107 130 end 108 131 … … 119 142 # operation times out? 120 143 task.exit timeout 121 queuepush DetrendResidImfiles -replace -key 1:3:4:5 "FAIL $options:0" 122 end 123 end 144 queuepush DetrendResidImfiles -replace -key 1:3:4:5 "TIMEOUT $options:0" 145 end 146 end 147 148 # select images ready for copy 149 # new entries are added to queue DetrendResidExp 150 # compare the new list with the ones already selected 151 task dettool.residexp.load 152 command dettool -toresidexp -simple 153 host local 154 155 periods -poll 1 156 periods -exec 5 157 periods -timeout 5 158 159 stdout dettool.residexp.log 160 stderr dettool.residexp.log 161 162 # success 163 task.exit 0 164 # XXX is it necessary for these to be local? 165 # drop after this task macro is done? 166 local i Nqueue 167 168 # compare output with newImage queue 169 # only add entries which don't exist in queue 170 queuesize stdout -var Nqueue 171 for i 0 $Nqueue 172 queuepop stdout -var line 173 list word -split $line 174 $DET_ID = $word:0 175 $ITER = $word:1 176 $DET_TYPE = $word:2 177 $EXP_KEY = $word:3 178 $INCLUDE = $word:4 179 queuepush DetrendResidExp -uniq -key 1:2:4 "NEW $DET_ID $ITER $DET_TYPE $EXP_KEY $INCLUDE" 180 end 181 182 # delete existing entries which are DONE 183 queuedrop DetrendResidExp -key 0 DONE 184 end 185 186 # locked list 187 task.exit 1 188 echo "new.images: exec failure" 189 end 190 191 # default exit status 192 task.exit default 193 echo "new.images: unknown exit status: $EXIT" 194 end 195 196 # operation times out? 197 task.exit timeout 198 echo "new.images: timeout" 199 end 200 end 201 202 # copy new images, sending job to desired host 203 task dettool.residexp.process 204 periods -poll 0.5 205 periods -exec 5.0 206 periods -timeout 15 207 208 task.exec 209 queuesize DetrendResidExp -var N 210 if ($N == 0) break 211 if ($network == 0) break 212 213 # look for new images on the internal DetrendResidExp queue 214 # caution with these 'if' statements: syntax errors 215 # will make the task fail without given a good status 216 queuepop DetrendResidExp -var line -key 0 NEW 217 if ("$line" == "NULL") break 218 219 strpop line state 220 queuepush DetrendResidExp -replace -key 1:2:4 "RUN $line" 221 222 ## the DetrendResidExp queue contains: 223 ## STATE ITER TYPE DET_ID EXP_KEY CLASS_ID URI_IN 224 ## NOTE: the queue has the STATE prepended 225 list word -split $line 226 $DET_ID = $word:0 227 $ITER = $word:1 228 $DET_TYPE = $word:2 229 $EXP_KEY = $word:3 230 $INCLUDE = $word:4 231 232 stdout $EXP_KEY.detresid.$DET_ID.$ITER.log 233 stderr $EXP_KEY.detresid.$DET_ID.$ITER.log 234 235 # specify choice of remote host: 236 if ($parallel) 237 host anyhost 238 else 239 host local 240 end 241 242 # create example job options as a demonstration 243 options "$line" 244 echo command detrend_reject_imfile.pl --det_id $DET_ID --iteration $ITER --exp_id $EXP_KEY --det_type $DET_TYPE 245 command detrend_reject_imfile.pl --det_id $DET_ID --iteration $ITER --exp_id $EXP_KEY --det_type $DET_TYPE 246 end 247 248 # success 249 task.exit 0 250 queuepush DetrendResidExp -replace -key 1:2:4 "DONE $options:0" 251 end 252 253 # default exit status 254 task.exit default 255 queuepush DetrendResidExp -replace -key 1:2:4 "FAIL $options:0" 256 end 257 258 # operation times out? 259 task.exit timeout 260 queuepush DetrendResidExp -replace -key 1:2:4 "TIMEOUT $options:0" 261 end 262 end
Note:
See TracChangeset
for help on using the changeset viewer.
