IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Nov 26, 2007, 2:44:00 PM (18 years ago)
Author:
Paul Price
Message:

Use PS::IPP::Operations to generate skycells.

File:
1 edited

Legend:

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

    r15644 r15691  
    1818use PS::IPP::Metadata::List qw( parse_md_list );
    1919use File::Temp qw( tempfile );
     20use File::Spec;
     21use Getopt::Long qw( GetOptions :config auto_help auto_version gnu_getopt );
     22use Pod::Usage qw( pod2usage );
    2023
    2124use PS::IPP::Config qw($PS_EXIT_SUCCESS
     
    3134                       file_scheme
    3235                       );
     36use PS::IPP::Operations qw( generate_skycells );
     37
    3338my $ipprc = PS::IPP::Config->new(); # IPP configuration
    34 use File::Spec;
    35 
    36 use Getopt::Long qw( GetOptions :config auto_help auto_version gnu_getopt );
    37 use Pod::Usage qw( pod2usage );
    3839
    3940my ($warp_id, $camera, $dbname, $workdir, $no_update, $no_op);
     
    6061my $warptool = can_run('warptool') or (warn "Can't find warptool" and $missing_tools = 1);
    6162my $dvoImageOverlaps = can_run('dvoImageOverlaps') or (warn "Can't find dvoImageOverlaps" and $missing_tools = 1);
    62 my $dvoImageExtract = can_run('dvoImageExtract') or (warn "Can't find dvoImageExtract" and $missing_tools = 1);
    6363my $ppConfigDump = can_run('ppConfigDump') or (warn "Can't find ppConfigDump" and $missing_tools = 1);
    6464if ($missing_tools) {
     
    145145            }
    146146        }
    147        
     147
    148148        # Extract the skycells to images, used as warp templates.
    149         foreach my $skycell_id (keys %unique_skycells) {
    150             my $skyDir = caturi($workdir, "tess_" . $tess_id, "sky_" . $skycell_id );
    151             my $skyFile = $ipprc->file_prepare( $skycell_id, $skyDir );
    152             unless ($ipprc->file_exists( $skyFile )) {
    153                 my $skyFileResolved = $ipprc->file_create( $skyFile ); # Resolved filename, for Nebulous
    154                 my $command = "$dvoImageExtract -D CATDIR $tess_dir $skycell_id -o $skyFileResolved";
    155                 my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
    156                     run(command => $command, verbose => 1);
    157                 unless ($success) {
    158                     $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR);
    159                     &my_die("Unable to perform dvoImageExtract: $error_code", $warp_id, $error_code);
    160                 }
    161             }
    162         }
     149        my @skycells = keys %unique_skycells;
     150        generate_skycells($ipprc, $tess_id, \@skycells, $workdir) or
     151            &my_die("Unable to generate skycells for tessellation $tess_id", $warp_id, $PS_EXIT_SYS_ERROR);
    163152    }
    164153} else {
Note: See TracChangeset for help on using the changeset viewer.