IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Jul 6, 2007, 3:44:38 PM (19 years ago)
Author:
eugene
Message:

rework for consistency with the changes to the database and PS-IPP-Config

File:
1 edited

Legend:

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

    r14009 r14048  
    3232use Pod::Usage qw( pod2usage );
    3333
    34 my ($det_id, $exp_tag, $class_id, $det_type, $input_uri, $camera, $dbname, $workdir, $reduction, $no_update, $no_op);
     34my ($det_id, $exp_id, $class_id, $det_type, $exp_tag, $input_uri, $camera, $dbname, $workdir, $reduction, $no_update, $no_op);
    3535GetOptions(
    3636    'det_id|d=s'        => \$det_id,
    37     'exp_tag|e=s'       => \$exp_tag,
     37    'exp_id|e=s'        => \$exp_id,
    3838    'class_id|i=s'      => \$class_id,
    3939    'det_type|t=s'      => \$det_type,
     40    'exp_tag|=s'        => \$exp_tag,
    4041    'input_uri|u=s'     => \$input_uri,
    4142    'camera|c=s'        => \$camera,
     
    4849
    4950pod2usage( -msg => "Unknown option: @ARGV", -exitval => 2 ) if @ARGV;
    50 pod2usage( -msg => "Required options: --det_id --exp_tag --class_id --det_type --input_uri --camera",
     51pod2usage( -msg => "Required options: --det_id --exp_id --class_id --det_type --exp_tag --input_uri --camera",
    5152           -exitval => 3)
    5253    unless defined $det_id
    53     and defined $exp_tag
     54    and defined $exp_id
    5455    and defined $class_id
    5556    and defined $det_type
     57    and defined $exp_tag
    5658    and defined $input_uri
    5759    and defined $camera;
     
    8385$ppImage .= " -dbname $dbname" if defined $dbname;
    8486
    85 &my_die("Couldn't find input file: $input_uri\n", $chip_id, $class_id, $PS_EXIT_SYS_ERROR) unless $ipprc->file_exists($input_uri);
     87&my_die("Couldn't find input file: $input_uri\n", $det_id, $exp_id, $class_id, $PS_EXIT_SYS_ERROR) unless $ipprc->file_exists($input_uri);
    8688
    8789$workdir = caturi( $workdir, "$camera.$det_type.$det_id" ) if defined $workdir;
     
    8991my $outputRoot  = $ipprc->file_prepare( "$exp_tag/$exp_tag.detproc.$det_id", $workdir, $input_uri );
    9092
    91 my $outputImage = $ipprc->filename("PPIMAGE.OUTPUT", $outputRoot, $class_id);
    92 my $outputBin1  = $ipprc->filename("PPIMAGE.BIN1",   $outputRoot, $class_id);
    93 my $outputBin2  = $ipprc->filename("PPIMAGE.BIN2",   $outputRoot, $class_id);
    94 my $outputStats = $ipprc->filename("PPIMAGE.STATS",  $outputRoot, $class_id);
     93my $outputImage = $ipprc->filename("PPIMAGE.OUTPUT", $outputRoot, $class_id) or &my_die("Missing entry from camera config", $det_id, $exp_id, $class_id, $PS_EXIT_PROG_ERROR);
     94my $outputBin1  = $ipprc->filename("PPIMAGE.BIN1",   $outputRoot, $class_id) or &my_die("Missing entry from camera config", $det_id, $exp_id, $class_id, $PS_EXIT_PROG_ERROR);
     95my $outputBin2  = $ipprc->filename("PPIMAGE.BIN2",   $outputRoot, $class_id) or &my_die("Missing entry from camera config", $det_id, $exp_id, $class_id, $PS_EXIT_PROG_ERROR);
     96my $outputStats = $ipprc->filename("PPIMAGE.STATS",  $outputRoot, $class_id) or &my_die("Missing entry from camera config", $det_id, $exp_id, $class_id, $PS_EXIT_PROG_ERROR);
    9597
    9698# Run ppImage
     
    105107    unless ($success) {
    106108        $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR);
    107         &my_die("Unable to perform ppImage: $error_code", $det_id, $exp_tag, $class_id, $error_code);
     109        &my_die("Unable to perform ppImage: $error_code", $det_id, $exp_id, $class_id, $error_code);
    108110    }
    109111
    110     &my_die("Couldn't find expected output file: $outputImage", $det_id, $exp_tag, $class_id, $PS_EXIT_SYS_ERROR) unless -f $ipprc->file_resolve($outputImage);
    111     &my_die("Couldn't find expected output file: $outputStats", $det_id, $exp_tag, $class_id, $PS_EXIT_SYS_ERROR) unless -f $ipprc->file_resolve($outputStats);
    112     &my_die("Couldn't find expected output file: $outputBin1", $det_id, $exp_tag, $class_id, $PS_EXIT_SYS_ERROR) unless -f $ipprc->file_resolve($outputBin1);
    113     &my_die("Couldn't find expected output file: $outputBin2", $det_id, $exp_tag, $class_id, $PS_EXIT_SYS_ERROR) unless -f $ipprc->file_resolve($outputBin2);
     112    &my_die("Couldn't find expected output file: $outputImage", $det_id, $exp_id, $class_id, $PS_EXIT_SYS_ERROR) unless -f $ipprc->file_resolve($outputImage);
     113    &my_die("Couldn't find expected output file: $outputStats", $det_id, $exp_id, $class_id, $PS_EXIT_SYS_ERROR) unless -f $ipprc->file_resolve($outputStats);
     114    &my_die("Couldn't find expected output file: $outputBin1",  $det_id, $exp_id, $class_id, $PS_EXIT_SYS_ERROR) unless -f $ipprc->file_resolve($outputBin1);
     115    &my_die("Couldn't find expected output file: $outputBin2",  $det_id, $exp_id, $class_id, $PS_EXIT_SYS_ERROR) unless -f $ipprc->file_resolve($outputBin2);
    114116
    115117    # Get the statistics on the processed image
     
    122124    my $mdcParser = PS::IPP::Metadata::Config->new;     # Parser for metadata config files
    123125    my $metadata = $mdcParser->parse(join "", @contents)
    124         or &my_die("Unable to parse metadata config", $det_id, $exp_tag, $class_id, $PS_EXIT_PROG_ERROR);
     126        or &my_die("Unable to parse metadata config", $det_id, $exp_id, $class_id, $PS_EXIT_PROG_ERROR);
    125127
    126128    # extract the stats from the metadata
    127129    my $stats = PS::IPP::Metadata::Stats->new($STATS); # Stats parser
    128     $stats->parse($metadata) or &my_die("Unable to find all values in statistics output.", $det_id, $exp_tag, $class_id, $PS_EXIT_PROG_ERROR);
     130    $stats->parse($metadata) or &my_die("Unable to find all values in statistics output.", $det_id, $exp_id, $class_id, $PS_EXIT_PROG_ERROR);
    129131}
    130132
     
    132134my $command = "$dettool -addprocessedimfile";
    133135$command .= " -det_id $det_id";
    134 $command .= " -exp_tag $exp_tag";
     136$command .= " -exp_id $exp_id";
    135137$command .= " -class_id $class_id";
    136138$command .= " -recip $reduction";
     
    162164    my $msg = shift; # Warning message on die
    163165    my $det_id = shift;         # Detrend identifier
    164     my $exp_tag = shift; # Exposure tag
     166    my $exp_id = shift; # Exposure tag
    165167    my $class_id = shift; # Class identifier
    166168    my $exit_code = shift; # Exit code to add
    167169
    168170    carp($msg);
    169     if ($det_id and $exp_tag and $class_id and not $no_update) {
     171    if ($det_id and $exp_id and $class_id and not $no_update) {
    170172        my $command = "$dettool -addprocessedimfile";
    171173        $command .= " -det_id $det_id";
    172         $command .= " -exp_tag $exp_tag";
     174        $command .= " -exp_id $exp_id";
    173175        $command .= " -class_id $class_id";
    174176        $command .= " -code $exit_code";
Note: See TracChangeset for help on using the changeset viewer.