Changeset 14048 for trunk/ippScripts/scripts/detrend_process_imfile.pl
- Timestamp:
- Jul 6, 2007, 3:44:38 PM (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/ippScripts/scripts/detrend_process_imfile.pl
r14009 r14048 32 32 use Pod::Usage qw( pod2usage ); 33 33 34 my ($det_id, $exp_ tag, $class_id, $det_type, $input_uri, $camera, $dbname, $workdir, $reduction, $no_update, $no_op);34 my ($det_id, $exp_id, $class_id, $det_type, $exp_tag, $input_uri, $camera, $dbname, $workdir, $reduction, $no_update, $no_op); 35 35 GetOptions( 36 36 'det_id|d=s' => \$det_id, 37 'exp_ tag|e=s' => \$exp_tag,37 'exp_id|e=s' => \$exp_id, 38 38 'class_id|i=s' => \$class_id, 39 39 'det_type|t=s' => \$det_type, 40 'exp_tag|=s' => \$exp_tag, 40 41 'input_uri|u=s' => \$input_uri, 41 42 'camera|c=s' => \$camera, … … 48 49 49 50 pod2usage( -msg => "Unknown option: @ARGV", -exitval => 2 ) if @ARGV; 50 pod2usage( -msg => "Required options: --det_id --exp_ tag --class_id --det_type--input_uri --camera",51 pod2usage( -msg => "Required options: --det_id --exp_id --class_id --det_type --exp_tag --input_uri --camera", 51 52 -exitval => 3) 52 53 unless defined $det_id 53 and defined $exp_ tag54 and defined $exp_id 54 55 and defined $class_id 55 56 and defined $det_type 57 and defined $exp_tag 56 58 and defined $input_uri 57 59 and defined $camera; … … 83 85 $ppImage .= " -dbname $dbname" if defined $dbname; 84 86 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); 86 88 87 89 $workdir = caturi( $workdir, "$camera.$det_type.$det_id" ) if defined $workdir; … … 89 91 my $outputRoot = $ipprc->file_prepare( "$exp_tag/$exp_tag.detproc.$det_id", $workdir, $input_uri ); 90 92 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) ;93 my $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); 94 my $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); 95 my $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); 96 my $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); 95 97 96 98 # Run ppImage … … 105 107 unless ($success) { 106 108 $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); 108 110 } 109 111 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); 114 116 115 117 # Get the statistics on the processed image … … 122 124 my $mdcParser = PS::IPP::Metadata::Config->new; # Parser for metadata config files 123 125 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); 125 127 126 128 # extract the stats from the metadata 127 129 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); 129 131 } 130 132 … … 132 134 my $command = "$dettool -addprocessedimfile"; 133 135 $command .= " -det_id $det_id"; 134 $command .= " -exp_ tag $exp_tag";136 $command .= " -exp_id $exp_id"; 135 137 $command .= " -class_id $class_id"; 136 138 $command .= " -recip $reduction"; … … 162 164 my $msg = shift; # Warning message on die 163 165 my $det_id = shift; # Detrend identifier 164 my $exp_ tag= shift; # Exposure tag166 my $exp_id = shift; # Exposure tag 165 167 my $class_id = shift; # Class identifier 166 168 my $exit_code = shift; # Exit code to add 167 169 168 170 carp($msg); 169 if ($det_id and $exp_ tagand $class_id and not $no_update) {171 if ($det_id and $exp_id and $class_id and not $no_update) { 170 172 my $command = "$dettool -addprocessedimfile"; 171 173 $command .= " -det_id $det_id"; 172 $command .= " -exp_ tag $exp_tag";174 $command .= " -exp_id $exp_id"; 173 175 $command .= " -class_id $class_id"; 174 176 $command .= " -code $exit_code";
Note:
See TracChangeset
for help on using the changeset viewer.
