Changeset 16275
- Timestamp:
- Feb 1, 2008, 1:42:29 PM (18 years ago)
- File:
-
- 1 edited
-
trunk/ippTasks/calibration.pro (modified) (7 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ippTasks/calibration.pro
r15313 r16275 1 1 ## this file contains the tasks for running the calibration stage 2 ## these tasks use the book s XXX2 ## these tasks use the book 'calBook' 3 3 4 4 if ($?network == 0) … … 42 42 end 43 43 44 # these variables will cycle through the known database names44 # these variables will cycle through the known ippdb database names 45 45 $calInit_DB = 0 46 47 # we have three steps here: 48 # 1) get the list of dvo databases: caltool -dbs 49 # 2) define a new calibration run for each of the dvo dbs 50 # caltool 46 51 47 52 # create new calibration entries for the currently known DVO databases 48 53 # run this multiple times once an hour - on pass for each db 49 task calibration. init54 task calibration.load 50 55 host local 51 56 52 periods -poll $loadpoll 53 periods -exec $loadexec 57 # check the list of available dvo dbs regularly 58 periods -poll 10 59 periods -exec 900 54 60 periods -timeout 60 55 trange Hourly@00:00 Hourly@00:1056 # every hour on the hour57 61 62 # this is a strange construction; what is the purpose? 58 63 if ($DB:n == 0) 59 64 npending $DB:n … … 62 67 end 63 68 69 # define the command (does not depend on previous queries) 70 if ($DB:n == 0) 71 command caltool -dbs -active true 72 else 73 # save the DB name for the exit tasks 74 # note that this DB name refers to the ippdb, not the dvodb 75 option $DB:$calInit_DB 76 command caltool -dbs -dbname $DB:$calInit_DB 77 $calInit_DB ++ 78 if ($calInit_DB >= $DB:n) set calInit_DB = 0 79 end 80 64 81 # silently drop stdout 65 82 stdout NULL 66 83 stderr $LOGSUBDIR/calibration.log 67 84 68 ## XXX have caltool define the regions, or have the task.exit below do it?69 70 # generate queues for all of the known (and active) DVO databases71 task.exec72 # get the current ST:73 $RAs = 15*($ST - 1)74 $RAe = 15*($ST - 2)75 $DECs = -90.076 $DECe = +90.077 78 $REGION = "$RAs,$RAe:$DECs,$DECe"79 80 if ($DB:n == 0)81 option DEFAULT82 command caltool -databases -active true83 else84 # save the DB name for the exit tasks85 option $DB:$calInit_DB86 option $REGION87 command caltool -databases -dbname $DB:$calInit_DB -region $REGION88 $calInit_DB ++89 if ($calInit_DB >= $DB:n) set calInit_DB = 090 end91 end92 93 85 # success 94 86 task.exit $EXIT_SUCCESS 95 87 # convert 'stdout' to book format 96 ipptool2book stdout calBook -key dbname:dvo_id -uniq -setword dbname $options:0 -setword region $options:1 -setword pantaskState INIT 88 # XXX have ippTools report the dbname? 89 ipptool2book stdout calBook -key dbname:cal_id -uniq -setword dbname $options:0 -setword pantaskState INIT 97 90 if ($VERBOSE > 2) 98 91 book listbook calBook … … 115 108 116 109 # create new calibration entries for the currently known DVO databases 117 # run this multiple times once an hour - on pass for each db 110 # run this multiple times once an hour - one pass for each db 111 # can we include information that the db has been updated without a recent cal analysis? 118 112 task calibration.resort 119 113 host local … … 122 116 periods -exec $loadexec 123 117 periods -timeout 60 118 # trange Hourly@00:00 Hourly@00:10 119 # every hour on the hour 124 120 npending 1 125 121 … … 138 134 if ("$pageName" == "NULL") break 139 135 136 # get the current ST: 137 $RAs = 15*($ST - 1) 138 $RAe = 15*($ST - 2) 139 $DECs = -90.0 140 $DECe = +90.0 141 142 $REGION = "$RAs,$RAe:$DECs,$DECe" 143 140 144 book setword calBook $pageName pantaskState RUN 145 book setword calBook $pageName region $REGION 141 146 142 147 # XXX probably need to set the output / log based on WORKDIR... 143 book getword calBook $pageName ca tdir -var CATDIR144 book getword calBook $pageName region -var REGION145 book getword calBook $pageName dbname -var DBNAME148 book getword calBook $pageName cal_id -var ID 149 book getword calBook $pageName dvodb -var DVODB 150 book getword calBook $pageName dbname -var DBNAME 146 151 147 152 # specify choice of remote host 153 # set a specific DVO host here 148 154 if ($parallel) 149 155 host anyhost … … 152 158 end 153 159 154 ## XXX generate output log based on filerule?155 ## XXX put this in a function?156 157 160 # save the pageName for future reference below 158 161 options $pageName 159 162 160 163 # XXX do we modify relphot to loop over the filters? 161 $run = calibrate_dvo.pl --ca tdir $CATDIR--region $REGION164 $run = calibrate_dvo.pl --cal_id $ID --dvodb $DVODB --region $REGION 162 165 add_standard_args run 163 166
Note:
See TracChangeset
for help on using the changeset viewer.
