Changeset 11837 for trunk/ippScripts/scripts/detrend_process_exp.pl
- Timestamp:
- Feb 15, 2007, 2:23:33 PM (19 years ago)
- File:
-
- 1 edited
-
trunk/ippScripts/scripts/detrend_process_exp.pl (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ippScripts/scripts/detrend_process_exp.pl
r11829 r11837 33 33 use Pod::Usage qw( pod2usage ); 34 34 35 my ($det_id, $exp_tag, $camera, $dbname, $workdir, $no_update );35 my ($det_id, $exp_tag, $camera, $dbname, $workdir, $no_update, $no_op); 36 36 GetOptions( 37 37 'det_id|d=s' => \$det_id, … … 40 40 'dbname|d=s' => \$dbname, # Database name 41 41 'workdir|w=s' => \$workdir, # Working directory, for output files 42 'no-update' => \$no_update 42 'no-update' => \$no_update, 43 'no-op' => \$no_op, 43 44 ) or pod2usage( 2 ); 44 45 … … 102 103 my $stats = Statistics::Descriptive::Sparse->new; # Statistics calculator 103 104 $stats->add_data(@backgrounds); 104 $bg = $stats->mean();105 $bg_mean_stdev = $stats->standard_deviation() || 0.0;105 $bg = ($stats->mean() or 'NAN'); 106 $bg_mean_stdev = ($stats->standard_deviation() or 'NAN'); 106 107 } 107 108 { 108 109 my $stats = Statistics::Descriptive::Sparse->new; # Statistics calculator 109 110 $stats->add_data(@variances); 110 $bg_stdev = sqrt( $stats->mean());111 $bg_stdev = (sqrt( $stats->mean() ) or 'NAN'); 111 112 } 112 113 } … … 143 144 my $jpeg2 = $ipprc->filename("PPIMAGE.JPEG2", $outputRoot); # Binned JPEG #2 144 145 145 # Make the jpeg for binning 1 146 { 147 my $command = "$ppImage -list $list1Name $outputRoot -recipe PPIMAGE " . RECIPE1; # Command to run 148 my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) = 149 run(command => $command, verbose => 1); 150 unless ($success) { 151 $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR); 152 &my_die("Unable to perform ppImage: $error_code", $det_id, $exp_tag, $error_code); 153 } 154 &my_die("Unable to find expected output file: $jpeg1", $det_id, $exp_tag, $PS_EXIT_SYS_ERROR) unless -f $jpeg1; 155 } 156 157 # Make the jpeg for binning 2 158 { 159 my $command = "$ppImage -list $list2Name $outputRoot -recipe PPIMAGE " . RECIPE2; # Command to run 160 my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) = 161 run(command => $command, verbose => 1); 162 unless ($success) { 163 $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR); 164 &my_die("Unable to perform ppImage: $error_code", $det_id, $exp_tag, $error_code); 165 } 166 &my_die("Unable to find expected output file: $jpeg2", $det_id, $exp_tag, $PS_EXIT_SYS_ERROR) unless -f $jpeg2; 167 } 168 146 unless ($no_op) { 147 # Make the jpeg for binning 1 148 { 149 my $command = "$ppImage -list $list1Name $outputRoot -recipe PPIMAGE " . RECIPE1; # Command to run 150 my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) = 151 run(command => $command, verbose => 1); 152 unless ($success) { 153 $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR); 154 &my_die("Unable to perform ppImage: $error_code", $det_id, $exp_tag, $error_code); 155 } 156 &my_die("Unable to find expected output file: $jpeg1", $det_id, $exp_tag, $PS_EXIT_SYS_ERROR) unless -f $jpeg1; 157 } 158 159 # Make the jpeg for binning 2 160 { 161 my $command = "$ppImage -list $list2Name $outputRoot -recipe PPIMAGE " . RECIPE2; # Command to run 162 my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) = 163 run(command => $command, verbose => 1); 164 unless ($success) { 165 $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR); 166 &my_die("Unable to perform ppImage: $error_code", $det_id, $exp_tag, $error_code); 167 } 168 &my_die("Unable to find expected output file: $jpeg2", $det_id, $exp_tag, $PS_EXIT_SYS_ERROR) unless -f $jpeg2; 169 } 170 } 169 171 170 172 # Add the result into the database
Note:
See TracChangeset
for help on using the changeset viewer.
