IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Jan 26, 2007, 1:39:42 PM (19 years ago)
Author:
eugene
Message:

added multi-db support and workdirs to tasks

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/ippTasks/detrend.process.pro

    r11210 r11323  
    2727  book listbook detPendingProcessedExp
    2828end
     29
     30# these variables will cycle through the known database names
     31$detPendingProcessedImfile_DB = 0
     32$detPendingProcessedExp_DB = 0
    2933
    3034# select images ready for copy
     
    4246
    4347  task.exec
    44     command dettool -toprocessedimfile -limit 20
     48    if ($DB:n == 0)
     49      option DEFAULT
     50      command dettool -toprocessedimfile -limit 20
     51    else
     52      # save the DB name for the exit tasks
     53      option $DB:$detPendingProcessedImfile_DB
     54      command dettool -toprocessedimfile -limit 20 -dbname $DB:$detPendingProcessedImfile_DB
     55      $detPendingProcessedImfile_DB ++
     56      if ($detPendingProcessedImfile_DB >= $DB:n) set detPendingProcessedImfile_DB = 0
     57    end
    4558  end
    4659
     
    4861  task.exit    0
    4962    # convert 'stdout' to book format
    50     ipptool2book stdout detPendingProcessedImfile -key det_id:exp_tag:class_id -uniq
     63    ipptool2book stdout detPendingProcessedImfile -key det_id:exp_tag:class_id -uniq -setword dbname $options:0
    5164    if ($VERBOSE > 2)
    5265      book listbook detPendingProcessedImfile
     
    5568    # delete existing entries which are DONE
    5669    book delpage detPendingProcessedImfile -key state DONE
     70    book delpage detPendingProcessedImfile -key state DATA_ERR
    5771  end
    5872
     
    91105    book getword detPendingProcessedImfile $pageName uri      -var URI     
    92106    book getword detPendingProcessedImfile $pageName camera   -var CAMERA   
     107    book getword detPendingProcessedImfile $pageName workdir  -var WORKDIR
     108    book getword detPendingProcessedImfile $pageName dbname   -var DBNAME
     109    set_standard_args
    93110
    94111    # specify choice of remote host:
     
    100117
    101118    ## generate output log based on filerule
    102     ## XXX use OUTPATH from db to set output path
    103     ## XXX use ipp_filename.pl DETPROC.LOG $outroot $CLASS_ID`
    104     $word = `basename $EXP_TAG | tr '.' ' '`
    105     list word -split $word
    106     $base = $word:0
    107     stdout $LOGSUBDIR/$base/$EXP_TAG.detproc.$DET_ID.$CLASS_ID.log
    108     stderr $LOGSUBDIR/$base/$EXP_TAG.detproc.$DET_ID.$CLASS_ID.log
    109     exec mkdir -p $LOGSUBDIR/$base
     119    $outroot = $WORKDIR/$EXP_TAG
     120    $logfile = `ipp_filename.pl DETPROC.LOG $outroot $CLASS_ID`
     121    stdout $logfile
     122    stderr $logfile
     123    exec mkdir -p $WORKDIR
    110124
    111125    # save the pageName for future reference below
     
    114128    # create example job options as a demonstration
    115129    if ($VERBOSE > 1)
    116       echo command detrend_process_imfile.pl --det_id $DET_ID --det_type $DET_TYPE --exp_tag $EXP_TAG --class $CLASS --class_id $CLASS_ID --input_uri $URI --camera $CAMERA
    117     end
    118     command detrend_process_imfile.pl --det_id $DET_ID --det_type $DET_TYPE --exp_tag $EXP_TAG --class $CLASS --class_id $CLASS_ID --input_uri $URI --camera $CAMERA
     130      echo command detrend_process_imfile.pl --det_id $DET_ID --det_type $DET_TYPE --exp_tag $EXP_TAG --class $CLASS --class_id $CLASS_ID --input_uri $URI --camera $CAMERA $ARGS
     131    end
     132    command detrend_process_imfile.pl --det_id $DET_ID --det_type $DET_TYPE --exp_tag $EXP_TAG --class $CLASS --class_id $CLASS_ID --input_uri $URI --camera $CAMERA $ARGS
    119133  end
    120134
     
    145159
    146160  task.exec
    147     command dettool -toprocessedexp -limit 20
     161    if ($DB:n == 0)
     162      command dettool -toprocessedexp -limit 20
     163    else
     164      # save the DB name for the exit tasks
     165      option $DB:$detPendingProcessedExp_DB
     166      command dettool -toprocessedexp -limit 20 -dbname $DB:$detPendingProcessedExp_DB
     167      $detPendingProcessedExp_DB ++
     168      if ($detPendingProcessedExp_DB >= $DB:n) set detPendingProcessedExp_DB = 0
     169    end
    148170  end
    149171
     
    151173  task.exit    0
    152174    # convert 'stdout' to book format
    153     ipptool2book stdout detPendingProcessedExp -key det_id:iteration:exp_tag -uniq
     175    if ($options:n == 0)
     176      ipptool2book stdout detPendingProcessedExp -key det_id:iteration:exp_tag -uniq
     177    else
     178      ipptool2book stdout detPendingProcessedExp -key det_id:iteration:exp_tag -uniq -setword DBNAME $options:0
     179    end
    154180    if ($VERBOSE > 2)
    155181      book listbook detPendingProcessedExp
     
    158184    # delete existing entries which are DONE
    159185    book delpage detPendingProcessedExp -key state DONE
     186    book delpage detPendingProcessedExp -key state DATA_ERR
    160187  end
    161188
     
    192219    book getword detPendingProcessedExp $pageName exp_tag   -var EXP_TAG
    193220    book getword detPendingProcessedExp $pageName camera    -var CAMERA 
     221    book getword detPendingProcessedExp $pageName workdir   -var WORKDIR
     222    book getword detPendingProcessedExp $pageName dbname    -var DBNAME
     223    set_standard_args
    194224
    195225    # specify choice of remote host:
     
    200230    end
    201231
    202     # XXX this is still a lame rule
    203     $word = `basename $EXP_TAG | tr '.' ' '`
    204     list word -split $word
    205     $base = $word:0
    206     stdout $LOGSUBDIR/$base/$EXP_TAG.detproc.$DET_ID.log
    207     stderr $LOGSUBDIR/$base/$EXP_TAG.detproc.$DET_ID.log
    208     exec mkdir -p $LOGSUBDIR/$base
     232    # XXX push this into the filerules?
     233    $outroot = $WORKDIR/$EXP_TAG
     234    $logfile = $outroot/$EXP_TAG.detproc.$DET_ID.log
     235    stdout $logfile
     236    stderr $logfile
     237    exec mkdir -p $outroot
    209238
    210239    # save the pageName for future reference below
     
    213242    # create example job options as a demonstration
    214243    if ($VERBOSE > 1)
    215       echo command detrend_process_exp.pl --det_id $DET_ID --exp_tag $EXP_TAG --camera $CAMERA
    216     end
    217     command detrend_process_exp.pl --det_id $DET_ID --exp_tag $EXP_TAG --camera $CAMERA
     244      echo command detrend_process_exp.pl --det_id $DET_ID --exp_tag $EXP_TAG --camera $CAMERA $ARGS
     245    end
     246    command detrend_process_exp.pl --det_id $DET_ID --exp_tag $EXP_TAG --camera $CAMERA $ARGS
    218247  end
    219248
Note: See TracChangeset for help on using the changeset viewer.