IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Feb 23, 2007, 3:12:46 PM (19 years ago)
Author:
Paul Price
Message:

More fixes following the name change.

File:
1 edited

Legend:

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

    r12013 r12021  
    3232use Pod::Usage qw( pod2usage );
    3333
    34 my ($p4_id, $dbname, $workdir, $no_update, $no_op);
     34my ($warp_id, $dbname, $workdir, $no_update, $no_op);
    3535GetOptions(
    36     'p4_id|i=s'         => \$p4_id, # Phase 4 identifier
     36    'warp_id|i=s'       => \$warp_id, # Warp identifier
    3737    'dbname|d=s'        => \$dbname, # Database name
    3838    'workdir|w=s'       => \$workdir, # Working directory, for output files
     
    4343pod2usage( -msg => "Unknown option: @ARGV", -exitval => 2 ) if @ARGV;
    4444pod2usage(
    45     -msg => "Required options: --p4_id",
     45    -msg => "Required options: --warp_id",
    4646    -exitval => 3,
    47 ) unless defined $p4_id;
     47) unless defined $warp_id;
    4848
    4949# Look for programs we need
    5050my $missing_tools;
    51 my $warptool = can_run('p4tool') or (warn "Can't find p4tool" and $missing_tools = 1);
     51my $warptool = can_run('warptool') or (warn "Can't find warptool" and $missing_tools = 1);
    5252#my $overlap = can_run('overlap') or (warn "Can't find overlap" and $missing_tools = 1);
    5353if ($missing_tools) {
     
    5959my $imfiles;
    6060{
    61     my $command = "$warptool -imfile -p4_id $p4_id";
     61    my $command = "$warptool -imfile -warp_id $warp_id";
    6262    $command .= " -dbname $dbname" if defined $dbname;
    6363    my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
     
    6565    unless ($success) {
    6666        $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR);
    67         &my_die("Unable to perform warptool -imfile: $error_code", $p4_id, $error_code);
     67        &my_die("Unable to perform warptool -imfile: $error_code", $warp_id, $error_code);
    6868    }
    6969
    7070    my $mdcParser = PS::IPP::Metadata::Config->new;     # Parser for metadata config files
    7171    my $metadata = $mdcParser->parse(join "", @$stdout_buf) or
    72         &my_die("Unable to parse metadata config doc", $p4_id, $PS_EXIT_PROG_ERROR);
     72        &my_die("Unable to parse metadata config doc", $warp_id, $PS_EXIT_PROG_ERROR);
    7373    $imfiles = parse_md_list($metadata) or
    74         &my_die("Unable to parse metadata list", $p4_id, $PS_EXIT_PROG_ERROR);
     74        &my_die("Unable to parse metadata list", $warp_id, $PS_EXIT_PROG_ERROR);
    7575}
    7676
     
    9090# Generate a MDC file with the overlaps
    9191$workdir = $ipprc->convert_filename_absolute( $workdir );
    92 my $overlapName = File::Spec->catfile( $workdir, $p4_id . '.overlap.mdc' );
     92my $overlapName = File::Spec->catfile( $workdir, $warp_id . '.overlap.mdc' );
    9393open my $overlapFile, "> $overlapName" or
    94     &my_die("Unable to open mdc file $overlapName", $p4_id, $PS_EXIT_DATA_ERROR);
    95 print $overlapFile "p4SkyCellMap MULTI\n\n";
     94    &my_die("Unable to open mdc file $overlapName", $warp_id, $PS_EXIT_DATA_ERROR);
     95print $overlapFile "warpSkyCellMap MULTI\n\n";
    9696foreach my $imfile (@$imfiles) {
    97     print $overlapFile "p4_id\t\tS32\t" . $imfile->{p4_id} . "\n";
     97    print $overlapFile "warp_id\t\tS32\t" . $imfile->{warp_id} . "\n";
    9898    print $overlapFile "skycell_id\tSTR\t" . $imfile->{skycell_id} . "\n";
    9999    print $overlapFile "tess_id\t\tSTR\t" . $imfile->{tess_id} . "\n";
     
    106106# Add the processed file to the database
    107107unless ($no_update) {
    108     my $command = "$warptool -addoverlap -p4_id $p4_id -info $overlapName"; # Command to run p4tool
     108    my $command = "$warptool -addoverlap -warp_id $warp_id -info $overlapName"; # Command to run warptool
    109109    $command .= " -dbname $dbname" if defined $dbname;
    110110
     
    125125{
    126126    my $msg = shift;            # Warning message on die
    127     my $p4_id = shift;          # Phase 4 identifier
     127    my $warp_id = shift;        # Warp identifier
    128128    my $exit_code = shift;      # Exit code to add
    129129
    130130    warn($msg);
    131     if ($p4_id and not $no_update) {
    132         my $command = "$warptool -addoverlap -p4_id $p4_id -code $exit_code";
     131    if ($warp_id and not $no_update) {
     132        my $command = "$warptool -addoverlap -warp_id $warp_id -code $exit_code";
    133133        $command .= " -dbname $dbname" if defined $dbname;
    134134        system ($command);
Note: See TracChangeset for help on using the changeset viewer.