Changeset 19329
- Timestamp:
- Sep 2, 2008, 9:38:51 AM (18 years ago)
- File:
-
- 1 edited
-
trunk/ippTasks/flatcorr.pro (modified) (7 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ippTasks/flatcorr.pro
r16298 r19329 6 6 check.globals 7 7 8 $LOGSUBDIR = $LOGDIR/flatcorr 9 exec mkdir -p $LOGSUBDIR 10 11 book init flatcoorBook 8 book init flatcorrBook 12 9 13 10 macro flatcorr.reset … … 20 17 21 18 macro flatcorr.on 22 task flatcorr. init19 task flatcorr.load 23 20 active true 24 21 end 22 task flatcorr.run 23 active true 24 end 25 25 end 26 26 27 27 macro flatcorr.off 28 task flatcorr. init28 task flatcorr.load 29 29 active false 30 30 end 31 task flatcorr.run 32 active false 33 end 31 34 end 32 35 33 36 # these variables will cycle through the known ippdb database names 34 $calInit_DB = 0 35 36 # we have three steps here: 37 # 1) get the list of dvo databases: caltool -dbs 38 # 2) define a new flatcorr run for each of the dvo dbs 39 # caltool 37 $flatcorr_addcamera_DB = 0 38 $flatcorr_pendingprocess_DB = 0 39 40 # a flat-field correction run is initiated (manually) with a command like: 41 # flatcorr -definebyquery -filter r ... 42 # the result is a flatcorrRun entry, a set of chipRun entries, a linking list in flatcorrChipList. 43 # the chipRun entries are all set to stop at the "chip" stage. 44 45 # we also can define a run with: 46 # flatcorr -definerun 47 # flatcorr -addchip ... 48 49 # as the chip analysis progresses, we need to occasionally migrate the 50 # completed chips to the camera stage by calling: 51 # flatcorr -addcamera 52 53 # we wait for the completed chip and camera analysis and search for 54 # completed processing analysis with: 55 # flatcorr -pendingprocess 56 57 # these define arguments to an analysis run. successful completion of 58 # the analysis is marked with: 59 # flatcorr -addprocess 60 # and failures with: 61 # flatcorr -addprocess -fault N 62 63 # migrate complete flatcorr chips to the camera stage analysis 64 task flatcorr.addcamera 65 host local 66 67 # check the list of pending flatcorr runs 68 periods -poll 10 69 periods -exec 120 70 periods -timeout 60 71 npending 1 72 73 # define the command (does not depend on previous queries) 74 if ($DB:n == 0) 75 command flatcorr -addcamera 76 else 77 # save the DB name for the exit tasks 78 # note that this DB name refers to the ippdb, not the dvodb 79 option $DB:$flatcorr_addcamera_DB 80 command flatcorr -addcamera -dbname $DB:$flatcorr_addcamera_DB 81 $flatcorr_addcamera_DB ++ 82 if ($flatcorr_addcamera_DB >= $DB:n) set flatcorr_addcamera_DB = 0 83 end 84 85 # silently drop stdout 86 stdout NULL 87 stderr $LOGDIR/flatcorr.log 88 89 # success (no action required) 90 task.exit $EXIT_SUCCESS 91 end 92 93 # locked list 94 task.exit default 95 showcommand failure 96 end 97 98 # operation times out? 99 task.exit timeout 100 showcommand timeout 101 end 102 end 40 103 41 104 # create new flatcorr entries for the currently known DVO databases … … 52 115 # define the command (does not depend on previous queries) 53 116 if ($DB:n == 0) 54 command flatcorr -pending 117 command flatcorr -pendingprocess 55 118 else 56 119 # save the DB name for the exit tasks 57 # note that this DB name refers to the ippdb, not the dvodb 58 option $DB:$calInit_DB 59 command flatcorr -pending -dbname $DB:$calInit_DB 60 $calInit_DB ++ 61 if ($calInit_DB >= $DB:n) set calInit_DB = 0 120 option $DB:$flatcorr_pendingprocess_DB 121 command flatcorr -pendingprocess -dbname $DB:$flatcorr_pendingprocess_DB 122 $flatcorr_pendingprocess_DB ++ 123 if ($flatcorr_pendingprocess_DB >= $DB:n) set flatcorr_pendingprocess_DB = 0 62 124 end 63 125 64 126 # silently drop stdout 65 127 stdout NULL 66 stderr $LOG SUBDIR/flatcorr.log128 stderr $LOGDIR/flatcorr.log 67 129 68 130 # success 69 131 task.exit $EXIT_SUCCESS 70 # convert 'stdout' to book format 71 # XXX have ippTools report the dbname? 72 ipptool2book stdout flatcorrBook -key dbname:corr_id -uniq -setword dbname $options:0 -setword pantaskState INIT 132 ipptool2book stdout flatcorrBook -key corr_id -uniq -setword dbname $options:0 -setword pantaskState INIT 73 133 if ($VERBOSE > 2) 74 134 book listbook flatcorrBook … … 90 150 end 91 151 92 # create new flatcorr entries for the currently known DVO databases 93 # run this multiple times once an hour - one pass for each db 94 # can we include information that the db has been updated without a recent cal analysis? 152 # check for flatcorr runs which are ready to go 95 153 task flatcorr.run 96 154 host local … … 99 157 periods -exec $LOADEXEC 100 158 periods -timeout 60 101 # trange Hourly@00:00 Hourly@00:10102 # every hour on the hour103 npending 1104 159 105 160 # silently drop stdout 106 stdout NULL107 stderr $LOG SUBDIR/flatcorr.log161 stdout $LOGDIR/flatcorr.log 162 stderr $LOGDIR/flatcorr.log 108 163 109 164 task.exec … … 112 167 if ($NETWORK == 0) break 113 168 114 # look for new images in flatcorrBook 115 # the sequencing in this task set is by the pantasksState (see notes.txt) 169 # look for new entries in flatcorrBook 116 170 book getpage flatcorrBook 0 -var pageName -key pantaskState INIT 117 171 if ("$pageName" == "NULL") break 118 172 119 173 book setword flatcorrBook $pageName pantaskState RUN 120 book setword flatcorrBook $pageName region $REGION121 174 122 175 # XXX probably need to set the output / log based on WORKDIR... 123 book getword flatcorrBook $pageName c al_id-var ID176 book getword flatcorrBook $pageName corr_id -var ID 124 177 book getword flatcorrBook $pageName dvodb -var DVODB 125 178 book getword flatcorrBook $pageName region -var REGION 126 179 book getword flatcorrBook $pageName filter -var FILTER 127 180 book getword flatcorrBook $pageName dbname -var DBNAME 181 book getword flatcorrBook $pageName workdir -var WORKDIR 128 182 129 183 # specify choice of remote host … … 138 192 options $pageName 139 193 194 # XXX get these arguments right 140 195 $run = flatcorr_proc.pl --corr_id $ID --dvodb $DVODB --region $REGION --filter $FILTER 141 196 add_standard_args run
Note:
See TracChangeset
for help on using the changeset viewer.
