Changeset 11837 for trunk/ippScripts/scripts/phase3.pl
- Timestamp:
- Feb 15, 2007, 2:23:33 PM (19 years ago)
- File:
-
- 1 edited
-
trunk/ippScripts/scripts/phase3.pl (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ippScripts/scripts/phase3.pl
r11829 r11837 33 33 use Pod::Usage qw( pod2usage ); 34 34 35 my ($exp_tag, $camera, $dbname, $workdir, $no_update );35 my ($exp_tag, $camera, $dbname, $workdir, $no_update, $no_op); 36 36 GetOptions( 37 37 'exp_tag|e=s' => \$exp_tag, … … 39 39 'dbname|d=s' => \$dbname, # Database name 40 40 'workdir|w=s' => \$workdir, 41 'no-update' => \$no_update 41 'no-update' => \$no_update, 42 'no-op' => \$no_op, 42 43 ) or pod2usage( 2 ); 43 44 … … 111 112 my $stats = Statistics::Descriptive::Sparse->new; # Statistics calculator 112 113 $stats->add_data(@backgrounds); 113 $bg = $stats->mean();114 $bg_mean_stdev = $stats->standard_deviation() || 0.0;114 $bg = ($stats->mean() or 'NAN'); 115 $bg_mean_stdev = ($stats->standard_deviation() or 'NAN'); 115 116 } 116 117 { 117 118 my $stats = Statistics::Descriptive::Sparse->new; # Statistics calculator 118 119 $stats->add_data(@variances); 119 $bg_stdev = sqrt( $stats->mean());120 $bg_stdev = (sqrt( $stats->mean() ) or 'NAN'); 120 121 } 121 122 } … … 169 170 my $fpaObjects = $ipprc->filename("PSASTRO.OUTPUT", $outputRoot); # MEF psastro output 170 171 171 # run psastro +mosastro on the set of chips 172 # XXX note that this is wrong if imfiles are cells 173 if (@$files > 1) { 174 my $command = "$psastro -list $list3Name $outputRoot +mosastro -chipastro"; 175 my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) = 176 run(command => $command, verbose => 1); 177 unless ($success) { 178 $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR); 179 &my_die("Unable to perform psastro: $error_code", $exp_tag, $error_code); 180 } 181 &my_die("Unable to find expected output file: $fpaObjects", $exp_tag, $PS_EXIT_PROG_ERROR) unless -f $fpaObjects; 182 } else { 183 $fpaObjects = $chipObjects; 184 } 185 186 # run addstar on either the single chip output or the single fpa output 187 # XXX this construct requires the user to have a valid .ptolemyrc 188 # XXX which in turn points at ippconfig/dvo.site 189 { 190 my $command = "addstar -D CAMERA $camera $fpaObjects"; 191 my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) = 192 run(command => $command, verbose => 1); 193 unless ($success) { 194 $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR); 195 &my_die("Unable to perform addstar: $error_code", $exp_tag, $error_code); 196 } 197 } 198 199 # Make the jpeg for binning 1 200 { 201 my $command = "$ppImage -list $list1Name $outputRoot -recipe PPIMAGE " . RECIPE1; # Command to run 202 my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) = 203 run(command => $command, verbose => 1); 204 unless ($success) { 205 $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR); 206 &my_die("Unable to perform ppImage: $error_code", $exp_tag, $error_code); 207 } 208 &my_die("Unable to find expected output file: $jpeg1", $exp_tag, $PS_EXIT_PROG_ERROR) unless -f $jpeg1; 209 } 210 211 # Make the jpeg for binning 2 212 { 213 my $command = "$ppImage -list $list2Name $outputRoot -recipe PPIMAGE " . RECIPE2; # Command to run 214 my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) = 215 run(command => $command, verbose => 1); 216 unless ($success) { 217 $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR); 218 &my_die("Unable to perform ppImage: $error_code", $exp_tag, $error_code); 219 } 220 &my_die("Unable to find expected output file: $jpeg2", $exp_tag, $PS_EXIT_PROG_ERROR) unless -f $jpeg2; 172 unless ($no_op) { 173 174 # run psastro +mosastro on the set of chips 175 # XXX note that this is wrong if imfiles are cells 176 if (@$files > 1) { 177 my $command = "$psastro -list $list3Name $outputRoot +mosastro -chipastro"; 178 my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) = 179 run(command => $command, verbose => 1); 180 unless ($success) { 181 $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR); 182 &my_die("Unable to perform psastro: $error_code", $exp_tag, $error_code); 183 } 184 &my_die("Unable to find expected output file: $fpaObjects", $exp_tag, $PS_EXIT_PROG_ERROR) unless -f $fpaObjects; 185 } else { 186 $fpaObjects = $chipObjects; 187 } 188 189 # run addstar on either the single chip output or the single fpa output 190 # XXX this construct requires the user to have a valid .ptolemyrc 191 # XXX which in turn points at ippconfig/dvo.site 192 { 193 my $command = "addstar -D CAMERA $camera $fpaObjects"; 194 my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) = 195 run(command => $command, verbose => 1); 196 unless ($success) { 197 $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR); 198 &my_die("Unable to perform addstar: $error_code", $exp_tag, $error_code); 199 } 200 } 201 202 # Make the jpeg for binning 1 203 { 204 my $command = "$ppImage -list $list1Name $outputRoot -recipe PPIMAGE " . RECIPE1; # Command to run 205 my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) = 206 run(command => $command, verbose => 1); 207 unless ($success) { 208 $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR); 209 &my_die("Unable to perform ppImage: $error_code", $exp_tag, $error_code); 210 } 211 &my_die("Unable to find expected output file: $jpeg1", $exp_tag, $PS_EXIT_PROG_ERROR) unless -f $jpeg1; 212 } 213 214 # Make the jpeg for binning 2 215 { 216 my $command = "$ppImage -list $list2Name $outputRoot -recipe PPIMAGE " . RECIPE2; # Command to run 217 my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) = 218 run(command => $command, verbose => 1); 219 unless ($success) { 220 $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR); 221 &my_die("Unable to perform ppImage: $error_code", $exp_tag, $error_code); 222 } 223 &my_die("Unable to find expected output file: $jpeg2", $exp_tag, $PS_EXIT_PROG_ERROR) unless -f $jpeg2; 224 } 221 225 } 222 226 … … 226 230 $jpeg1 = $ipprc->convert_filename_relative($jpeg1); 227 231 $jpeg2 = $ipprc->convert_filename_relative($jpeg2); 232 228 233 unless ($no_update) { 229 234 my $command = "$p3tool -addprocessedexp -exp_tag $exp_tag -uri UNKNOWN " .
Note:
See TracChangeset
for help on using the changeset viewer.
