IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 16021


Ignore:
Timestamp:
Jan 6, 2008, 2:00:49 PM (18 years ago)
Author:
eugene
Message:

use recipe options to select astrometry source

File:
1 edited

Legend:

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

    r15738 r16021  
    134134
    135135# Get list of filenames
    136 my ($imageFile, $imageName) = tempfile( "$tess_id.$skycell_id.wrp$warp_id.image.list.XXXX", UNLINK => !$save_temps);
    137 my ($maskFile, $maskName) = tempfile( "$tess_id.$skycell_id.wrp$warp_id.mask.list.XXXX", UNLINK => !$save_temps);
     136my ($imageFile,  $imageName)  = tempfile( "$tess_id.$skycell_id.wrp$warp_id.image.list.XXXX", UNLINK => !$save_temps);
     137my ($maskFile,   $maskName)   = tempfile( "$tess_id.$skycell_id.wrp$warp_id.mask.list.XXXX",  UNLINK => !$save_temps);
    138138my ($weightFile, $weightName) = tempfile( "$tess_id.$skycell_id.wrp$warp_id.weight.list.XXXX", UNLINK => !$save_temps);
    139 my $inputAstrom;
     139my ($astromFile, $astromName) = tempfile( "$tess_id.$skycell_id.wrp$warp_id.astrom.list.XXXX", UNLINK => !$save_temps);
     140
     141# XXXX this is inconsistent: what is the goal of inputAstrom?
     142my $inputAstrom = 0;
    140143foreach my $imfile (@$imfiles) {
    141144    my $image = $imfile->{uri}; # Image name
     
    146149    &my_die("Couldn't find input file: $mask", $warp_id, $skycell_id, $tess_id, $PS_EXIT_SYS_ERROR) unless $ipprc->file_exists($mask);
    147150
    148     my $astrom;                 # Astrometry file
    149     if ($astromSource and $astromSource ne 'NULL') {
     151    my $astrom;         # Astrometry file
     152    if ($astromSource eq 'PSASTRO.OUTPUT.MEF') {
    150153        $astrom = $ipprc->filename($astromSource, $imfile->{cam_path_base});
    151154        &my_die("Couldn't find input file: $astrom", $warp_id, $skycell_id, $tess_id, $PS_EXIT_SYS_ERROR) unless $ipprc->file_exists($astrom);
    152     }
    153 
    154     print $imageFile ( $image . "\n");
    155     print $maskFile ( $mask  . "\n");
    156     print $weightFile ( $weight  . "\n");
    157 
    158     if (defined $inputAstrom and defined $astrom) {
    159         &my_die("Astrometry files don't match: $inputAstrom vs $astrom", $warp_id, $skycell_id, $tess_id, $PS_EXIT_SYS_ERROR) unless $inputAstrom eq $astrom;
    160     } else {
    161         $inputAstrom = $astrom;
     155        $inputAstrom = 1;
     156    }
     157    if ($astromSource eq 'PSASTRO.OUTPUT') {
     158        my $chipRoot = $imfile->{chip_path_base};
     159        my $classID = $imfile->{class_id};
     160        $astrom = $ipprc->filename($astromSource, $chipRoot, $classID); # Astrometry file
     161        $inputAstrom = 1;
     162    }
     163
     164    if ($inputAstrom) {
     165        print $imageFile  "$image\n";
     166        print $maskFile   "$mask\n";
     167        print $weightFile "$weight\n";
     168        print $astromFile "$astrom\n";
    162169    }
    163170}
     
    165172close $maskFile;
    166173close $weightFile;
     174close $astromFile;
    167175
    168176# Run pswarp
    169177my $accept = 1;                 # Accept the skycell?
    170178unless ($no_op) {
    171     my $command = "$pswarp -list $imageName";
     179    my $command = "$pswarp";
     180    $command .= " -list $imageName";
    172181    $command .= " -masklist $maskName";
    173182    $command .= " -weightlist $weightName";
    174     $command .= " -astrom $inputAstrom" if defined $inputAstrom;
     183    $command .= " -astromlist $astromName" if $inputAstrom;
    175184    $command .= " $outputRoot $skyFile";
    176185    $command .= " -stats $outputStats";
    177186    $command .= " -recipe PPSTATS WARPSTATS";
    178     $command .= " -psf";        # Turn on PSF determination
     187    # $command .= " -psf";      # Turn on PSF determination
    179188    $command .= " -tracedest $traceDest -log $logDest";
    180189
     
    205214        &my_die("Couldn't find expected output file: $outputWeight", $warp_id, $skycell_id, $tess_id, $PS_EXIT_SYS_ERROR) unless $ipprc->file_exists($outputWeight);
    206215        &my_die("Couldn't find expected output file: $outputSources", $warp_id, $skycell_id, $tess_id, $PS_EXIT_SYS_ERROR) unless $ipprc->file_exists($outputSources);
    207         &my_die("Couldn't find expected output file: $outputPSF", $warp_id, $skycell_id, $tess_id, $PS_EXIT_SYS_ERROR) unless $ipprc->file_exists($outputPSF);
     216        # &my_die("Couldn't find expected output file: $outputPSF", $warp_id, $skycell_id, $tess_id, $PS_EXIT_SYS_ERROR) unless $ipprc->file_exists($outputPSF);
    208217#    &my_die("Couldn't find expected output file: $outputBin1", $warp_id, $skycell_id, $tess_id, $PS_EXIT_SYS_ERROR) unless $ipprc->file_exists($outputBin1);
    209218#    &my_die("Couldn't find expected output file: $outputBin2", $warp_id, $skycell_id, $tess_id, $PS_EXIT_SYS_ERROR) unless $ipprc->file_exists($outputBin2);
Note: See TracChangeset for help on using the changeset viewer.