Changeset 16610
- Timestamp:
- Feb 22, 2008, 10:19:22 AM (18 years ago)
- Location:
- trunk/ippTasks
- Files:
-
- 2 edited
-
automate.pro (modified) (17 diffs)
-
simtest.auto (modified) (7 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ippTasks/automate.pro
r16570 r16610 1 ## mkdetrend.pro : autorun the detrend analysis : -*- sh -*-1 ## automate.pro : autorun the detrend analysis : -*- sh -*- 2 2 3 3 # example automation stage … … 30 30 end 31 31 32 macro automate.on 33 task automate.block 34 active true 35 end 36 task automate.check 37 active true 38 end 39 task automate.launch 40 active true 41 end 42 end 43 44 macro automate.off 45 task automate.block 46 active false 47 end 48 task automate.check 49 active false 50 end 51 task automate.launch 52 active false 53 end 54 end 55 32 56 $automate_Nblock = -1 33 57 task automate.block … … 46 70 book npages automate -var Npage -key pantaskState INIT.BLOCK 47 71 if ($Npage == 0) 48 echo "no entries in INIT.BLOCK state" 72 if ($VERBOSE >= 2) 73 echo "no entries in INIT.BLOCK state" 74 end 49 75 break 50 76 end … … 53 79 $automate_Nblock ++ 54 80 if ($automate_Nblock >= $Npage) set automate_Nblock = 0 55 echo "automate.block $automate_Nblock"56 81 57 82 # search the automate book for an entry which is unstarted (state INIT.BLOCK) 58 83 book getpage automate $automate_Nblock -var pageName -key pantaskState INIT.BLOCK 59 84 if ("$pageName" == "NULL") 60 echo "entry $automate_Nblock not in INIT.BLOCK state" 85 if ($VERBOSE >= 2) 86 echo "entry $automate_Nblock not in INIT.BLOCK state" 87 end 61 88 break 62 89 end … … 66 93 # if there is no block needed, we can immediate progress to the next stage (INIT.CHECK) 67 94 book setword automate $pageName pantaskState INIT.CHECK 68 echo "$pageName is ready : INIT.CHECK" 95 if ($VERBOSE >= 2) 96 echo "$pageName is ready : INIT.CHECK" 97 end 69 98 break 70 99 end … … 72 101 book setword automate $pageName pantaskState RUN.BLOCK 73 102 74 if ($VERBOSE >= 1)103 if ($VERBOSE >= 2) 75 104 echo "starting automate block for $pageName" 76 105 echo "command $blockCommand" … … 86 115 $pageName = $options:0 87 116 88 echo "complete $pageName test, checking results"89 90 117 # convert 'stdout' to book format 91 118 # XXX to use other tests, we'll need to modify this 92 ipptool2book stdout detExp -key det_id -uniq119 ipptool2book stdout tmpBlock 93 120 if ($VERBOSE > 2) 94 book listbook detExp121 book listbook tmpBlock 95 122 end 96 123 97 124 # if the block test returns any valid pages (valid results), the block is set, don't move to check 98 book npages detExp -var Npage 99 if ($Npage == 0) 100 echo "$pageName is not blocked, ready for CHECK" 125 book npages tmpBlock -var Npage 126 if ($Npage == 0) 127 if ($VERBOSE >= 2) 128 echo "$pageName is not blocked, ready for CHECK" 129 end 101 130 book setword automate $pageName pantaskState INIT.CHECK 102 131 else 103 echo "$pageName is blocked, not ready for CHECK" 132 if ($VERBOSE >= 2) 133 echo "$pageName is blocked, not ready for CHECK" 134 end 104 135 book setword automate $pageName pantaskState INIT.BLOCK 105 136 end 106 137 107 138 # drop the detExt book after we've grabbed the state 108 book delete detExp139 book delete tmpBlock 109 140 end 110 141 … … 136 167 book npages automate -var Npage -key pantaskState INIT.CHECK 137 168 if ($Npage == 0) 138 echo "no entries in INIT.CHECK state" 169 if ($VERBOSE >= 2) 170 echo "no entries in INIT.CHECK state" 171 end 139 172 break 140 173 end … … 143 176 $automate_Ncheck ++ 144 177 if ($automate_Ncheck >= $Npage) set automate_Ncheck = 0 145 echo "automate.check $automate_Ncheck"146 178 147 179 # search the automate book for an entry which is unstarted (state INIT.CHECK) 148 180 book getpage automate $automate_Ncheck -var pageName -key pantaskState INIT.CHECK 149 181 if ("$pageName" == "NULL") 150 echo "entry $automate_Ncheck not in INIT.CHECK state" 182 if ($VERBOSE >= 2) 183 echo "entry $automate_Ncheck not in INIT.CHECK state" 184 end 151 185 break 152 186 end … … 156 190 # if there is no check needed, we can immediate progress to the next stage (INIT.LAUNCH) 157 191 book setword automate $pageName pantaskState INIT.LAUNCH 158 echo "$pageName is ready : INIT.LAUNCH" 192 if ($VERBOSE >= 2) 193 echo "$pageName is ready : INIT.LAUNCH" 194 end 159 195 break 160 196 end … … 162 198 book setword automate $pageName pantaskState RUN.CHECK 163 199 164 if ($VERBOSE >= 1)200 if ($VERBOSE >= 2) 165 201 echo "starting automate check for $pageName" 166 202 echo "command $checkCommand" … … 176 212 $pageName = $options:0 177 213 178 echo "complete $pageName test, checking results"179 180 214 # convert 'stdout' to book format 181 215 # XXX to use other tests, we'll need to modify this 182 ipptool2book stdout detExp -key det_id -uniq216 ipptool2book stdout tmpCheck 183 217 if ($VERBOSE > 2) 184 book listbook detExp 185 end 186 187 book npages detExp -var Npage 188 if ($Npage == 0) 189 echo "$pageName not ready for LAUNCH" 218 book listbook tmpCheck 219 end 220 221 book npages tmpCheck -var Npage 222 if ($Npage == 0) 223 if ($VERBOSE >= 2) 224 echo "$pageName not ready for LAUNCH" 225 end 190 226 book setword automate $pageName pantaskState INIT.CHECK 191 227 else 192 echo "$pageName is ready for LAUNCH" 228 if ($VERBOSE >= 2) 229 echo "$pageName is ready for LAUNCH" 230 end 193 231 book setword automate $pageName pantaskState INIT.LAUNCH 194 232 end 195 233 196 234 # drop the detExt book after we've grabbed the state 197 book delete detExp235 book delete tmpCheck 198 236 end 199 237 … … 225 263 book npages automate -var Npage -key pantaskState INIT.LAUNCH 226 264 if ($Npage == 0) 227 echo "no entries in INIT.LAUNCH state" 265 if ($VERBOSE >= 2) 266 echo "no entries in INIT.LAUNCH state" 267 end 228 268 break 229 269 end … … 232 272 $automate_Nlaunch ++ 233 273 if ($automate_Nlaunch >= $Npage) set automate_Nlaunch = 0 234 echo "automate.launch $automate_Nlaunch"235 274 236 275 # search the automate book for an entry which is unstarted (state INIT.LAUNCH) 237 276 book getpage automate $automate_Nlaunch -var pageName -key pantaskState INIT.LAUNCH 238 277 if ("$pageName" == "NULL") 239 echo "entry $automate_Nlaunch not in INIT.LAUNCH state" 278 if ($VERBOSE >= 2) 279 echo "entry $automate_Nlaunch not in INIT.LAUNCH state" 280 end 240 281 break 241 282 end … … 245 286 # if there is no launch needed, we can immediate progress to the next stage (INIT.LAUNCH) 246 287 book setword automate $pageName pantaskState INIT.LAUNCH 247 echo "$pageName is ready : INIT.LAUNCH" 288 if ($VERBOSE >= 2) 289 echo "$pageName is ready : INIT.LAUNCH" 290 end 248 291 break 249 292 end … … 251 294 book setword automate $pageName pantaskState RUN.LAUNCH 252 295 253 if ($VERBOSE >= 1)296 if ($VERBOSE >= 2) 254 297 echo "starting automate launch for $pageName" 255 298 echo "command $launchCommand" … … 265 308 $pageName = $options:0 266 309 267 echo "completed $pageName launch"268 310 book setword automate $pageName pantaskState DONE.LAUNCH 269 311 end -
trunk/ippTasks/simtest.auto
r16570 r16610 4 4 automate METADATA 5 5 name STR BIAS 6 block STR "dettool -runs - det_type BIAS -dbname eamtest"6 block STR "dettool -runs -active -det_type BIAS -dbname eamtest" 7 7 check STR NONE 8 8 launch STR "dettool -definebyquery -workdir path://EAMWORK -inst SIMTEST -det_type BIAS -select_exp_type BIAS -dbname eamtest" … … 11 11 automate METADATA 12 12 name STR DARK 13 block STR "dettool -runs - det_type DARK -dbname eamtest"13 block STR "dettool -runs -active -det_type DARK -dbname eamtest" 14 14 check STR "detselect -search -inst SIMTEST -det_type BIAS -dbname eamtest" 15 15 launch STR "dettool -definebyquery -workdir path://EAMWORK -inst SIMTEST -det_type DARK -select_exp_type DARK -dbname eamtest" … … 18 18 automate METADATA 19 19 name STR SHUTTER 20 block STR "dettool -runs - det_type SHUTTER -dbname eamtest"20 block STR "dettool -runs -active -det_type SHUTTER -dbname eamtest" 21 21 check STR "detselect -search -inst SIMTEST -det_type DARK -dbname eamtest" 22 22 launch STR "dettool -definebyquery -workdir path://EAMWORK -inst SIMTEST -det_type SHUTTER -filter r -select_exp_type FLAT -select_filter r -dbname eamtest" … … 25 25 automate METADATA 26 26 name STR FLAT-r 27 block STR "dettool -runs - det_type FLAT -filter r -dbname eamtest"27 block STR "dettool -runs -active -det_type FLAT -filter r -dbname eamtest" 28 28 check STR "detselect -search -inst SIMTEST -det_type SHUTTER -dbname eamtest" 29 29 launch STR "dettool -definebyquery -workdir path://EAMWORK -inst SIMTEST -det_type FLAT -filter r -select_exp_type FLAT -select_filter r -dbname eamtest" … … 32 32 automate METADATA 33 33 name STR FLAT-i 34 block STR "dettool -runs - det_type FLAT -filter i -dbname eamtest"34 block STR "dettool -runs -active -det_type FLAT -filter i -dbname eamtest" 35 35 check STR "detselect -search -inst SIMTEST -det_type SHUTTER -dbname eamtest" 36 36 launch STR "dettool -definebyquery -workdir path://EAMWORK -inst SIMTEST -det_type FLAT -filter i -select_exp_type FLAT -select_filter i -dbname eamtest" … … 39 39 automate METADATA 40 40 name STR OBJECT-r 41 block STR "chiptool - block-label object.r -dbname eamtest"41 block STR "chiptool -unmasked -label object.r -dbname eamtest" 42 42 check STR "detselect -search -inst SIMTEST -det_type FLAT -dbname eamtest -filter r" 43 43 launch STR "chiptool -unblock -label object.r -dbname eamtest" … … 46 46 automate METADATA 47 47 name STR OBJECT-i 48 block STR "chiptool - block-label object.i -dbname eamtest"48 block STR "chiptool -unmasked -label object.i -dbname eamtest" 49 49 check STR "detselect -search -inst SIMTEST -det_type FLAT -dbname eamtest -filter i" 50 50 launch STR "chiptool -unblock -label object.i -dbname eamtest" 51 51 END 52 52 53 ### there is a weakness in the label / block business: the labels are 54 ### generic, and the blocks are against those fairly generic words. 55 ### that makes it difficult to block and unblock science exposures 56 ### based on different detrend types that are available. For example, 57 ### to block the r-band against the absence of the desired r-band 58 ### flat, we would need to specify a label specific to the r-band 59 ### images and remove that block when ready. 60 61 ### a better approach might be to modify the labels rather than the 62 ### blocks. we can define, eg, chiptool -set_label -definebyquery to 63 ### turn assign the label names based on various properties of the 64 ### interesting images. 65 66 ### here is what the automate element might look like for such a circumstance: 67 68 ### automate METADATA 69 ### name STR OBJECT-i 70 ### block STR "chiptool -dbname eamtest -unmasked -label wait -filter i -time_begin 2008/1/1 -time_end 2008/1/2" 71 ### check STR "detselect -dbname eamtest -search -inst SIMTEST -det_type FLAT -dbname eamtest -filter i -time_begin 2008/1/1 -time_end 2008/1/2" 72 ### launch STR "chiptool -dbname eamtest -set_label proc -label wait -dbname eamtest -time_begin 2008/1/1 -time_end 2008/1/2" 73 ### END 74 75 ### XXX still not quite there....
Note:
See TracChangeset
for help on using the changeset viewer.
