- Timestamp:
- Jan 21, 2008, 4:56:26 PM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branch_20080121/ippScripts/scripts/detrend_norm_apply.pl
r15918 r16176 33 33 34 34 # Parse the command-line 35 my ($det_id, $iter, $class_id, $value, $input_uri, $camera, $det_type, $ dbname, $workdir, $no_update, $no_op);35 my ($det_id, $iter, $class_id, $value, $input_uri, $camera, $det_type, $outroot, $dbname, $no_update, $no_op); 36 36 GetOptions( 37 37 'det_id|d=s' => \$det_id, # Detrend ID … … 42 42 'camera|c=s' => \$camera, # Camera 43 43 'det_type|t=s' => \$det_type, # Detrend type 44 'outroot|w=s' => \$outroot, # output file base name 44 45 'dbname|d=s' => \$dbname, # Database name 45 'workdir|w=s' => \$workdir, # Working directory, for output files46 46 'no-update' => \$no_update, # Don't update the database 47 47 'no-op' => \$no_op, # Don't do any operations … … 49 49 50 50 pod2usage( -msg => "Unknown option: @ARGV", -exitval => 2 ) if @ARGV; 51 pod2usage( -msg => "Required options: --det_id --iteration --class_id --value --input_uri --camera --det_type", 52 -exitval => 3) 53 unless defined $det_id 54 and defined $iter 55 and defined $class_id 56 and defined $value 57 and defined $input_uri 58 and defined $camera 59 and defined $det_type; 51 pod2usage( -msg => "Required options: --det_id --iteration --class_id --value --input_uri --camera --det_type --outroot", 52 -exitval => 3) unless 53 defined $det_id and 54 defined $iter and 55 defined $class_id and 56 defined $value and 57 defined $input_uri and 58 defined $camera and 59 defined $det_type and 60 defined $outroot; 60 61 61 62 $ipprc->define_camera($camera); … … 90 91 &my_die("Couldn't find input file: $input_uri\n", $det_id, $iter, $class_id, $PS_EXIT_SYS_ERROR) unless $ipprc->file_exists($input_uri); 91 92 92 $workdir = caturi( $workdir, "$camera.$det_type.$det_id" ) if defined $workdir; 93 94 my $outputRoot = $ipprc->file_prepare( "$camera.$det_type.norm.$det_id.$iter", $workdir, $input_uri ); 95 96 my $output = $ipprc->filename("PPIMAGE.OUTPUT", $outputRoot, $class_id); 97 my $b1name = $ipprc->filename("PPIMAGE.BIN1", $outputRoot, $class_id); 98 my $b2name = $ipprc->filename("PPIMAGE.BIN2", $outputRoot, $class_id); 99 my $statsName = $ipprc->filename("PPIMAGE.STATS", $outputRoot, $class_id); 100 101 my $traceDest = 'file:' . $ipprc->file_resolve($outputRoot) . ".$class_id.trace"; # Trace messages 102 my $logDest = 'file:' . $ipprc->file_resolve($outputRoot) . ".$class_id.log"; # Log messages 93 # outroot examples (HOST components must be set) 94 # file://data/ipp004.0/gpc1/20080130 95 # neb:///ipp004-v1/gpc1/20080130 96 # neb:///*/gpc1/20080130 (volume not specified) 97 98 # check for existing directory, generate if needed 99 $ipprc->outroot_prepare($outroot); 100 101 my $output = $ipprc->filename("PPIMAGE.OUTPUT", $outroot, $class_id) or &my_die("Missing entry from camera config", $det_id, $iter, $class_id, $PS_EXIT_CONFIG_ERROR); 102 my $b1name = $ipprc->filename("PPIMAGE.BIN1", $outroot, $class_id) or &my_die("Missing entry from camera config", $det_id, $iter, $class_id, $PS_EXIT_CONFIG_ERROR); 103 my $b2name = $ipprc->filename("PPIMAGE.BIN2", $outroot, $class_id) or &my_die("Missing entry from camera config", $det_id, $iter, $class_id, $PS_EXIT_CONFIG_ERROR); 104 my $statsName = $ipprc->filename("PPIMAGE.STATS", $outroot, $class_id) or &my_die("Missing entry from camera config", $det_id, $iter, $class_id, $PS_EXIT_CONFIG_ERROR); 105 my $traceDest = $ipprc->filename("TRACE.IMFILE", $outroot, $class_id) or &my_die("Missing entry from camera config", $det_id, $iter, $class_id, $PS_EXIT_CONFIG_ERROR); 106 my $logDest = $ipprc->filename("LOG.IMFILE", $outroot, $class_id) or &my_die("Missing entry from camera config", $det_id, $iter, $class_id, $PS_EXIT_CONFIG_ERROR); 103 107 104 108 # Run normalisation 105 109 unless ($no_op) { 106 my $command = "$ppImage -file $input_uri $out putRoot";110 my $command = "$ppImage -file $input_uri $outroot"; 107 111 $command .= " -norm $value -stats $statsName"; 108 112 $command .= " -recipe PPIMAGE $RECIPE_PPIMAGE"; … … 118 122 &my_die("Unable to perform ppImage: $error_code", $det_id, $iter, $class_id, $error_code); 119 123 } 120 &my_die("Can't find expected output file: $output", $det_id, $iter, $class_id, $PS_EXIT_SYS_ERROR) unless -f $ipprc->file_resolve($output);121 &my_die("Can't find expected output file: $b1name", $det_id, $iter, $class_id, $PS_EXIT_SYS_ERROR) unless -f $ipprc->file_resolve($b1name);122 &my_die("Can't find expected output file: $b2name", $det_id, $iter, $class_id, $PS_EXIT_SYS_ERROR) unless -f $ipprc->file_resolve($b2name);124 &my_die("Can't find expected output file: $output", $det_id, $iter, $class_id, $PS_EXIT_SYS_ERROR) unless -f $ipprc->file_resolve($output); 125 &my_die("Can't find expected output file: $b1name", $det_id, $iter, $class_id, $PS_EXIT_SYS_ERROR) unless -f $ipprc->file_resolve($b1name); 126 &my_die("Can't find expected output file: $b2name", $det_id, $iter, $class_id, $PS_EXIT_SYS_ERROR) unless -f $ipprc->file_resolve($b2name); 123 127 &my_die("Can't find expected output file: $statsName", $det_id, $iter, $class_id, $PS_EXIT_SYS_ERROR) unless -f $ipprc->file_resolve($statsName); 124 128 … … 149 153 $command .= " -class_id $class_id"; 150 154 $command .= " -uri $output"; 151 $command .= " -path_base $out putRoot";155 $command .= " -path_base $outroot"; 152 156 $command .= " -dbname $dbname" if defined $dbname; 153 157 $command .= $stats->cmdflags();
Note:
See TracChangeset
for help on using the changeset viewer.
