IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 19178


Ignore:
Timestamp:
Aug 23, 2008, 9:25:48 AM (18 years ago)
Author:
eugene
Message:

adding run_state, and update option

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/ippScripts/scripts/chip_imfile.pl

    r19127 r19178  
    2525
    2626# Parse the command-line arguments
    27 my ( $exp_id, $chip_id, $class_id, $uri, $camera, $outroot, $dbname, $reduction, $threads, $verbose,
     27my ( $exp_id, $chip_id, $class_id, $uri, $camera, $outroot, $dbname, $run_state, $reduction, $threads, $verbose,
    2828     $no_update, $no_op, $redirect );
    2929GetOptions(
     
    3636    'dbname|d=s'        => \$dbname,    # Database name
    3737    'reduction=s'       => \$reduction, # Reduction class
     38    'run-state=s'       => \$run_state, # current state of the run (new, update)
    3839    'threads=s'         => \$threads,   # Number of threads to use for ppImage
    3940    'verbose'           => \$verbose,   # Print to stdout
     
    5253    defined $camera and
    5354    defined $outroot;
     55
     56if (not defined $run_state) { $run_state = 'new'; }
    5457
    5558$ipprc->define_camera($camera);
     
    136139    ## XXX can we convert ppImage log and trace to use the filerules to generate consistent names
    137140    ## XXX also stats: output should be implied by $outroot
    138     my $command = "$ppImage -file $uri $outroot";
    139     $command .= " -recipe PPIMAGE $recipe";
    140     $command .= " -recipe PPSTATS CHIPSTATS";
    141     $command .= " -stats $outputStats";
    142     $command .= " -threads $threads" if defined $threads;
    143     $command .= " -dbname $dbname" if defined $dbname;
    144     $command .= " -tracedest $traceDest -log $logDest";
     141    my $command;
     142
     143    if ($run_state eq "new") {
     144        $command  = "$ppImage -file $uri $outroot";
     145        $command .= " -recipe PPIMAGE $recipe";
     146        $command .= " -recipe PPSTATS CHIPSTATS";
     147        $command .= " -stats $outputStats";
     148        $command .= " -threads $threads" if defined $threads;
     149        $command .= " -dbname $dbname" if defined $dbname;
     150        $command .= " -tracedest $traceDest -log $logDest";
     151    } else {
     152        ## for the UPDATE processing, we need to determine the config file
     153        my $configuration = $ipprc->filename("PPIMAGE.CONFIG", $outroot, $class_id) or
     154            &my_die("Missing entry from camera config", $exp_id, $chip_id, $class_id, $PS_EXIT_CONFIG_ERROR);
     155
     156        $command  = "$ppImage -file $uri $outroot";
     157        $command .= " -site $configuration";
     158        # $command .= " -stats $outputStats"; XXX write stats to an alternate file and compare?
     159        $command .= " -threads $threads" if defined $threads;
     160        $command .= " -dbname $dbname" if defined $dbname;
     161        # $command .= " -tracedest $traceDest -log $logDest"; XXX use an alternate trace and log file?
     162        $command .= "-Db PPIMAGE:PHOTOM FALSE";
     163    }
    145164
    146165    my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
Note: See TracChangeset for help on using the changeset viewer.