IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 30542


Ignore:
Timestamp:
Feb 9, 2011, 11:12:19 AM (15 years ago)
Author:
bills
Message:

From trunk (and production tag) allow muggle stamps from stages other than chip
unless state is 'update'

File:
1 edited

Legend:

Unmodified
Added
Removed
  • tags/ipp-20101215/pstamp/scripts/pstamp_job_run.pl

    r30321 r30542  
    1414use File::Basename;
    1515use File::Copy;
    16 use File::Temp qw(tempfile);
     16use File::Temp qw(tempfile tempdir);
    1717use Digest::MD5::File qw( file_md5_hex );
    1818use PS::IPP::PStamp::RequestFile qw( :standard );
     
    144144        } elsif (($options & $PSTAMP_REQUIRE_UNCENSORED) and ($stage ne 'chip')) {
    145145            # user required uncensored but since stage isn't chip we can't rebuild them
    146             my_die("uncensored inputs not available for job $job_id", $job_id, $PSTAMP_NOT_AVAILABLE);
    147         } elsif (($options & $PSTAMP_REQUEST_UNCENSORED) and ($stage ne 'chip')) {
     146            my_die("uncensored inputs not available for job $job_id", $job_id, $PSTAMP_NOT_AVAILABLE, 'stop');
     147        } elsif (($options & $PSTAMP_REQUEST_UNCENSORED) and ($params->{state} eq 'update') and ($stage ne 'chip')) {
     148            # we can only restore pixels for chip stage images if the data has been updated.
     149            # XXX: this test is not quite good enough. If all components have been updated then the
     150            # state will be 'full' But this will get us going.
     151            print "Run state is update: will make stamps from destreaked $stage images.\n";
    148152            # make stamps from uncensored images
    149153            $muggle = 0;
     
    151155            # Try and replace the streaks from the recovery images
    152156
    153             @file_list = ();
    154             $tmproot = "$outdir/$job_id";
    155             mkdir $tmproot or
    156                 my_die( "failed to create temporary directory $tmproot", $job_id, $PS_EXIT_UNKNOWN_ERROR);
     157            my $temp_dir = metadataLookupStr($ipprc->{_siteConfig}, "TEMP.DIR") or &my_die("Unable to find temporary directory in site configuration", $job_id, $PS_EXIT_CONFIG_ERROR);
     158            $tmproot = tempdir("$temp_dir/psjob.$job_id.XXXX", CLEANUP => !$save_temps);
    157159            my $muggle_command = "$streaksreplace -stage $stage -tmproot $tmproot";
    158160            # find the "directory" of the input path_base
     
    160162            my $base = basename($image);
    161163            $tmpImage = "$tmproot/$base";
     164
     165            @file_list = ();
    162166
    163167            # XXX: We should get the recovery_path_base from the magicDSFile but that requires a bunch of file rule and
     
    180184                $base = basename($variance);
    181185                $tmpVariance = "$tmproot/$base";
    182                 $newFileArgs .= " -weight $tmpVariance";
     186                $newFileArgs .= " -variance $tmpVariance";
    183187                my $recVariance = "$inputdir/REC_$base";
    184188                $muggle_command .= " -weight $variance -recweight $recVariance";
     
    225229    }
    226230
    227     if (!$save_temps) {
    228         unlink $tmpImage if $tmpImage;
    229         unlink $tmpMask if $tmpMask;
    230         unlink $tmpVariance if $tmpVariance;
    231         rmdir $tmproot if $tmproot;
    232     }
    233 
    234231    if ($exitStatus == 0) {
    235232        my $reglist = "$outdir/reglist$job_id";
Note: See TracChangeset for help on using the changeset viewer.