IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Jun 5, 2008, 11:43:34 AM (18 years ago)
Author:
Paul Price
Message:

Need to know the database name so that concepts (thinking specifically of CHIP.TEMP for GPC1) can be derived from the database.

File:
1 edited

Legend:

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

    r17671 r17941  
    3636    'outroot|w=s'       => \$outroot, # output file base name
    3737    'dbname|d=s'        => \$dbname, # Database name
    38     'reduction=s'       => \$reduction, # Reduction class
     38    'reduction=s'       => \$reduction, # Reduction class
    3939    'verbose'           => \$verbose,   # Print to stdout
    4040    'no-update'         => \$no_update,
     
    4444pod2usage( -msg => "Unknown option: @ARGV", -exitval => 2 ) if @ARGV;
    4545pod2usage( -msg => "Required options: --det_id --exp_id --class_id --det_type --exp_tag --input_uri --camera --outroot",
    46            -exitval => 3) unless
     46           -exitval => 3) unless
    4747    defined $det_id    and
    48     defined $exp_id    and 
    49     defined $class_id  and 
    50     defined $det_type  and 
    51     defined $exp_tag   and 
    52     defined $input_uri and 
    53     defined $camera    and 
     48    defined $exp_id    and
     49    defined $class_id  and
     50    defined $det_type  and
     51    defined $exp_tag   and
     52    defined $input_uri and
     53    defined $camera    and
    5454    defined $outroot;
    5555
     
    6262
    6363# values to extract from output metadata and the stats to calculate
    64 my $STATS = 
    65    [   
     64my $STATS =
     65   [
    6666       #          PPSTATS KEYWORD         STATISTIC          CHIPTOOL FLAG
    6767       { name => "ROBUST_MEDIAN",  type => "mean",  flag => "-bg",            dtype => "float" },
     
    7575my $dettool = can_run('dettool') or (warn "Can't find dettool" and $missing_tools = 1);
    7676my $ppImage = can_run('ppImage') or (warn "Can't find ppImage" and $missing_tools = 1);
    77 if ($missing_tools) { 
     77if ($missing_tools) {
    7878    warn("Can't find required tools.");
    79     exit($PS_EXIT_CONFIG_ERROR); 
     79    exit($PS_EXIT_CONFIG_ERROR);
    8080}
    8181$ppImage .= " -dbname $dbname" if defined $dbname;
     
    105105    $command .= " -stats $outputStats";
    106106    $command .= " -tracedest $traceDest -log $logDest";
     107    $command .= " -dbname $dbname" if defined $dbname;
    107108
    108109    my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
    109         run(command => $command, verbose => $verbose);
     110        run(command => $command, verbose => $verbose);
    110111    unless ($success) {
    111         $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR);
    112         &my_die("Unable to perform ppImage: $error_code", $det_id, $exp_id, $class_id, $error_code);
     112        $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR);
     113        &my_die("Unable to perform ppImage: $error_code", $det_id, $exp_id, $class_id, $error_code);
    113114    }
    114115
     
    119120
    120121    # Get the statistics on the processed image
    121     my $statsFile;              # File handle
     122    my $statsFile;              # File handle
    122123    open $statsFile, $ipprc->file_resolve("$outputStats") or die "Can't open statistics file $outputStats: $!\n";
    123124    my @contents = <$statsFile>; # Contents of file
     
    125126
    126127    # parse the statistics MDC file
    127     my $mdcParser = PS::IPP::Metadata::Config->new;     # Parser for metadata config files
     128    my $mdcParser = PS::IPP::Metadata::Config->new;     # Parser for metadata config files
    128129    my $metadata = $mdcParser->parse(join "", @contents)
    129130        or &my_die("Unable to parse metadata config", $det_id, $exp_id, $class_id, $PS_EXIT_PROG_ERROR);
     
    146147unless ($no_update) {
    147148    my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
    148         run(command => $command, verbose => $verbose);
     149        run(command => $command, verbose => $verbose);
    149150    unless ($success) {
    150         $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR);
    151         warn("Unable to perform dettool -addprocessedimfile: $error_code\n");
    152         exit($error_code);
     151        $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR);
     152        warn("Unable to perform dettool -addprocessedimfile: $error_code\n");
     153        exit($error_code);
    153154    }
    154155} else {
     
    159160{
    160161    my $msg = shift; # Warning message on die
    161     my $det_id = shift;         # Detrend identifier
     162    my $det_id = shift;         # Detrend identifier
    162163    my $exp_id = shift; # Exposure tag
    163164    my $class_id = shift; # Class identifier
     
    166167    carp($msg);
    167168    if (defined $det_id and defined $exp_id and defined $class_id and not $no_update) {
    168         my $command = "$dettool -addprocessedimfile";
    169         $command .= " -det_id $det_id";
    170         $command .= " -exp_id $exp_id";
    171         $command .= " -class_id $class_id";
    172         $command .= " -code $exit_code";
    173         $command .= " -dbname $dbname" if defined $dbname;
     169        my $command = "$dettool -addprocessedimfile";
     170        $command .= " -det_id $det_id";
     171        $command .= " -exp_id $exp_id";
     172        $command .= " -class_id $class_id";
     173        $command .= " -code $exit_code";
     174        $command .= " -dbname $dbname" if defined $dbname;
    174175        system ($command);
    175176    }
Note: See TracChangeset for help on using the changeset viewer.