IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Jun 7, 2010, 12:00:46 PM (16 years ago)
Author:
watersc1
Message:

Final changes before trunk->branch merge.

Then, simtest to see if it all works correctly.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/czw_branch/20100519/ippScripts/scripts/skycell_jpeg.pl

    r28045 r28245  
    3232    'save_temps'      => \$save_temps,
    3333    'masks'           => \$masks,
    34     'no-op'           => \$no_op,
    35     'no-update'       => \$no_update,
     34#    'no-op'           => \$no_op,
     35#    'no-update'       => \$no_update,
    3636    ) or pod2usage ( 2 );
    3737
    3838pod2usage( -msg => "Unknown option: @ARGV", -exitval => 2) if @ARGV;
    3939pod2usage(
    40     -msg => "Required options: --stage --stage_id --outroot",
     40    -msg => "Required options: --stage --stage_id --outroot\nHelpful options: --camera --dbname",
    4141    -exitval => 3,
    4242    ) unless
     
    8080        my $quality    = $imfile->{quality};
    8181        my $state      = $imfile->{data_state};
    82         my $tangent_base = $skycell_id;
     82        my $projection_cell = $skycell_id;
    8383        if ($quality == 8007 or $state ne 'full') {
    8484            next;
    8585        }
    8686
    87         $tangent_base =~ s/^(.*)\..*$/$1/;
    88        
    89         unless (exists($tangents{$tangent_base})) {
     87        $projection_cell =~ s/^(.*)\..*$/$1/;
     88       
     89        unless (exists($tangents{$projection_cell})) {
    9090            # Make a temp file and fill, but be sure to save
    91             ($tempFile, $tempName) = tempfile("/tmp/skycell.$tangent_base.XXXX",
     91            ($tempFile, $tempName) = tempfile("/tmp/skycell.$projection_cell.XXXX",
    9292                                                 UNLINK => !$save_temps);
    93             $tangents{$tangent_base}{FILE} = $tempFile;
    94             $tangents{$tangent_base}{NAME} = $tempName;
     93            $tangents{$projection_cell}{FILE} = $tempFile;
     94            $tangents{$projection_cell}{NAME} = $tempName;
    9595            if ($masks) {
    96                 my ($maskFile, $maskName) = tempfile("/tmp/skycell.$tangent_base.masks.XXXX",
     96                my ($maskFile, $maskName) = tempfile("/tmp/skycell.$projection_cell.masks.XXXX",
    9797                                                     UNLINK => !$save_temps);
    98                 $tangents{$tangent_base}{MFILE} = $maskFile;
    99                 $tangents{$tangent_base}{MNAME} = $maskName;
     98                $tangents{$projection_cell}{MFILE} = $maskFile;
     99                $tangents{$projection_cell}{MNAME} = $maskName;
    100100            }           
    101101        }
    102         print "$skycell_id $tangent_base\n";   
     102        print "$skycell_id $projection_cell\n";
    103103        my $file = $ipprc->filename("PSWARP.OUTPUT", $path_base, $skycell_id);
    104104        print "$file $state $quality\n";
    105         my $f_fh = $tangents{$tangent_base}{FILE};
     105        my $f_fh = $tangents{$projection_cell}{FILE};
    106106        print $f_fh "$file\n";
    107107        if ($masks) {
    108108            my $mask = $ipprc->filename("PSWARP.OUTPUT.MASK", $path_base, $skycell_id);
    109109            print "$mask\n";
    110             my $m_fh = $tangents{$tangent_base}{MFILE};
     110            my $m_fh = $tangents{$projection_cell}{MFILE};
    111111            print $m_fh "$mask\n";
    112112        }
    113113    }
    114     foreach my $tangent_base (keys %tangents) {
    115         $command = "$ppSkycell -images $tangents{$tangent_base}{NAME}";
    116         if ($masks) {
    117             $command .= " -masks $tangents{$tangent_base}{MNAME} ";
    118         }
    119         $command .= " ${outroot}.${tangent_base} ";
     114    foreach my $projection_cell (keys %tangents) {
     115        $command = "$ppSkycell -images $tangents{$projection_cell}{NAME}";
     116        if ($masks) {
     117            $command .= " -masks $tangents{$projection_cell}{MNAME} ";
     118        }
     119        $command .= " ${outroot}.${projection_cell} ";
    120120        print "$command\n";
    121121        ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) = run(command => $command, verbose => $verbose);
     
    125125        }
    126126        # Update database:
    127         $command = "$warptool -addsummary -warp_id $stage_id -tangent_base $tangent_base -outroot $outroot";
     127        $command = "$warptool -addsummary -warp_id $stage_id -projection_cell $projection_cell -outroot $outroot";
    128128        if (defined($dbname)) {
    129129            $command .= " -dbname $dbname";
     
    164164        my $quality    = $imfile->{quality};
    165165        my $state      = $imfile->{data_state};
    166         my $tangent_base = $skycell_id;
     166        my $projection_cell = $skycell_id;
    167167        if ($quality == 8007 or $state ne 'full') {
    168168            next;
    169169        }
    170170
    171         $tangent_base =~ s/^(.*)\..*$/$1/;
    172        
    173         unless (exists($tangents{$tangent_base})) {
     171        $projection_cell =~ s/^(.*)\..*$/$1/;
     172       
     173        unless (exists($tangents{$projection_cell})) {
    174174            # Make a temp file and fill, but be sure to save
    175             ($tempFile, $tempName) = tempfile("/tmp/skycell.$tangent_base.XXXX",
     175            ($tempFile, $tempName) = tempfile("/tmp/skycell.$projection_cell.XXXX",
    176176                                                 UNLINK => !$save_temps);
    177             $tangents{$tangent_base}{FILE} = $tempFile;
    178             $tangents{$tangent_base}{NAME} = $tempName;
     177            $tangents{$projection_cell}{FILE} = $tempFile;
     178            $tangents{$projection_cell}{NAME} = $tempName;
    179179            if ($masks) {
    180                 my ($maskFile, $maskName) = tempfile("/tmp/skycell.$tangent_base.masks.XXXX",
     180                my ($maskFile, $maskName) = tempfile("/tmp/skycell.$projection_cell.masks.XXXX",
    181181                                                     UNLINK => !$save_temps);
    182                 $tangents{$tangent_base}{MFILE} = $maskFile;
    183                 $tangents{$tangent_base}{MNAME} = $maskName;
     182                $tangents{$projection_cell}{MFILE} = $maskFile;
     183                $tangents{$projection_cell}{MNAME} = $maskName;
    184184            }           
    185185        }
    186         print "$skycell_id $tangent_base\n";   
     186        print "$skycell_id $projection_cell\n";
    187187        my $file = $ipprc->filename("PPSUB.OUTPUT", $path_base, $skycell_id);
    188188        print "$file $state $quality\n";
    189         my $f_fh = $tangents{$tangent_base}{FILE};
     189        my $f_fh = $tangents{$projection_cell}{FILE};
    190190        print $f_fh "$file\n";
    191191        if ($masks) {
    192192            my $mask = $ipprc->filename("PPSUB.OUTPUT.MASK", $path_base, $skycell_id);
    193193            print "$mask\n";
    194             my $m_fh = $tangents{$tangent_base}{MFILE};
     194            my $m_fh = $tangents{$projection_cell}{MFILE};
    195195            print $m_fh "$mask\n";
    196196        }
    197197    }
    198     foreach my $tangent_base (keys %tangents) {
    199         $command = "$ppSkycell -images $tangents{$tangent_base}{NAME}";
    200         if ($masks) {
    201             $command .= " -masks $tangents{$tangent_base}{MNAME} ";
    202         }
    203         $command .= " ${outroot}.${tangent_base} ";
     198    foreach my $projection_cell (keys %tangents) {
     199        $command = "$ppSkycell -images $tangents{$projection_cell}{NAME}";
     200        if ($masks) {
     201            $command .= " -masks $tangents{$projection_cell}{MNAME} ";
     202        }
     203        $command .= " ${outroot}.${projection_cell} ";
    204204        print "$command\n";
    205205        ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) = run(command => $command, verbose => $verbose);
     
    209209        }
    210210        # Update database:
    211         $command = "$difftool -addsummary -diff_id $stage_id -tangent_base $tangent_base -outroot $outroot";
     211        $command = "$difftool -addsummary -diff_id $stage_id -projection_cell $projection_cell -outroot $outroot";
    212212        if (defined($dbname)) {
    213213            $command .= " -dbname $dbname";
     
    248248        my $quality    = $imfile->{quality};
    249249        my $state      = $imfile->{data_state};
    250         my $tangent_base = $skycell_id;
     250        my $projection_cell = $skycell_id;
    251251        if ($quality == 8007 or $state ne 'full') {
    252252            next;
    253253        }
    254254
    255         $tangent_base =~ s/^(.*)\..*$/$1/;
    256        
    257         unless (exists($tangents{$tangent_base})) {
     255        $projection_cell =~ s/^(.*)\..*$/$1/;
     256       
     257        unless (exists($tangents{$projection_cell})) {
    258258            # Make a temp file and fill, but be sure to save
    259             ($tempFile, $tempName) = tempfile("/tmp/skycell.$tangent_base.XXXX",
     259            ($tempFile, $tempName) = tempfile("/tmp/skycell.$projection_cell.XXXX",
    260260                                                 UNLINK => !$save_temps);
    261             $tangents{$tangent_base}{FILE} = $tempFile;
    262             $tangents{$tangent_base}{NAME} = $tempName;
     261            $tangents{$projection_cell}{FILE} = $tempFile;
     262            $tangents{$projection_cell}{NAME} = $tempName;
    263263            if ($masks) {
    264                 my ($maskFile, $maskName) = tempfile("/tmp/skycell.$tangent_base.masks.XXXX",
     264                my ($maskFile, $maskName) = tempfile("/tmp/skycell.$projection_cell.masks.XXXX",
    265265                                                     UNLINK => !$save_temps);
    266                 $tangents{$tangent_base}{MFILE} = $maskFile;
    267                 $tangents{$tangent_base}{MNAME} = $maskName;
     266                $tangents{$projection_cell}{MFILE} = $maskFile;
     267                $tangents{$projection_cell}{MNAME} = $maskName;
    268268            }           
    269269        }
    270         print "$skycell_id $tangent_base\n";   
     270        print "$skycell_id $projection_cell\n";
    271271        my $file = $ipprc->filename("PPSTACK.OUTPUT", $path_base, $skycell_id);
    272272        print "$file $state $quality\n";
    273         my $f_fh = $tangents{$tangent_base}{FILE};
     273        my $f_fh = $tangents{$projection_cell}{FILE};
    274274        print $f_fh "$file\n";
    275275        if ($masks) {
    276276            my $mask = $ipprc->filename("PPSTACK.OUTPUT.MASK", $path_base, $skycell_id);
    277277            print "$mask\n";
    278             my $m_fh = $tangents{$tangent_base}{MFILE};
     278            my $m_fh = $tangents{$projection_cell}{MFILE};
    279279            print $m_fh "$mask\n";
    280280        }
    281281    }
    282     foreach my $tangent_base (keys %tangents) {
    283         $command = "$ppSkycell -images $tangents{$tangent_base}{NAME}";
    284         if ($masks) {
    285             $command .= " -masks $tangents{$tangent_base}{MNAME} ";
    286         }
    287         $command .= " ${outroot}.${tangent_base} ";
     282    foreach my $projection_cell (keys %tangents) {
     283        $command = "$ppSkycell -images $tangents{$projection_cell}{NAME}";
     284        if ($masks) {
     285            $command .= " -masks $tangents{$projection_cell}{MNAME} ";
     286        }
     287        $command .= " ${outroot}.${projection_cell} ";
    288288        print "$command\n";
    289289        ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) = run(command => $command, verbose => $verbose);
     
    293293        }
    294294        # Update database:
    295         $command = "$stacktool -addsummary -stack_id $stage_id -tangent_base $tangent_base -outroot $outroot";
     295        $command = "$stacktool -addsummary -stack_id $stage_id -projection_cell $projection_cell -outroot $outroot";
    296296        if (defined($dbname)) {
    297297            $command .= " -dbname $dbname";
Note: See TracChangeset for help on using the changeset viewer.