IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 13859


Ignore:
Timestamp:
Jun 16, 2007, 3:51:06 PM (19 years ago)
Author:
Paul Price
Message:

There's only one astrometry file for all the images from a camera.
Don't die if the statistics file is empty.

File:
1 edited

Legend:

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

    r13829 r13859  
    9797my ($list1File, $list1Name) = tempfile( "$tess_id.$skycell_id.wrp$warp_id.image.list.XXXX", UNLINK => 1);
    9898my ($list2File, $list2Name) = tempfile( "$tess_id.$skycell_id.wrp$warp_id.mask.list.XXXX", UNLINK => 1);
    99 my ($list3File, $list3Name) = tempfile( "$tess_id.$skycell_id.wrp$warp_id.astrom.list.XXXX", UNLINK => 1);
     99my $inputAstrom;
    100100foreach my $imfile (@$imfiles) {
    101101    my $image = $imfile->{uri}; # Image name
    102     my $mask = $ipprc->filename("PPIMAGE.OUTPUT.MASK", $imfile->{chip_path_base}, $imfile->{class_id}); # Mask name
     102    my $mask = $ipprc->filename("PPIMAGE.CHIP.MASK", $imfile->{chip_path_base}, $imfile->{class_id}); # Mask name
    103103    my $astrom = $ipprc->filename("PSASTRO.OUTPUT.MEF", $imfile->{cam_path_base}); # Astrometry file name
    104104
     
    109109    print $list1File ( $image . "\n");
    110110    print $list2File ( $mask  . "\n");
    111     print $list3File ( $astrom  . "\n");
     111    if (defined $inputAstrom) {
     112        &my_die("Astrometry files don't match: $inputAstrom vs $astrom", $warp_id, $skycell_id, $tess_id, $PS_EXIT_SYS_ERROR) unless $inputAstrom eq $astrom;
     113    } else {
     114        $inputAstrom = $astrom;
     115    }
    112116}
    113117close $list1File;
    114118close $list2File;
    115 close $list3File;
    116119
    117120# Run pswarp
     
    120123    my $command = "$pswarp -list $list1Name";
    121124    $command .= " -masklist $list2Name";
    122     $command .= " -astromlist $list3Name";
     125    $command .= " -astrom $inputAstrom";
    123126    $command .= " $outputRoot $skyFile";
    124127    $command .= " -stats $outputStats";
     
    142145    my @contents = <$statsFile>; # Contents of file
    143146    close $statsFile;
    144     my $metadata = $mdcParser->parse(join "", @contents)
    145         or &my_die("Unable to parse metadata config", $warp_id, $skycell_id, $tess_id, $PS_EXIT_PROG_ERROR);
    146     $stats->parse($metadata) or &my_die("Unable to find all values in statistics output.", $warp_id, $skycell_id, $tess_id, $PS_EXIT_PROG_ERROR);
     147    my $contents = join "", @contents;
     148
     149    # Just in case the statistics was impossible to do, e.g., small overlap:
     150    if ($contents !~ /^\s*$/) {
     151        my $metadata = $mdcParser->parse($contents)
     152            or &my_die("Unable to parse metadata config", $warp_id, $skycell_id, $tess_id, $PS_EXIT_PROG_ERROR);
     153        $stats->parse($metadata) or &my_die("Unable to find all values in statistics output.", $warp_id, $skycell_id, $tess_id, $PS_EXIT_PROG_ERROR);
     154    }
    147155}
    148156
Note: See TracChangeset for help on using the changeset viewer.