IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Aug 17, 2008, 2:38:32 PM (18 years ago)
Author:
eugene
Message:

use PSPHOT.PSF.SKY.SAVE not PSPHOT.PSF.SAVE; drop old PSASTRO.OUTPUT.MEF; write path_base on failure; IGNORE, but do not fail on missing output PSF

File:
1 edited

Legend:

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

    r18934 r19098  
    119119my $outputWeight = $ipprc->filename("PSWARP.OUTPUT.WEIGHT", $outroot, $skycell_id);
    120120my $outputSources = $ipprc->filename("PSWARP.OUTPUT.SOURCES", $outroot, $skycell_id);
    121 my $outputPSF = $ipprc->filename("PSPHOT.PSF.SAVE", $outroot, $skycell_id);
     121my $outputPSF = $ipprc->filename("PSPHOT.PSF.SKY.SAVE", $outroot);
    122122my $outputBin1 = $ipprc->filename("PSWARP.BIN1", $outroot, $skycell_id );
    123123my $outputBin2 = $ipprc->filename("PSWARP.BIN2", $outroot, $skycell_id );
     
    144144    &my_die("Couldn't find input file: $mask", $warp_id, $skycell_id, $tess_dir, $PS_EXIT_SYS_ERROR) unless $ipprc->file_exists($mask);
    145145
    146     my $astrom;         # Astrometry file
    147     if ($astromSource eq 'PSASTRO.OUTPUT.MEF') {
    148         $astrom = $ipprc->filename($astromSource, $imfile->{cam_path_base});
    149     } elsif ($astromSource eq 'PSASTRO.OUTPUT') {
    150         my $chipRoot = $imfile->{chip_path_base};
    151         my $classID = $imfile->{class_id};
    152         $astrom = $ipprc->filename($astromSource, $chipRoot, $classID); # Astrometry file
    153     }
     146    my $astrom = $ipprc->filename($astromSource, $imfile->{cam_path_base});
    154147
    155148    &my_die("Couldn't find input file: $astrom", $warp_id, $skycell_id, $tess_dir, $PS_EXIT_SYS_ERROR) unless defined $astrom and $ipprc->file_exists($astrom);
     
    161154    if (!$wrote_astrom) {
    162155        print $astromFile "$astrom\n";
    163         # XXX simplify this?  only ever have one file for astrometry (must be MEF)
    164         if ($astromSource eq 'PSASTRO.OUTPUT.MEF') {
    165             $wrote_astrom = 1;
    166         }
     156        $wrote_astrom = 1;
    167157    }
    168158}
     
    178168    my $command = "$pswarp";
    179169    $command .= " -list $imageName";
     170    # $command .= " -threads 4";
    180171    $command .= " -masklist $maskName";
    181172    $command .= " -weightlist $weightName";
     
    184175    $command .= " -stats $outputStats";
    185176    $command .= " -recipe PPSTATS WARPSTATS";
     177    $command .= " -F PSPHOT.PSF.SAVE PSPHOT.PSF.SKY.SAVE";
    186178    $command .= " -psf";        # Turn on PSF determination
    187179    $command .= " -tracedest $traceDest -log $logDest";
     
    207199        or &my_die("Unable to parse metadata config", $warp_id, $skycell_id, $tess_dir, $PS_EXIT_PROG_ERROR);
    208200    $accept = metadataLookupBool($metadata, "ACCEPT");
     201
     202    # $accept is set above based on the fraction of lit pixels
     203    # XXX for some files, there may not be enough stars to find a good psf.  these should be dropped as well
     204    $accept &= $ipprc->file_exists($outputPSF);
     205
    209206    if ($accept) {
    210207        $stats->parse($metadata) or &my_die("Unable to find all values in statistics output.", $warp_id, $skycell_id, $tess_dir, $PS_EXIT_PROG_ERROR);
     
    214211        &my_die("Couldn't find expected output file: $outputWeight", $warp_id, $skycell_id, $tess_dir, $PS_EXIT_SYS_ERROR) unless $ipprc->file_exists($outputWeight);
    215212        &my_die("Couldn't find expected output file: $outputSources", $warp_id, $skycell_id, $tess_dir, $PS_EXIT_SYS_ERROR) unless $ipprc->file_exists($outputSources);
    216         &my_die("Couldn't find expected output file: $outputPSF", $warp_id, $skycell_id, $tess_dir, $PS_EXIT_SYS_ERROR) unless $ipprc->file_exists($outputPSF);
     213#    &my_die("Couldn't find expected output file: $outputPSF", $warp_id, $skycell_id, $tess_dir, $PS_EXIT_SYS_ERROR) unless $ipprc->file_exists($outputPSF);
    217214#    &my_die("Couldn't find expected output file: $outputBin1", $warp_id, $skycell_id, $tess_dir, $PS_EXIT_SYS_ERROR) unless $ipprc->file_exists($outputBin1);
    218215#    &my_die("Couldn't find expected output file: $outputBin2", $warp_id, $skycell_id, $tess_dir, $PS_EXIT_SYS_ERROR) unless $ipprc->file_exists($outputBin2);
     
    222219unless ($no_update) {
    223220    # XXX change -tess_id to -tess_dir when db is updated
    224     my $command = "$warptool -addwarped -warp_id $warp_id -skycell_id $skycell_id -tess_id $tess_dir";
    225     $command .= " -ignore" if not $accept; # Completed succesfully, but can't produce product
    226     $command .= " -uri $outputImage -path_base $outroot" if $accept;
    227     $command .= $stats->cmdflags() if $accept;
    228     $command .= " -hostname $host" if defined $host;
    229     $command .= " -dbname $dbname" if defined $dbname;
     221    my $command = "$warptool -addwarped";
     222    $command .= " -warp_id $warp_id";
     223    $command .= " -skycell_id $skycell_id";
     224    $command .= " -tess_id $tess_dir";
     225    $command .= " -path_base $outroot"; # needed for logfile lookups
     226    $command .= " -ignore"           if not $accept; # Completed succesfully, but can't produce product
     227    $command .= " -uri $outputImage" if $accept;
     228    $command .= $stats->cmdflags()   if $accept;
     229    $command .= " -hostname $host"   if defined $host;
     230    $command .= " -dbname $dbname"   if defined $dbname;
    230231
    231232    my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
     
    249250    if (defined $warp_id and defined $skycell_id and defined $tess_dir and not $no_update) {
    250251        # XXX change -tess_id to -tess_dir when db is updated
    251         my $command = "$warptool -addwarped -warp_id $warp_id -skycell_id $skycell_id -tess_id $tess_dir -code $exit_code";
     252        my $command = "$warptool -addwarped";
     253        $command .= " -warp_id $warp_id";
     254        $command .= " -skycell_id $skycell_id";
     255        $command .= " -tess_id $tess_dir";
     256        $command .= " -code $exit_code";
     257        $command .= " -path_base $outroot";
    252258        $command .= " -hostname $host" if defined $host;
    253259        $command .= " -dbname $dbname" if defined $dbname;
Note: See TracChangeset for help on using the changeset viewer.