Changeset 28575
- Timestamp:
- Jul 1, 2010, 1:47:13 PM (16 years ago)
- File:
-
- 1 edited
-
trunk/ippScripts/scripts/diffphot.pl (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ippScripts/scripts/diffphot.pl
r28490 r28575 31 31 my $diffphottool = can_run('diffphottool') or (warn "Can't find diffphottool" and $missing_tools = 1); 32 32 my $psphot = can_run('psphot') or (warn "Can't find psphot" and $missing_tools = 1); 33 my $ppArith = can_run('ppArith') or (warn "Can't find ppArith" and $missing_tools = 1);34 33 my $ppStatsFromMetadata = can_run('ppStatsFromMetadata') or (warn "Can't find ppStatsFromMetadata" and $missing_tools = 1); 35 34 if ($missing_tools) { … … 177 176 # Do reverse photometry 178 177 if ($bothways) { 179 my ($tempFile, $tempName) = tempfile( "/tmp/diffphot.$diff_phot_id.$skycell_id.XXXX", 180 UNLINK => !$save_temps, SUFFIX => '.fits' ); 181 { 182 my ($tempRoot) = $tempName =~ /^(.*).fits/; 183 my $command = "$ppArith $tempRoot -file1 $inputImage -op \\* -const2 -1"; 184 unless ($no_op) { 185 my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) = 186 run(command => $command, verbose => $verbose); 187 unless ($success) { 188 $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR); 189 &my_die("Unable to perform ppArith: $error_code", $diff_phot_id, $skycell_id, $error_code); 190 } 191 &my_die("Couldn't find expected output file: $tempName", $diff_phot_id, $skycell_id, $PS_EXIT_SYS_ERROR) unless $ipprc->file_exists($tempName); 192 } else { 193 print "Skipping command: $command\n"; 194 } 195 } 178 my $inputImage = $ipprc->filename("PPSUB.INVERSE", $inputPath); 179 my $inputMask = $ipprc->filename("PPSUB.INVERSE.MASK", $inputPath); 180 my $inputVariance = $ipprc->filename("PPSUB.INVERSE.VARIANCE", $inputPath); 181 &my_die("Couldn't find input: $inputImage", $diff_phot_id, $skycell_id, $PS_EXIT_SYS_ERROR) unless $ipprc->file_exists($inputImage); 182 &my_die("Couldn't find input: $inputMask", $diff_phot_id, $skycell_id, $PS_EXIT_SYS_ERROR) unless $ipprc->file_exists($inputMask); 183 &my_die("Couldn't find input: $inputVariance", $diff_phot_id, $skycell_id, $PS_EXIT_SYS_ERROR) unless $ipprc->file_exists($inputVariance); 196 184 197 185 # Get the output filenames … … 201 189 202 190 my $command = "$psphot $outroot.neg"; 203 $command .= " -file $ tempName";191 $command .= " -file $inputImage"; 204 192 $command .= " -mask $inputMask"; 205 193 $command .= " -variance $inputVariance";
Note:
See TracChangeset
for help on using the changeset viewer.
