IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Jul 24, 2013, 5:29:24 PM (13 years ago)
Author:
watersc1
Message:

Updated skycell_jpeg.pl to correctly skip undoable things, and to pass wcsref to the new ppSkycell code. Split masks and images, as doing them simultaneously makes ppSkycell unusably slow (it's no longer a reasonably simple copy operation)

File:
1 edited

Legend:

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

    r34800 r35853  
    1717my ($help,$masks);
    1818my ($tempFile,$tempName,$maskFile,$maskName);
     19$verbose = 0;
    1920my $ppSkycell = can_run('ppSkycell') or (warn "Can't find ppSkycell" and $missing_tools = 1);
    2021my $warptool  = can_run('warptool') or (warn "Can't find warptool" and $missing_tools = 1);
     
    3839pod2usage( -msg => "Unknown option: @ARGV", -exitval => 2) if @ARGV;
    3940pod2usage(
    40     -msg => "Required options: --stage --stage_id --path_base\nHelpful options: --camera --dbname",
     41    -msg => "Required options: --stage --stage_id --outroot\nHelpful options: --camera --dbname",
    4142    -exitval => 3,
    4243    ) unless
     
    100101            }           
    101102        }
    102         print "$skycell_id $projection_cell\n";
     103#       print "$skycell_id $projection_cell\n";
    103104        my $file = $ipprc->filename("PSWARP.OUTPUT", $path_base, $skycell_id);
    104         print "$file $state $quality\n";
     105#       print "$file $state $quality\n";
    105106        my $f_fh = $tangents{$projection_cell}{FILE};
    106107        print $f_fh "$file\n";
    107108        if ($masks) {
    108109            my $mask = $ipprc->filename("PSWARP.OUTPUT.MASK", $path_base, $skycell_id);
    109             print "$mask\n";
     110#           print "$mask\n";
    110111            my $m_fh = $tangents{$projection_cell}{MFILE};
    111112            print $m_fh "$mask\n";
     
    118119        }
    119120        $command .= " ${outroot}.${projection_cell} ";
    120         print "$command\n";
     121#       print "$command\n";
    121122        ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) = run(command => $command, verbose => $verbose);
    122123        unless ($success) {
     
    197198            }           
    198199        }
    199         print "$skycell_id $projection_cell\n";
     200#       print "$skycell_id $projection_cell\n";
    200201        my $file = $ipprc->filename("PPSUB.OUTPUT", $path_base, $skycell_id);
    201         print "$file $state $quality\n";
     202#       print "$file $state $quality\n";
    202203        my $f_fh = $tangents{$projection_cell}{FILE};
    203204        print $f_fh "$file\n";
    204205        if ($masks) {
    205206            my $mask = $ipprc->filename("PPSUB.OUTPUT.MASK", $path_base, $skycell_id);
    206             print "$mask\n";
     207#           print "$mask\n";
    207208            my $m_fh = $tangents{$projection_cell}{MFILE};
    208209            print $m_fh "$mask\n";
     
    215216        }
    216217        $command .= " ${outroot}.${projection_cell} ";
    217         print "$command\n";
     218#       print "$command\n";
    218219        ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) = run(command => $command, verbose => $verbose);
    219220        unless ($success) {
     
    297298                $tangents{$projection_cell}{$key}{FILE} = $tempFile;
    298299                $tangents{$projection_cell}{$key}{NAME} = $tempName;
     300                $tangents{$projection_cell}{$key}{N}    = 0;
    299301            }
    300302        }
    301303        foreach my $key (keys %products) {
    302             print "$skycell_id $projection_cell\n";     
     304#           print "$skycell_id $projection_cell\n";     
    303305            my $file = $ipprc->filename($products{$key}, $path_base, $skycell_id);
    304             print "$file $state $quality\n";
     306#           print "$file $state $quality\n";
    305307            my $f_fh = $tangents{$projection_cell}{$key}{FILE};
    306             print $f_fh "$file\n";
     308            if ($ipprc->file_exists($file)) {
     309                print $f_fh "$file\n";
     310                $tangents{$projection_cell}{$key}{N} ++;
     311            }
    307312        }
    308313    }
     
    322327                $command .= " -Di BIN1 1 -Di BIN2 1 ";
    323328            }
    324             elsif ($key eq 'image') {
    325                 $command .= " -masks $tangents{$projection_cell}{mask}{NAME} ";
    326             }
    327             elsif ($key eq 'mask') {
    328                 next; # This should be made with the images.
    329             }
    330             print "$command\n";
    331             ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) = run(command => $command, verbose => $verbose);
    332             unless ($success) {
    333                 $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR);
    334                 &my_die("unable to perform ppSkycell: $error_code", $stage_id, $error_code);
     329#           elsif ($key eq 'image') {
     330#               $command .= " -masks $tangents{$projection_cell}{mask}{NAME} ";
     331#           }
     332#           elsif ($key eq 'mask') {
     333#               next; # This should be made with the images.
     334#           }
     335            else {
     336                # Append the image list to other objects, in case the WCS information is unpopulated
     337                $command .= " -wcsref $tangents{$projection_cell}{image}{NAME} ";
     338            }
     339            if ($tangents{$projection_cell}{$key}{N} > 0) {
     340                print "$command\n";
     341                ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) = run(command => $command, verbose => $verbose);
     342                unless ($success) {
     343                    $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR);
     344#                   print "Was unable to perform ppSkycell $stage_id $error_code $key\n";
     345                    &my_die("unable to perform ppSkycell: $error_code", $stage_id, $error_code);
     346                }
    335347            }
    336348        }
Note: See TracChangeset for help on using the changeset viewer.