- Timestamp:
- Jun 7, 2010, 12:00:46 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/czw_branch/20100519/ippScripts/scripts/skycell_jpeg.pl
r28045 r28245 32 32 'save_temps' => \$save_temps, 33 33 'masks' => \$masks, 34 'no-op' => \$no_op,35 'no-update' => \$no_update,34 # 'no-op' => \$no_op, 35 # 'no-update' => \$no_update, 36 36 ) or pod2usage ( 2 ); 37 37 38 38 pod2usage( -msg => "Unknown option: @ARGV", -exitval => 2) if @ARGV; 39 39 pod2usage( 40 -msg => "Required options: --stage --stage_id --outroot ",40 -msg => "Required options: --stage --stage_id --outroot\nHelpful options: --camera --dbname", 41 41 -exitval => 3, 42 42 ) unless … … 80 80 my $quality = $imfile->{quality}; 81 81 my $state = $imfile->{data_state}; 82 my $ tangent_base= $skycell_id;82 my $projection_cell = $skycell_id; 83 83 if ($quality == 8007 or $state ne 'full') { 84 84 next; 85 85 } 86 86 87 $ tangent_base=~ s/^(.*)\..*$/$1/;88 89 unless (exists($tangents{$ tangent_base})) {87 $projection_cell =~ s/^(.*)\..*$/$1/; 88 89 unless (exists($tangents{$projection_cell})) { 90 90 # Make a temp file and fill, but be sure to save 91 ($tempFile, $tempName) = tempfile("/tmp/skycell.$ tangent_base.XXXX",91 ($tempFile, $tempName) = tempfile("/tmp/skycell.$projection_cell.XXXX", 92 92 UNLINK => !$save_temps); 93 $tangents{$ tangent_base}{FILE} = $tempFile;94 $tangents{$ tangent_base}{NAME} = $tempName;93 $tangents{$projection_cell}{FILE} = $tempFile; 94 $tangents{$projection_cell}{NAME} = $tempName; 95 95 if ($masks) { 96 my ($maskFile, $maskName) = tempfile("/tmp/skycell.$ tangent_base.masks.XXXX",96 my ($maskFile, $maskName) = tempfile("/tmp/skycell.$projection_cell.masks.XXXX", 97 97 UNLINK => !$save_temps); 98 $tangents{$ tangent_base}{MFILE} = $maskFile;99 $tangents{$ tangent_base}{MNAME} = $maskName;98 $tangents{$projection_cell}{MFILE} = $maskFile; 99 $tangents{$projection_cell}{MNAME} = $maskName; 100 100 } 101 101 } 102 print "$skycell_id $ tangent_base\n";102 print "$skycell_id $projection_cell\n"; 103 103 my $file = $ipprc->filename("PSWARP.OUTPUT", $path_base, $skycell_id); 104 104 print "$file $state $quality\n"; 105 my $f_fh = $tangents{$ tangent_base}{FILE};105 my $f_fh = $tangents{$projection_cell}{FILE}; 106 106 print $f_fh "$file\n"; 107 107 if ($masks) { 108 108 my $mask = $ipprc->filename("PSWARP.OUTPUT.MASK", $path_base, $skycell_id); 109 109 print "$mask\n"; 110 my $m_fh = $tangents{$ tangent_base}{MFILE};110 my $m_fh = $tangents{$projection_cell}{MFILE}; 111 111 print $m_fh "$mask\n"; 112 112 } 113 113 } 114 foreach my $ tangent_base(keys %tangents) {115 $command = "$ppSkycell -images $tangents{$ tangent_base}{NAME}";116 if ($masks) { 117 $command .= " -masks $tangents{$ tangent_base}{MNAME} ";118 } 119 $command .= " ${outroot}.${ tangent_base} ";114 foreach my $projection_cell (keys %tangents) { 115 $command = "$ppSkycell -images $tangents{$projection_cell}{NAME}"; 116 if ($masks) { 117 $command .= " -masks $tangents{$projection_cell}{MNAME} "; 118 } 119 $command .= " ${outroot}.${projection_cell} "; 120 120 print "$command\n"; 121 121 ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) = run(command => $command, verbose => $verbose); … … 125 125 } 126 126 # Update database: 127 $command = "$warptool -addsummary -warp_id $stage_id - tangent_base $tangent_base-outroot $outroot";127 $command = "$warptool -addsummary -warp_id $stage_id -projection_cell $projection_cell -outroot $outroot"; 128 128 if (defined($dbname)) { 129 129 $command .= " -dbname $dbname"; … … 164 164 my $quality = $imfile->{quality}; 165 165 my $state = $imfile->{data_state}; 166 my $ tangent_base= $skycell_id;166 my $projection_cell = $skycell_id; 167 167 if ($quality == 8007 or $state ne 'full') { 168 168 next; 169 169 } 170 170 171 $ tangent_base=~ s/^(.*)\..*$/$1/;172 173 unless (exists($tangents{$ tangent_base})) {171 $projection_cell =~ s/^(.*)\..*$/$1/; 172 173 unless (exists($tangents{$projection_cell})) { 174 174 # Make a temp file and fill, but be sure to save 175 ($tempFile, $tempName) = tempfile("/tmp/skycell.$ tangent_base.XXXX",175 ($tempFile, $tempName) = tempfile("/tmp/skycell.$projection_cell.XXXX", 176 176 UNLINK => !$save_temps); 177 $tangents{$ tangent_base}{FILE} = $tempFile;178 $tangents{$ tangent_base}{NAME} = $tempName;177 $tangents{$projection_cell}{FILE} = $tempFile; 178 $tangents{$projection_cell}{NAME} = $tempName; 179 179 if ($masks) { 180 my ($maskFile, $maskName) = tempfile("/tmp/skycell.$ tangent_base.masks.XXXX",180 my ($maskFile, $maskName) = tempfile("/tmp/skycell.$projection_cell.masks.XXXX", 181 181 UNLINK => !$save_temps); 182 $tangents{$ tangent_base}{MFILE} = $maskFile;183 $tangents{$ tangent_base}{MNAME} = $maskName;182 $tangents{$projection_cell}{MFILE} = $maskFile; 183 $tangents{$projection_cell}{MNAME} = $maskName; 184 184 } 185 185 } 186 print "$skycell_id $ tangent_base\n";186 print "$skycell_id $projection_cell\n"; 187 187 my $file = $ipprc->filename("PPSUB.OUTPUT", $path_base, $skycell_id); 188 188 print "$file $state $quality\n"; 189 my $f_fh = $tangents{$ tangent_base}{FILE};189 my $f_fh = $tangents{$projection_cell}{FILE}; 190 190 print $f_fh "$file\n"; 191 191 if ($masks) { 192 192 my $mask = $ipprc->filename("PPSUB.OUTPUT.MASK", $path_base, $skycell_id); 193 193 print "$mask\n"; 194 my $m_fh = $tangents{$ tangent_base}{MFILE};194 my $m_fh = $tangents{$projection_cell}{MFILE}; 195 195 print $m_fh "$mask\n"; 196 196 } 197 197 } 198 foreach my $ tangent_base(keys %tangents) {199 $command = "$ppSkycell -images $tangents{$ tangent_base}{NAME}";200 if ($masks) { 201 $command .= " -masks $tangents{$ tangent_base}{MNAME} ";202 } 203 $command .= " ${outroot}.${ tangent_base} ";198 foreach my $projection_cell (keys %tangents) { 199 $command = "$ppSkycell -images $tangents{$projection_cell}{NAME}"; 200 if ($masks) { 201 $command .= " -masks $tangents{$projection_cell}{MNAME} "; 202 } 203 $command .= " ${outroot}.${projection_cell} "; 204 204 print "$command\n"; 205 205 ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) = run(command => $command, verbose => $verbose); … … 209 209 } 210 210 # Update database: 211 $command = "$difftool -addsummary -diff_id $stage_id - tangent_base $tangent_base-outroot $outroot";211 $command = "$difftool -addsummary -diff_id $stage_id -projection_cell $projection_cell -outroot $outroot"; 212 212 if (defined($dbname)) { 213 213 $command .= " -dbname $dbname"; … … 248 248 my $quality = $imfile->{quality}; 249 249 my $state = $imfile->{data_state}; 250 my $ tangent_base= $skycell_id;250 my $projection_cell = $skycell_id; 251 251 if ($quality == 8007 or $state ne 'full') { 252 252 next; 253 253 } 254 254 255 $ tangent_base=~ s/^(.*)\..*$/$1/;256 257 unless (exists($tangents{$ tangent_base})) {255 $projection_cell =~ s/^(.*)\..*$/$1/; 256 257 unless (exists($tangents{$projection_cell})) { 258 258 # Make a temp file and fill, but be sure to save 259 ($tempFile, $tempName) = tempfile("/tmp/skycell.$ tangent_base.XXXX",259 ($tempFile, $tempName) = tempfile("/tmp/skycell.$projection_cell.XXXX", 260 260 UNLINK => !$save_temps); 261 $tangents{$ tangent_base}{FILE} = $tempFile;262 $tangents{$ tangent_base}{NAME} = $tempName;261 $tangents{$projection_cell}{FILE} = $tempFile; 262 $tangents{$projection_cell}{NAME} = $tempName; 263 263 if ($masks) { 264 my ($maskFile, $maskName) = tempfile("/tmp/skycell.$ tangent_base.masks.XXXX",264 my ($maskFile, $maskName) = tempfile("/tmp/skycell.$projection_cell.masks.XXXX", 265 265 UNLINK => !$save_temps); 266 $tangents{$ tangent_base}{MFILE} = $maskFile;267 $tangents{$ tangent_base}{MNAME} = $maskName;266 $tangents{$projection_cell}{MFILE} = $maskFile; 267 $tangents{$projection_cell}{MNAME} = $maskName; 268 268 } 269 269 } 270 print "$skycell_id $ tangent_base\n";270 print "$skycell_id $projection_cell\n"; 271 271 my $file = $ipprc->filename("PPSTACK.OUTPUT", $path_base, $skycell_id); 272 272 print "$file $state $quality\n"; 273 my $f_fh = $tangents{$ tangent_base}{FILE};273 my $f_fh = $tangents{$projection_cell}{FILE}; 274 274 print $f_fh "$file\n"; 275 275 if ($masks) { 276 276 my $mask = $ipprc->filename("PPSTACK.OUTPUT.MASK", $path_base, $skycell_id); 277 277 print "$mask\n"; 278 my $m_fh = $tangents{$ tangent_base}{MFILE};278 my $m_fh = $tangents{$projection_cell}{MFILE}; 279 279 print $m_fh "$mask\n"; 280 280 } 281 281 } 282 foreach my $ tangent_base(keys %tangents) {283 $command = "$ppSkycell -images $tangents{$ tangent_base}{NAME}";284 if ($masks) { 285 $command .= " -masks $tangents{$ tangent_base}{MNAME} ";286 } 287 $command .= " ${outroot}.${ tangent_base} ";282 foreach my $projection_cell (keys %tangents) { 283 $command = "$ppSkycell -images $tangents{$projection_cell}{NAME}"; 284 if ($masks) { 285 $command .= " -masks $tangents{$projection_cell}{MNAME} "; 286 } 287 $command .= " ${outroot}.${projection_cell} "; 288 288 print "$command\n"; 289 289 ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) = run(command => $command, verbose => $verbose); … … 293 293 } 294 294 # Update database: 295 $command = "$stacktool -addsummary -stack_id $stage_id - tangent_base $tangent_base-outroot $outroot";295 $command = "$stacktool -addsummary -stack_id $stage_id -projection_cell $projection_cell -outroot $outroot"; 296 296 if (defined($dbname)) { 297 297 $command .= " -dbname $dbname";
Note:
See TracChangeset
for help on using the changeset viewer.
