IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Oct 20, 2010, 11:53:36 AM (16 years ago)
Author:
bills
Message:

Add path_base to magicMask. Convert destreaking to get streaks file from there.
Also deleted magicInputSkyfile.diff_id from pxadmin_create_tables.sql. The column has been
gone for ages in gpc1 and the rest of the code but new databases were getting it set

File:
1 edited

Legend:

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

    r29493 r29495  
    325325}
    326326
     327### Input result into database
     328{
     329    my $command = "$magictool -addresult";
     330    $command   .= " -magic_id $magic_id";
     331    $command   .= " -node $node";
     332    $command   .= " -path_base $outroot";
     333    $command   .= " -dbname $dbname" if defined $dbname;
     334
     335    # Add the processed file to the database
     336    unless ($no_update) {
     337        my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
     338            run(command => $command, verbose => $verbose);
     339        unless ($success) {
     340            $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR);
     341            &my_die("Unable to perform magictool -addresult: $error_code", $magic_id, $node, $error_code);
     342        }
     343    } else {
     344        print "Skipping command: $command\n";
     345    }
     346}
    327347
    328348if ($node eq "root") {
     349    # XXXX: Since we just added the result above, all of these my_dies are going to fail
     350    # with a duplicate row error.
     351    # see more comments below
    329352    my $streaks_file = "$outroot.streaks";
    330353    my $resolved = $ipprc->file_resolve($streaks_file);
     
    389412    }
    390413
    391 ### Input result into database
    392 # XXXX: if this succeeds but addmask fails the magicRun is in a goofy state XXXX
    393 {
    394     my $command = "$magictool -addresult";
    395     $command   .= " -magic_id $magic_id";
    396     $command   .= " -node $node";
    397     $command   .= " -path_base $outroot";
    398     $command   .= " -dbname $dbname" if defined $dbname;
    399 
    400     # Add the processed file to the database
    401     unless ($no_update) {
    402         my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
    403             run(command => $command, verbose => $verbose);
    404         unless ($success) {
    405             $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR);
    406             &my_die("Unable to perform magictool -addresult: $error_code", $magic_id, $node, $error_code);
    407         }
    408     } else {
    409         print "Skipping command: $command\n";
    410     }
    411 }
    412 
    413 
    414414    {
    415415        my $command = "$magictool -addmask";
     
    425425            unless ($success) {
    426426                $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR);
    427                 # This isn't going to work because our result was already entered.
     427                # XXX: This my_die isn't going to work because the result for the root node was already
     428                # added to the database up above.
     429                # There is a magicMask has a fault column. Maybe we should
     430                # use that and add a new revert mode that deletes the magicMask and the magicNodeResult
     431                # for the root node.
    428432                &my_die("Unable to perform magictool -addmask: $error_code", $magic_id, $node, $error_code);
    429433            }
     
    433437    }
    434438}
     439
    435440
    436441### Pau.
Note: See TracChangeset for help on using the changeset viewer.