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.resid.pro

    r11210 r11323  
    2727  book listbook detPendingResidExp
    2828end
     29
     30# these variables will cycle through the known database names
     31$detPendingResidImfile_DB = 0
     32$detPendingResidExp_DB = 0
    2933
    3034# select images ready for copy
     
    4246
    4347  task.exec
    44     command dettool -toresidimfile -limit 20
     48    if ($DB:n == 0)
     49      option DEFAULT
     50      command dettool -toresidimfile -limit 20
     51    else
     52      # save the DB name for the exit tasks
     53      option $DB:$detPendingResidImfile_DB
     54      command dettool -toresidimfile -limit 20 -dbname $DB:$detPendingResidImfile_DB
     55      $detPendingResidImfile_DB ++
     56      if ($detPendingResidImfile_DB >= $DB:n) set detPendingResidImfile_DB = 0
     57    end
    4558  end
    4659
     
    4861  task.exit    0
    4962    # convert 'stdout' to book format
    50     ipptool2book stdout detPendingResidImfile -key det_id:iteration:exp_tag:class_id -uniq
     63    ipptool2book stdout detPendingResidImfile -key det_id:iteration:exp_tag:class_id -uniq -setword dbname $options:0
    5164    if ($VERBOSE > 2)
    5265      book listbook detPendingResidImfile
     
    5568    # delete existing entries which are DONE
    5669    book delpage detPendingResidImfile -key state DONE
     70    book delpage detPendingResidImfile -key state DATA_ERR
    5771  end
    5872
     
    93107    book getword detPendingResidImfile $pageName det_uri   -var DET_URI 
    94108    book getword detPendingResidImfile $pageName camera    -var CAMERA   
     109    book getword detPendingResidImfile $pageName workdir   -var WORKDIR
     110    book getword detPendingResidImfile $pageName dbname    -var DBNAME
     111    set_standard_args
    95112
    96113    # specify choice of remote host:
     
    114131    # create command
    115132    if ($VERBOSE > 1)
    116       echo command detrend_resid.pl --det_id $DET_ID --iteration $ITERATION --exp_tag $EXP_TAG --class_id $CLASS_ID --det_type $DET_TYPE --detrend $DET_URI --input_uri $URI --camera $CAMERA --mode $MODE
    117     end
    118     command detrend_resid.pl --det_id $DET_ID --iteration $ITERATION --exp_tag $EXP_TAG --class_id $CLASS_ID --det_type $DET_TYPE --detrend $DET_URI --input_uri $URI --camera $CAMERA --mode $MODE
     133      echo command detrend_resid.pl --det_id $DET_ID --iteration $ITERATION --exp_tag $EXP_TAG --class_id $CLASS_ID --det_type $DET_TYPE --detrend $DET_URI --input_uri $URI --camera $CAMERA --mode $MODE $ARGS
     134    end
     135    command detrend_resid.pl --det_id $DET_ID --iteration $ITERATION --exp_tag $EXP_TAG --class_id $CLASS_ID --det_type $DET_TYPE --detrend $DET_URI --input_uri $URI --camera $CAMERA --mode $MODE $ARGS
    119136  end
    120137
     
    145162
    146163  task.exec
    147     command dettool -toresidexp -limit 20
     164    if ($DB:n == 0)
     165      option DEFAULT
     166      command dettool -toresidexp -limit 20
     167    else
     168      # save the DB name for the exit tasks
     169      option $DB:$detPendingResidExp_DB
     170      command dettool -toresidexp -limit 20 -dbname $DB:$detPendingResidExp_DB
     171      $detPendingResidExp_DB ++
     172      if ($detPendingResidExp_DB >= $DB:n) set detPendingResidExp_DB = 0
     173    end
    148174  end
    149175
     
    151177  task.exit    0
    152178    # convert 'stdout' to book format
    153     ipptool2book stdout detPendingResidExp -key det_id:iteration:exp_tag -uniq
     179    ipptool2book stdout detPendingResidExp -key det_id:iteration:exp_tag -uniq -setword dbname $options:0
    154180    if ($VERBOSE > 2)
    155181      book listbook detPendingResidExp
     
    158184    # delete existing entries which are DONE
    159185    book delpage detPendingResidExp -key state DONE
     186    book delpage detPendingResidExp -key state DATA_ERR
    160187  end
    161188
     
    194221    book getword detPendingResidExp $pageName include   -var INCLUDE
    195222    book getword detPendingResidExp $pageName camera    -var CAMERA 
     223    book getword detPendingResidExp $pageName workdir   -var WORKDIR
     224    book getword detPendingResidExp $pageName dbname    -var DBNAME
     225    set_standard_args
    196226
    197227    # specify choice of remote host:
     
    215245    # create example job options as a demonstration
    216246    if ($VERBOSE > 1)
    217       echo command detrend_reject_imfile.pl --det_id $DET_ID --iteration $ITERATION --exp_tag $EXP_TAG --det_type $DET_TYPE --camera $CAMERA
    218     end
    219     command detrend_reject_imfile.pl --det_id $DET_ID --iteration $ITERATION --exp_tag $EXP_TAG --det_type $DET_TYPE --camera $CAMERA
     247      echo command detrend_reject_imfile.pl --det_id $DET_ID --iteration $ITERATION --exp_tag $EXP_TAG --det_type $DET_TYPE --camera $CAMERA $ARGS
     248    end
     249    command detrend_reject_imfile.pl --det_id $DET_ID --iteration $ITERATION --exp_tag $EXP_TAG --det_type $DET_TYPE --camera $CAMERA $ARGS
    220250  end
    221251
Note: See TracChangeset for help on using the changeset viewer.