IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Feb 23, 2007, 6:07:01 PM (19 years ago)
Author:
Paul Price
Message:

Getting scripts to talk to ippTools. warp_overlap.pl and warp_imfile.pl both cooperate (i.e., work with --no-op). Haven't tried diff or stack yet.

File:
1 edited

Legend:

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

    r12021 r12043  
    1616use PS::IPP::Metadata::Config;
    1717use PS::IPP::Metadata::Stats;
     18use PS::IPP::Metadata::List qw( parse_md_list );
    1819
    1920use PS::IPP::Config qw(
     
    8485        $imfile->{skycell_id} = 'default';
    8586        $imfile->{tess_id} = 'default';
     87        $imfile->{fault} = 0;
    8688    }
    8789}
    88    
     90
     91if (defined $workdir) {
     92    $workdir = $ipprc->convert_filename_absolute( $workdir );
     93} else {
     94    my $example = $ipprc->convert_filename_absolute( $$imfiles[0]->{uri} );
     95    my ($vol, $dir, $file) = File::Spec->splitpath( $example );
     96    $workdir = $dir;
     97}
    8998
    9099# Generate a MDC file with the overlaps
    91 $workdir = $ipprc->convert_filename_absolute( $workdir );
    92 my $overlapName = File::Spec->catfile( $workdir, $warp_id . '.overlap.mdc' );
    93 open my $overlapFile, "> $overlapName" or
    94     &my_die("Unable to open mdc file $overlapName", $warp_id, $PS_EXIT_DATA_ERROR);
     100my $overlapName = File::Spec->catfile( $workdir, $warp_id . '.overlap.mdc' );
     101open my $overlapFile, "> $overlapName" or die "Unable to open mdc file $overlapName";
    95102print $overlapFile "warpSkyCellMap MULTI\n\n";
    96103foreach my $imfile (@$imfiles) {
    97     print $overlapFile "warp_id\t\tS32\t" . $imfile->{warp_id} . "\n";
    98     print $overlapFile "skycell_id\tSTR\t" . $imfile->{skycell_id} . "\n";
    99     print $overlapFile "tess_id\t\tSTR\t" . $imfile->{tess_id} . "\n";
    100     print $overlapFile "exp_tag\t\tSTR\t" . $imfile->{exp_tag} . "\n";
    101     print $overlapFile "p3_version\tS32\t" . $imfile->{p3_version} . "\n";
    102     print $overlapFile "class_id\t\tSTR\t" . $imfile->{class_id} . "\n";
     104    print $overlapFile "warpSkyCellMap\tMETADATA\n";
     105    print $overlapFile "\twarp_id\tS32\t" . $warp_id . "\n";
     106    print $overlapFile "\tskycell_id\tSTR\t" . $imfile->{skycell_id} . "\n";
     107    print $overlapFile "\ttess_id\t\tSTR\t" . $imfile->{tess_id} . "\n";
     108    print $overlapFile "\texp_tag\t\tSTR\t" . $imfile->{exp_tag} . "\n";
     109    print $overlapFile "\tcam_version\tS32\t" . $imfile->{cam_version} . "\n";
     110    print $overlapFile "\tclass_id\t\tSTR\t" . $imfile->{class_id} . "\n";
     111    print $overlapFile "\tfault\tS16\t" . $imfile->{fault} . "\n";
     112    print $overlapFile "END\n\n";
    103113}
    104114close $overlapFile;
     
    106116# Add the processed file to the database
    107117unless ($no_update) {
    108     my $command = "$warptool -addoverlap -warp_id $warp_id -info $overlapName"; # Command to run warptool
     118    my $command = "$warptool -addoverlap -mapfile $overlapName"; # Command to run warptool
    109119    $command .= " -dbname $dbname" if defined $dbname;
    110120
     
    129139
    130140    warn($msg);
    131     if ($warp_id and not $no_update) {
    132         my $command = "$warptool -addoverlap -warp_id $warp_id -code $exit_code";
    133         $command .= " -dbname $dbname" if defined $dbname;
    134         system ($command);
    135     }
     141
     142    # No failure option on warptool for this mode, so just die.
    136143    exit $exit_code;
    137144}
Note: See TracChangeset for help on using the changeset viewer.