Changeset 11319
- Timestamp:
- Jan 26, 2007, 12:20:56 PM (19 years ago)
- Location:
- trunk/ippScripts/scripts
- Files:
-
- 11 edited
-
detrend_norm_apply.pl (modified) (3 diffs)
-
detrend_norm_exp.pl (modified) (4 diffs)
-
detrend_process_exp.pl (modified) (5 diffs)
-
detrend_process_imfile.pl (modified) (3 diffs)
-
detrend_reject_exp.pl (modified) (4 diffs)
-
detrend_reject_imfile.pl (modified) (6 diffs)
-
detrend_resid.pl (modified) (2 diffs)
-
detrend_stack.pl (modified) (3 diffs)
-
phase0_exp.pl (modified) (1 diff)
-
phase2.pl (modified) (8 diffs)
-
phase3.pl (modified) (7 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ippScripts/scripts/detrend_norm_apply.pl
r11316 r11319 98 98 run(command => $command, verbose => 1); 99 99 unless ($success) { 100 $error_code >> 8;101 &my_die("Unable to perform ppImage: $error_code", $det _id, $iter, $class_id, $error_code);100 $error_code = $error_code >> 8; 101 &my_die("Unable to perform ppImage: $error_code", $detId, $iter, $classId, $error_code); 102 102 } 103 &my_die("Can't find expected output file: $output", $det _id, $iter, $class_id, $PS_EXIT_SYS_ERROR) unless -e $output;104 &my_die("Can't find expected output file: $b1name", $det _id, $iter, $class_id, $PS_EXIT_SYS_ERROR) unless -e $b2name;105 &my_die("Can't find expected output file: $b2name", $det _id, $iter, $class_id, $PS_EXIT_SYS_ERROR) unless -e $b1name;106 &my_die("Can't find expected output file: $statsName", $det _id, $iter, $class_id, $PS_EXIT_SYS_ERROR) unless -e $statsName;103 &my_die("Can't find expected output file: $output", $detId, $iter, $classId, $PS_EXIT_SYS_ERROR) unless -e $output; 104 &my_die("Can't find expected output file: $b1name", $detId, $iter, $classId, $PS_EXIT_SYS_ERROR) unless -e $b2name; 105 &my_die("Can't find expected output file: $b2name", $detId, $iter, $classId, $PS_EXIT_SYS_ERROR) unless -e $b1name; 106 &my_die("Can't find expected output file: $statsName", $detId, $iter, $classId, $PS_EXIT_SYS_ERROR) unless -e $statsName; 107 107 } 108 108 … … 111 111 { 112 112 my $statsFile; # File handle 113 open $statsFile, $statsName or &my_die("Can't open statistics file $statsName: $!\n", $det _id, $iter, $class_id, $PS_EXIT_SYS_ERROR);113 open $statsFile, $statsName or &my_die("Can't open statistics file $statsName: $!\n", $detId, $iter, $classId, $PS_EXIT_SYS_ERROR); 114 114 my @contents = <$statsFile>; # Contents of file 115 115 close $statsFile; 116 116 my $mdcParser = PS::IPP::Metadata::Config->new; # Parser for metadata config files 117 117 my $metadata = $mdcParser->parse(join "", @contents) 118 or &my_die("Unable to parse metadata config", $det _id, $iter, $class_id, $PS_EXIT_PROG_ERROR);118 or &my_die("Unable to parse metadata config", $detId, $iter, $classId, $PS_EXIT_PROG_ERROR); 119 119 $stats = PS::IPP::Metadata::Stats->new(); # Stats parser 120 $stats->parse($metadata) or &my_die("Unable to find all values in statistics output.", $det _id, $iter, $class_id, $PS_EXIT_PROG_ERROR);120 $stats->parse($metadata) or &my_die("Unable to find all values in statistics output.", $detId, $iter, $classId, $PS_EXIT_PROG_ERROR); 121 121 } 122 122 … … 143 143 run(command => $command, verbose => 1); 144 144 unless ($success) { 145 $error_code >> 8;145 $error_code = $error_code >> 8; 146 146 warn("Unable to perform dettool -addnormalizedimfile: $error_code\n"); 147 147 exit($error_code); -
trunk/ippScripts/scripts/detrend_norm_exp.pl
r11316 r11319 8 8 9 9 use IPC::Cmd qw( can_run run ); 10 use PS::IPP::Metadata::Config qw( 10 use PS::IPP::Metadata::Config; 11 use PS::IPP::Metadata::List qw( parse_md_list ); 12 use Statistics::Descriptive; 13 14 use PS::IPP::Config qw( 11 15 $PS_EXIT_SUCCESS 12 16 $PS_EXIT_UNKNOWN_ERROR … … 17 21 $PS_EXIT_TIMEOUT_ERROR 18 22 ); 19 use PS::IPP::Metadata::List qw( parse_md_list );20 use Statistics::Descriptive;21 22 use PS::IPP::Config;23 23 my $ipprc = PS::IPP::Config->new(); # IPP configuration 24 24 use File::Spec; … … 72 72 run(command => $command, verbose => 1); 73 73 unless ($success) { 74 $error_code >> 8;74 $error_code = $error_code >> 8; 75 75 &my_die("Unable to perform ppImage: $error_code", $det_id, $iter, $error_code); 76 76 } … … 164 164 run(command => $command, verbose => 1); 165 165 unless ($success) { 166 $error_code >> 8;166 $error_code = $error_code >> 8; 167 167 &my_die("Unable to perform dettool -addnormalizedexp: $error_code", $det_id, $iter, $error_code); 168 168 } -
trunk/ippScripts/scripts/detrend_process_exp.pl
r11316 r11319 70 70 run(command => $command, verbose => 1); 71 71 unless ($success) { 72 $error_code >> 8;72 $error_code = $error_code >> 8; 73 73 &my_die("Unable to perform dettool -processedimfile: $error_code", $det_id, $exp_tag, $error_code); 74 74 } … … 85 85 my @variances; # Array of variances for each component 86 86 foreach my $file (@$files) { 87 &my_die("Unable to find class id", $det_id, $exp_tag, $PS_EXIT_SYS_ERR ROR) unless defined $file->{class_id};87 &my_die("Unable to find class id", $det_id, $exp_tag, $PS_EXIT_SYS_ERROR) unless defined $file->{class_id}; 88 88 my $class_id = $file->{class_id}; 89 89 &my_die("Unable to find bg for class_id=$class_id", $det_id, $exp_tag, $PS_EXIT_SYS_ERROR) unless defined $file->{bg}; … … 141 141 run(command => $command, verbose => 1); 142 142 unless ($success) { 143 $error_code >> 8;143 $error_code = $error_code >> 8; 144 144 &my_die("Unable to perform ppImage: $error_code", $det_id, $exp_tag, $error_code); 145 145 } … … 153 153 run(command => $command, verbose => 1); 154 154 unless ($success) { 155 $error_code >> 8;155 $error_code = $error_code >> 8; 156 156 &my_die("Unable to perform ppImage: $error_code", $det_id, $exp_tag, $error_code); 157 157 } … … 172 172 run(command => $command, verbose => 1); 173 173 unless ($success) { 174 $error_code >> 8;174 $error_code = $error_code >> 8; 175 175 warn("Unable to perform dettool -addprocessedexp: $error_code"); 176 176 exit($error_code); -
trunk/ippScripts/scripts/detrend_process_imfile.pl
r11316 r11319 26 26 use Pod::Usage qw( pod2usage ); 27 27 28 my ($det_id, $exp_tag, $class_id, $det_type, $input_uri, $camera, $ bdname, $workdir, $no_update);28 my ($det_id, $exp_tag, $class_id, $det_type, $input_uri, $camera, $dbname, $workdir, $no_update); 29 29 GetOptions( 30 30 'det_id|d=s' => \$det_id, … … 103 103 run(command => $command, verbose => 1); 104 104 unless ($success) { 105 $error_code >> 8;105 $error_code = $error_code >> 8; 106 106 &my_die("Unable to perform ppImage: $error_code", $det_id, $exp_tag, $class_id, $error_code); 107 107 } … … 149 149 run(command => $command, verbose => 1); 150 150 unless ($success) { 151 $error_code >> 8;151 $error_code = $error_code >> 8; 152 152 warn("Unable to perform dettool -addprocessedimfile: $error_code\n"); 153 153 exit($error_code); -
trunk/ippScripts/scripts/detrend_reject_exp.pl
r11316 r11319 65 65 run(command => $command, verbose => 1); 66 66 unless ($success) { 67 $error_code >> 8;67 $error_code = $error_code >> 8; 68 68 &my_die("Unable to perform dettool -residexp: $error_code", $det_id, $iter, $error_code); 69 69 } … … 188 188 run(command => $command, verbose => 1); 189 189 unless ($success) { 190 $error_code >> 8;190 $error_code = $error_code >> 8; 191 191 &my_die("Unable to perform dettool -updateresidexp: $error_code", $det_id, $iter, $error_code); 192 192 } … … 226 226 run(command => $command, verbose => 1); 227 227 unless ($success) { 228 $error_code >> 8;228 $error_code = $error_code >> 8; 229 229 warn("Unable to perform dettool -adddetrunsummary: $error_code"); 230 230 exit($error_code); … … 246 246 run(command => $command, verbose => 1); 247 247 unless ($success) { 248 $error_code >> 8;248 $error_code = $error_code >> 8; 249 249 warn("Unable to perform dettool -updatedetrun: $error_code"); 250 250 exit($error_code); -
trunk/ippScripts/scripts/detrend_reject_imfile.pl
r11316 r11319 35 35 'camera=s' => \$camera, 36 36 'filter=s' => \$filter, 37 'reject' => \$reject 37 'reject' => \$reject, 38 38 'dbname|d=s' => \$dbname, # Database name 39 39 'workdir|w=s' => \$workdir, # Working directory, for output files … … 75 75 run(command => $command, verbose => 1); 76 76 unless ($success) { 77 $error_code >> 8;77 $error_code = $error_code >> 8; 78 78 warn("Unable to perform dettool -residimfile: $error_code\n"); 79 79 exit($error_code); … … 125 125 run(command => $command, verbose => 1); 126 126 unless ($success) { 127 $error_code >> 8;127 $error_code = $error_code >> 8; 128 128 &my_die("Unable to run ppImage: $error_code", $det_id, $iter, $exp_tag, $error_code); 129 129 } … … 137 137 run(command => $command, verbose => 1); 138 138 unless ($success) { 139 $error_code >> 8;139 $error_code = $error_code >> 8; 140 140 &my_die("Unable to run ppImage: $error_code", $det_id, $iter, $exp_tag, $error_code); 141 141 } … … 274 274 run(command => $command, verbose => 1); 275 275 unless ($success) { 276 $error_code >> 8;276 $error_code = $error_code >> 8; 277 277 warn("Unable to perform dettool -addresidexp: $error_code\n"); 278 278 exit($error_code); … … 300 300 301 301 warn($msg); 302 if ($det_id and $iter ationand $exp_tag) {302 if ($det_id and $iter and $exp_tag) { 303 303 my $command = "$dettool -addresidexp -det_id $det_id -iteration $iter -exp_tag $exp_tag -code $exit_code"; 304 304 $command .= " -dbname $dbname" if defined $dbname; -
trunk/ippScripts/scripts/detrend_resid.pl
r11316 r11319 142 142 run(command => $command, verbose => 1); 143 143 unless ($success) { 144 $error_code >> 8;144 $error_code = $error_code >> 8; 145 145 &my_die("Unable to perform ppImage: $error_code", $det_id, $iter, $exp_tag, $class_id, $error_code); 146 146 } … … 188 188 run(command => $command, verbose => 1); 189 189 unless ($success) { 190 $error_code >> 8;190 $error_code = $error_code >> 8; 191 191 warn("Unable to perform dettool -addresidimfile: $error_code\n"); 192 192 exit($error_code); -
trunk/ippScripts/scripts/detrend_stack.pl
r11316 r11319 82 82 run(command => $command, verbose => 1); 83 83 unless ($success) { 84 $error_code >> 8;84 $error_code = $error_code >> 8; 85 85 &my_die("Unable to perform dettool -processedimfile: $error_code", $det_id, $iter, $class_id, $error_code); 86 86 } … … 117 117 run(command => $command, verbose => 1); 118 118 unless ($success) { 119 $error_code >> 8;119 $error_code = $error_code >> 8; 120 120 &my_die("Unable to perform ppMerge: $error_code", $det_id, $iter, $class_id, $error_code); 121 121 } … … 157 157 run(command => $command, verbose => 1); 158 158 unless ($success) { 159 $error_code >> 8;159 $error_code = $error_code >> 8; 160 160 warn("Unable to perform dettool -addstacked: $error_code\n"); 161 161 exit($error_code); -
trunk/ippScripts/scripts/phase0_exp.pl
r11297 r11319 25 25 ); 26 26 27 my ($cache, $exptag, $ no_update);27 my ($cache, $exptag, $dbname, $no_update); 28 28 29 29 GetOptions( -
trunk/ippScripts/scripts/phase2.pl
r11316 r11319 26 26 27 27 # Parse the command-line arguments 28 my ($exp Tag, # Exposure tag29 $class Id, # Class Id28 my ($exp_tag, # Exposure tag 29 $class_id, # Class Id 30 30 $input, # Input FITS file 31 31 $camera, # Camera … … 35 35 ); 36 36 GetOptions( 37 'exp_tag|e=s' => \$exp Tag,38 'class_id|i=s' => \$class Id,37 'exp_tag|e=s' => \$exp_tag, 38 'class_id|i=s' => \$class_id, 39 39 'uri|u=s' => \$input, 40 40 'camera|c=s' => \$camera, … … 46 46 pod2usage( -msg => "Unknown option: @ARGV", -exitval => 2 ) if @ARGV; 47 47 pod2usage( 48 -msg => "Required options: --exp_tag --class_id --uri --camera -- outpath",48 -msg => "Required options: --exp_tag --class_id --uri --camera --workdir", 49 49 -exitval => 3, 50 ) unless defined $exp Tag51 and defined $class Id50 ) unless defined $exp_tag 51 and defined $class_id 52 52 and defined $input 53 53 and defined $camera; … … 70 70 71 71 ### Output file name --- must match camera configuration! 72 my $outputRoot = $exp Tag . '.p2';72 my $outputRoot = $exp_tag . '.p2'; 73 73 $outputRoot = File::Spec->catfile( $workdir, $outputRoot ); 74 74 $outputRoot = $ipprc->convert_filename_absolute($outputRoot); 75 75 $input = $ipprc->convert_filename_absolute ( $input ); 76 76 77 my $outputImage = $ipprc->filename("PPIMAGE.OUTPUT", $outputRoot, $class Id);78 my $outputBin1 = $ipprc->filename("PPIMAGE.BIN1", $outputRoot, $class Id);79 my $outputBin2 = $ipprc->filename("PPIMAGE.BIN2", $outputRoot, $class Id);80 my $outputStats = $outputRoot . '.' . $class Id . '.stats';77 my $outputImage = $ipprc->filename("PPIMAGE.OUTPUT", $outputRoot, $class_id); 78 my $outputBin1 = $ipprc->filename("PPIMAGE.BIN1", $outputRoot, $class_id); 79 my $outputBin2 = $ipprc->filename("PPIMAGE.BIN2", $outputRoot, $class_id); 80 my $outputStats = $outputRoot . '.' . $class_id . '.stats'; 81 81 82 82 # Run ppImage … … 91 91 run(command => $command, verbose => 1); 92 92 unless ($success) { 93 $error_code >> 8;93 $error_code = $error_code >> 8; 94 94 &my_die("Unable to perform ppImage: $error_code", $exp_tag, $class_id, $error_code); 95 95 } … … 122 122 # Command to run p2tool 123 123 my $command = "$p2tool -addprocessedimfile"; 124 $command .= " -exp_tag $exp Tag";125 $command .= " -class_id $class Id";124 $command .= " -exp_tag $exp_tag"; 125 $command .= " -class_id $class_id"; 126 126 $command .= " -recip " . RECIPE; 127 127 $command .= " -uri $outputImage"; … … 136 136 run(command => $command, verbose => 1); 137 137 unless ($success) { 138 $error_code >> 8;138 $error_code = $error_code >> 8; 139 139 warn("Unable to perform p2tool -addprocessedimfile: $error_code\n"); 140 140 exit($error_code); … … 154 154 warn($msg); 155 155 if ($exp_tag and $class_id) { 156 my $command = "$ dettool -addprocessedimfile -exp_tag $exp_tag -class_id $class_id -code $exit_code";156 my $command = "$p2tool -addprocessedimfile -exp_tag $exp_tag -class_id $class_id -code $exit_code"; 157 157 $command .= " -dbname $dbname" if defined $dbname; 158 158 system ($command); -
trunk/ippScripts/scripts/phase3.pl
r11316 r11319 27 27 use Pod::Usage qw( pod2usage ); 28 28 29 my ($exp_tag, $camera, $ outpath, $dbname, $workdir, $no_update);29 my ($exp_tag, $camera, $dbname, $workdir, $no_update); 30 30 GetOptions( 31 31 'exp_tag|e=s' => \$exp_tag, … … 38 38 pod2usage( -msg => "Unknown option: @ARGV", -exitval => 2 ) if @ARGV; 39 39 pod2usage( 40 -msg => "Required options: --exp_tag --camera -- outpath",40 -msg => "Required options: --exp_tag --camera --workdir", 41 41 -exitval => 3, 42 42 ) unless defined $exp_tag … … 68 68 run(command => $command, verbose => 1); 69 69 unless ($success) { 70 $error_code >> 8;70 $error_code = $error_code >> 8; 71 71 &my_die("Unable to perform p3tool: $error_code", $exp_tag, $error_code); 72 72 } … … 148 148 run(command => $command, verbose => 1); 149 149 unless ($success) { 150 $error_code >> 8;150 $error_code = $error_code >> 8; 151 151 &my_die("Unable to perform ppImage: $error_code", $exp_tag, $error_code); 152 152 } … … 160 160 run(command => $command, verbose => 1); 161 161 unless ($success) { 162 $error_code >> 8;162 $error_code = $error_code >> 8; 163 163 &my_die("Unable to perform ppImage: $error_code", $exp_tag, $error_code); 164 164 } … … 180 180 run(command => $command, verbose => 1); 181 181 unless ($success) { 182 $error_code >> 8;182 $error_code = $error_code >> 8; 183 183 warn("Unable to perform dettool -addprocessedexp: $error_code\n"); 184 184 exit($error_code); … … 198 198 warn($msg); 199 199 if ($exp_tag) { 200 my $command = "$ dettool -addprocessedexp -exp_tag $exp_tag -code $exit_code";200 my $command = "$p3tool -addprocessedexp -exp_tag $exp_tag -code $exit_code"; 201 201 $command .= " -dbname $dbname" if defined $dbname; 202 202 system ($command);
Note:
See TracChangeset
for help on using the changeset viewer.
