Changeset 24396 for trunk/ippScripts/scripts/chip_imfile.pl
- Timestamp:
- Jun 14, 2009, 10:22:38 AM (17 years ago)
- File:
-
- 1 edited
-
trunk/ippScripts/scripts/chip_imfile.pl (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ippScripts/scripts/chip_imfile.pl
r24352 r24396 20 20 use PS::IPP::Metadata::Config; 21 21 use PS::IPP::Config 1.01 qw( :standard ); 22 use File::Temp qw( tempfile ); 22 23 23 24 use Getopt::Long qw( GetOptions :config auto_help auto_version gnu_getopt ); … … 39 40 # Parse the command-line arguments 40 41 my ( $exp_id, $chip_id, $class_id, $chip_imfile_id, $uri, $camera, $outroot, $dbname, $run_state, $reduction, $threads, $verbose, 41 $no_update, $ no_op, $redirect, $magicked, $deburned );42 $no_update, $save_temps, $no_op, $redirect, $magicked, $deburned ); 42 43 GetOptions( 43 44 'exp_id=s' => \$exp_id, # Exposure identifier … … 58 59 'no-op' => \$no_op, # Don't do any operations? 59 60 'redirect-output' => \$redirect, 61 'save-temps' => \$save_temps, # Save temporary files? 60 62 ) or pod2usage( 2 ); 61 63 … … 144 146 $uri =~ s/fits$/burn.fits/; 145 147 &my_die("Couldn't find deburned input file: $uri\n", $exp_id, $chip_id, $class_id, $PS_EXIT_SYS_ERROR) unless $ipprc->file_exists($uri); 148 } 149 150 # apply the 'tiltystreak' operation, if desired 151 my $applyTiltyStreak = metadataLookupBool($recipeData, 'APPLY.TILTYSTREAK'); 152 if ($applyTiltyStreak) { 153 154 my ($success, $error_code, $full_buf, $stdout_buf, $stderr_buf); 155 156 # XXX make these optional (must be built by psbuild as well...) 157 my $funpack = can_run('funpack') or &my_die ("Can't find funpack", $exp_id, $chip_id, $class_id, $PS_EXIT_SYS_ERROR); 158 my $tiltystreak = can_run('tiltystreak') or &my_die ("Can't find tiltystreak", $exp_id, $chip_id, $class_id, $PS_EXIT_SYS_ERROR); 159 160 # create an temporary output file: 161 my ($tempFile, $tempName) = tempfile( "/tmp/chip.$exp_id.$class_id.tmp.XXXX", UNLINK => !$save_temps ); 162 163 print "uri: $uri\n"; 164 165 # get the UNIX version of the (possible) neb: or path: filename 166 my $uriReal = $ipprc->file_resolve( $uri ); 167 168 print "uriReal: $uriReal\n"; 169 170 # unpack the data (is a NOP if not compressed) 171 $command = "$funpack -S $uriReal > $tempName"; 172 ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) = run(command => $command, verbose => $verbose); 173 unless ($success) { 174 $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR); 175 &my_die("Unable to perform funpack: $error_code", $exp_id, $chip_id, $class_id, $PS_EXIT_SYS_ERROR); 176 } 177 178 # run tiltystreak 179 $command = "$tiltystreak $tempName"; 180 ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) = run(command => $command, verbose => $verbose); 181 unless ($success) { 182 $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR); 183 &my_die("Unable to perform tiltystreak: $error_code", $exp_id, $chip_id, $class_id, $PS_EXIT_SYS_ERROR); 184 } 185 186 # supply the output file as the new input file 187 $uri = $tempName; 146 188 } 147 189
Note:
See TracChangeset
for help on using the changeset viewer.
