IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 35853 for trunk/ippScripts


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)

Location:
trunk/ippScripts/scripts
Files:
3 edited

Legend:

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

    r35681 r35853  
    3434my $ppConfigDump = can_run('ppConfigDump') or (warn "Can't find ppConfigDump" and $missing_tools = 1);
    3535my $ppStatsFromMetadata = can_run('ppStatsFromMetadata') or (warn "Can't find ppStatsFromMetadata" and $missing_tools = 1);
     36my $ppImage = can_run('ppImage') or (warn "Can't find ppImage" and $missing_tools = 1);
    3637if ($missing_tools) {
    3738    warn("Can't find required tools.");
     
    134135}
    135136my $in_wt = $ipprc->filename("PPIMAGE.CHIP.VARIANCE", $in_path, $class_id);
    136 my $in_bg = $ipprc->filename("PSPHOT.BACKMDL", $in_path, $class_id);
     137my $in_bg;
     138if (1) {
     139    $in_bg = $ipprc->filename("PPIMAGE.BACKMDL", $cam_path_base, $class_id);
     140}
     141else {
     142    $in_bg = $ipprc->filename("PSPHOT.BACKMDL", $in_path, $class_id);
     143}
    137144my $in_pattern = $ipprc->filename("PPIMAGE.PATTERN", $in_path, $class_id);
    138145my $in_config = $ipprc->filename("PPIMAGE.CONFIG", $in_path, $class_id);
     
    220227}
    221228
     229my $do_binned_images = 1;   # Generate the binned images that are useful for making JPEGs
     230if ($do_binned_images) {
     231    my $command = "$ppImage -file $out_image -mask $out_mask $outroot -recipe PPIMAGE PPIMAGE_PA -Db PHOTOM F";
     232    my ($success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
     233        run(command => $command, verbose => $verbose);
     234    unless ($success) {
     235        $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR);
     236        &my_die("Unable to perform ppImage: $error_code", $chip_bg_id, $class_id, $error_code);
     237    }
     238}
     239
     240
    222241if (!$quality and !$no_op) {
    223242    &my_die("Couldn't find expected output file: $out_image", $chip_bg_id, $class_id, $PS_EXIT_SYS_ERROR) unless $ipprc->file_exists($out_image);
  • trunk/ippScripts/scripts/lap_science.pl

    r35810 r35853  
    309309    my $magicDS_update_cmd  = "magicdstool -setfiletoupdate -magic_ds_id $chip_magicDS_id -set_label $label";
    310310    $magicDS_update_cmd    .= " -dbname $dbname " if defined $dbname;
     311    my $warptool_preupdate_cmd = "warptool -revertwarped -warp_id $warp_id -fault 26";
     312    $warptool_preupdate_cmd .= " -dbname $dbname " if defined $dbname;
    311313    my $warptool_update_cmd = "warptool -setskyfiletoupdate -warp_id $warp_id -set_label $label";
    312314    $warptool_update_cmd   .= " -dbname $dbname " if defined $dbname;
     
    339341#               }
    340342#             }
     343        }
     344
     345
     346        ($success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
     347            run(command => $warptool_preupdate_cmd, verbose => $verbose);
     348        unless ($success) {
     349            $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR);
     350            &my_die("Unable to perform warptool --revertwarped: $error_code", $exposure->{exp_id}, $data_group);
    341351        }
    342352
  • 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.