IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Jul 1, 2010, 1:47:13 PM (16 years ago)
Author:
Paul Price
Message:

Flipping the sign of the image wasn't the right thing to do because that means the output inherits the wrong header. Rather, we should be using the inverse image, which should be available.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/ippScripts/scripts/diffphot.pl

    r28490 r28575  
    3131my $diffphottool = can_run('diffphottool') or (warn "Can't find diffphottool" and $missing_tools = 1);
    3232my $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);
    3433my $ppStatsFromMetadata = can_run('ppStatsFromMetadata') or (warn "Can't find ppStatsFromMetadata" and $missing_tools = 1);
    3534if ($missing_tools) {
     
    177176# Do reverse photometry
    178177if ($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);
    196184
    197185    # Get the output filenames
     
    201189
    202190    my $command = "$psphot $outroot.neg";
    203     $command .= " -file $tempName";
     191    $command .= " -file $inputImage";
    204192    $command .= " -mask $inputMask";
    205193    $command .= " -variance $inputVariance";
Note: See TracChangeset for help on using the changeset viewer.