IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 16275


Ignore:
Timestamp:
Feb 1, 2008, 1:42:29 PM (18 years ago)
Author:
eugene
Message:

cleanups to use actual caltool commands

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/ippTasks/calibration.pro

    r15313 r16275  
    11## this file contains the tasks for running the calibration stage
    2 ## these tasks use the books XXX
     2## these tasks use the book 'calBook'
    33
    44if ($?network == 0)
     
    4242end
    4343
    44 # these variables will cycle through the known database names
     44# these variables will cycle through the known ippdb database names
    4545$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
    4651
    4752# create new calibration entries for the currently known DVO databases
    4853# run this multiple times once an hour - on pass for each db
    49 task           calibration.init
     54task           calibration.load
    5055  host         local
    5156
    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
    5460  periods      -timeout 60
    55   trange        Hourly@00:00 Hourly@00:10
    56   # every hour on the hour
    5761
     62  # this is a strange construction; what is the purpose?
    5863  if ($DB:n == 0)
    5964    npending $DB:n
     
    6267  end
    6368
     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
    6481  # silently drop stdout
    6582  stdout NULL
    6683  stderr $LOGSUBDIR/calibration.log
    6784
    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 databases
    71   task.exec
    72     # get the current ST:
    73     $RAs = 15*($ST - 1)
    74     $RAe = 15*($ST - 2)
    75     $DECs = -90.0
    76     $DECe = +90.0
    77 
    78     $REGION = "$RAs,$RAe:$DECs,$DECe"
    79 
    80     if ($DB:n == 0)
    81       option DEFAULT
    82       command caltool -databases -active true
    83     else
    84       # save the DB name for the exit tasks
    85       option $DB:$calInit_DB
    86       option $REGION
    87       command caltool -databases -dbname $DB:$calInit_DB -region $REGION
    88       $calInit_DB ++
    89       if ($calInit_DB >= $DB:n) set calInit_DB = 0
    90     end
    91   end
    92 
    9385  # success
    9486  task.exit $EXIT_SUCCESS
    9587    # 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
    9790    if ($VERBOSE > 2)
    9891      book listbook calBook
     
    115108
    116109# 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?
    118112task           calibration.resort
    119113  host         local
     
    122116  periods      -exec $loadexec
    123117  periods      -timeout 60
     118  # trange     Hourly@00:00 Hourly@00:10
     119  # every hour on the hour
    124120  npending     1
    125121
     
    138134    if ("$pageName" == "NULL") break
    139135
     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
    140144    book setword calBook $pageName pantaskState     RUN
     145    book setword calBook $pageName region           $REGION
    141146
    142147    # XXX probably need to set the output / log based on WORKDIR...
    143     book getword calBook $pageName catdir -var CATDIR
    144     book getword calBook $pageName region -var REGION
    145     book getword calBook $pageName dbname -var DBNAME
     148    book getword calBook $pageName cal_id      -var ID
     149    book getword calBook $pageName dvodb       -var DVODB
     150    book getword calBook $pageName dbname      -var DBNAME
    146151
    147152    # specify choice of remote host
     153    # set a specific DVO host here
    148154    if ($parallel)
    149155      host anyhost
     
    152158    end
    153159
    154     ## XXX generate output log based on filerule?
    155     ## XXX put this in a function?
    156 
    157160    # save the pageName for future reference below
    158161    options $pageName
    159162
    160163    # XXX do we modify relphot to loop over the filters?
    161     $run = calibrate_dvo.pl --catdir $CATDIR --region $REGION
     164    $run = calibrate_dvo.pl --cal_id $ID --dvodb $DVODB --region $REGION
    162165    add_standard_args run
    163166
Note: See TracChangeset for help on using the changeset viewer.