Changeset 35686 for trunk/ippScripts/scripts/chip_imfile.pl
- Timestamp:
- Jun 20, 2013, 11:37:13 AM (13 years ago)
- File:
-
- 1 edited
-
trunk/ippScripts/scripts/chip_imfile.pl (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ippScripts/scripts/chip_imfile.pl
r35685 r35686 224 224 } 225 225 226 my $no_compress = metadataLookupBool($recipeData, 'NO.COMPRESS'); 227 228 ## XXX make the feature more general? 226 my $no_compress_image = metadataLookupBool($recipeData, 'NO.COMPRESS'); 227 229 228 my $useDeburnedImage = metadataLookupBool($recipeData, 'USE.DEBURNED.IMAGE'); 230 229 my $ppImageApplyBurntool = metadataLookupBool($recipeData, 'APPLY.BURNTOOL'); … … 330 329 } 331 330 332 # if recipe option to have ppImage apply burntool is set and the burntool information is store in 333 # an external table, check the existence of that table file and set $burntoolArgument. 334 # If burntool state does not match fall through to the code that uses the burntool program 331 # if recipe option PPIMAGE:APPLY.BURNTOOL is set and the burntool information is stored in 332 # an external table (usual case), check the existence of that table file and set $burntoolArgument. 333 # If burntool state does not match, say if the burntool data is stored in a fits extension in 334 # the rawImfile, use the burntool program. 335 335 if ($ppImageApplyBurntool && ($burntoolState == -1 * $burntoolStateGood)) { 336 336 my $burntoolTable_uri = $uri; … … 339 339 if ((!$burntoolTable_uriReal)||(!($ipprc->file_exists($burntoolTable_uri)))) { 340 340 my $repair_cmd = "$nebrepair $burntoolTable_uri"; 341 my ($repair_success, $repair_error_code, $repair_full_buf, $repair_stdout_buf, $repair_stderr_buf ) = run(command => $repair_cmd, verbose => $verbose); 341 my ($repair_success, $repair_error_code, $repair_full_buf, $repair_stdout_buf, $repair_stderr_buf ) 342 = run(command => $repair_cmd, verbose => $verbose); 342 343 unless ($repair_success) { 343 &my_die("Unable to attempt repair: $uri $repair_error_code", $exp_id,$chip_id, $class_id, $PS_EXIT_SYS_ERROR); 344 &my_die("Unable to attempt repair: $uri $repair_error_code", $exp_id,$chip_id, $class_id, 345 $PS_EXIT_SYS_ERROR); 344 346 } 345 347 $burntoolTable_uriReal = $ipprc->file_resolve( $burntoolTable_uri ); 346 348 } 347 349 unless ($ipprc->file_exists($burntoolTable_uri)) { 348 # Catch errors here349 &my_die("Couldn't find burntool table: $burntoolTable_uri",$exp_id,$chip_id,$class_id,$PS_EXIT_SYS_ERROR);350 &my_die("Couldn't find burntool table: $burntoolTable_uri",$exp_id,$chip_id,$class_id, 351 $PS_EXIT_SYS_ERROR); 350 352 } 351 353 $burntoolArgument = " -burntool $burntoolTable_uri"; 352 354 } else { 355 ## use external burntool program 353 356 354 357 ## We now know that we have an image that has been burntooled. … … 435 438 } 436 439 437 # apply the 'tiltystreak' operation, if desired438 440 my $tiltystreakApply = metadataLookupBool($recipeData, 'TILTYSTREAK.APPLY'); 439 441 if ($tiltystreakApply) { 440 441 my $tiltystreakByClass = metadataLookupMD($recipeData, 'TILTYSTREAK.BY.CLASS'); 442 my $tiltystreakClassApply = metadataLookupBool($tiltystreakByClass, "APPLY.$class_id"); 443 if ($tiltystreakClassApply) { 444 445 my $tiltystreakClassOptions = metadataLookupStr($tiltystreakByClass, "OPTIONS.$class_id"); 446 if ($tiltystreakClassOptions eq "none") { 447 $tiltystreakClassOptions = ""; 448 } 449 450 my ($success, $error_code, $full_buf, $stdout_buf, $stderr_buf); 451 452 # XXX make these optional (must be built by psbuild as well...) 453 my $funpack = can_run('funpack') or &my_die ("Can't find funpack", $exp_id, $chip_id, $class_id, $PS_EXIT_SYS_ERROR); 454 my $tiltystreak = can_run('tiltystreak') or &my_die ("Can't find tiltystreak", $exp_id, $chip_id, $class_id, $PS_EXIT_SYS_ERROR); 455 456 # create an temporary output file: 457 my ($tempFile, $tempName) = tempfile( "/tmp/chip.$exp_id.$class_id.tmp.XXXX", UNLINK => !$save_temps ); 458 459 print "uri: $uri\n"; 460 461 # get the UNIX version of the (possible) neb: or path: filename 462 my $uriReal = $ipprc->file_resolve( $uri ); 463 464 print "uriReal: $uriReal\n"; 465 466 # unpack the data (is a NOP if not compressed) 467 $command = "$funpack -S $uriReal > $tempName"; 468 ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) = run(command => $command, verbose => $verbose); 469 unless ($success) { 470 $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR); 471 &my_die("Unable to perform funpack: $error_code", $exp_id, $chip_id, $class_id, $PS_EXIT_SYS_ERROR); 472 } 473 474 # run tiltystreak 475 $command = "$tiltystreak $tempName $tiltystreakClassOptions"; 476 ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) = run(command => $command, verbose => $verbose); 477 unless ($success) { 478 $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR); 479 &my_die("Unable to perform tiltystreak: $error_code", $exp_id, $chip_id, $class_id, $PS_EXIT_SYS_ERROR); 480 } 481 482 # supply the output file as the new input file 483 $uri = $tempName; 484 } 442 # NOTE: application of TILTYSTREAK.APPLY was here. Removed after r35685 443 &my_die("Unable to perform tiltystreak: code has been removed", $exp_id, $chip_id, $class_id, 444 $PS_EXIT_PROG_ERROR); 485 445 } 486 446 … … 505 465 $command .= " -Db PPIMAGE:BIN1.FITS FALSE -Db PPIMAGE:BIN2.FITS FALSE"; 506 466 } 507 if ($no_compress ) {467 if ($no_compress_image) { 508 468 $command .= " -R PPIMAGE.CHIP FITS.TYPE NONE"; 509 469 }
Note:
See TracChangeset
for help on using the changeset viewer.
