IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 27237


Ignore:
Timestamp:
Mar 10, 2010, 3:01:21 PM (16 years ago)
Author:
bills
Message:

changes to handle stack-stack diffs properly

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/PS-IPP-PStamp/lib/PS/IPP/PStamp/Job.pm

    r27211 r27237  
    454454        # so we interpret the requested image in that way
    455455
    456         my $stack_id = $image->{stack2};
    457456        # XXX difftool currently returns max long long for null
    458         # this line is ready if we switch the code to return zero for null
    459         if ($stack_id and ($stack_id != 9223372036854775807)) {
    460             $image->{stack_id} = $stack_id;
    461         }
    462 
    463         my ($warp_id, $exp_id, $exp_name, $chip_id, $cam_id);
    464         if ($inverse and !$image->{bothways}) {
    465             print STDERR "Inverse images requested for diffRun that is not bothways. Ignoring inverse.\n";
    466             $inverse = 0;
    467         }
    468         if ($inverse) {
    469             $warp_id =  $image->{warp2};
    470             $exp_id = $image->{exp_id_2};
    471             $exp_name = $image->{exp_name_2};
    472             $chip_id = $image->{chip_id_2};
    473             $cam_id = $image->{cam_id_2};
    474         } else {
    475             $warp_id =  $image->{warp1};
    476             $exp_id = $image->{exp_id_1};
    477             $exp_name = $image->{exp_name_1};
    478             $chip_id = $image->{chip_id_1};
    479             $cam_id = $image->{cam_id_1};
    480         }
    481         # XXX difftool currently returns max long long for null
    482         # this line is ready if we switch the code to return zero for null
    483         if ($warp_id and ($warp_id != 9223372036854775807)) {
    484             $image->{warp_id} = $warp_id;
    485             $image->{exp_id} = $exp_id;
    486             $image->{exp_name} = $exp_name;
    487             $image->{chip_id} = $chip_id;
    488             $image->{cam_id} = $cam_id;
    489         } else {
    490             my $stack1 = $image->{stack1};
    491             # XXX: change this to check $image->{diff_mode} once it's populated and
    492             # included in the difftool output
    493             if ($stack1 and ($stack1 != 9223372036854775807)) {
    494 
    495                 # we have a stack - stack diff (well it might be stack - warp....)
    496                 # but at any rate we only handle image type diff
    497                 if ($img_type ne "diff") {
    498                     print STDERR "lookup_diff: cannot lookup IMG_TYPE $img_type bydiff from SSdiff\n";
    499                     next;
    500                 }
    501 
    502                 # XXX: If difftool doesn't return a camera insert it here
    503                 if (!$image->{camera}) {
    504                     $image->{camera} = "GPC1";
    505                     # lie about the magicked status since stack stack diffs don't require destreaking
    506                     # we can remove this once diff_mode gets included
    507                     $image->{magicked} = 42;
    508                 }
    509             } else {
    510                 print STDERR "unexpected result: both warp1 and stack1 are null\n";
     457        # these checks are ready if we switch the code to return zero for null
     458        my $stack1 = $image->{stack1};
     459        if (($stack1 == 0) or ($stack1 == 9223372036854775807)) {
     460            $stack1 = undef
     461        }
     462        my $stack2 = $image->{stack2};
     463        if (($stack2 == 0) or ($stack2 == 9223372036854775807)) {
     464            $stack2 = undef
     465        }
     466        my $stack_id;
     467        if ($stack1 and $stack2) {
     468            # we have a stack - stack diff (well it might be stack - warp....)
     469            # but at any rate we only handle image type diff and stack
     470            if (($img_type ne "diff") and ($img_type ne "stack")) {
     471                print STDERR "lookup_diff: cannot lookup IMG_TYPE $img_type bydiff from a stack stack diff run\n";
    511472                next;
    512473            }
    513         }
     474            # stack-stack diff
     475            # XXX: define another flag for this
     476            if (! $inverse) {
     477                $stack_id = $stack1;
     478            } else {
     479                $stack_id = $stack2;
     480            }
     481            $image->{stack_id} = $stack_id;
     482        } else {
     483            my ($warp_id, $exp_id, $exp_name, $chip_id, $cam_id);
     484            if ($inverse and !$image->{bothways}) {
     485                print STDERR "Inverse images requested for diffRun that is not bothways. Ignoring inverse.\n";
     486                $inverse = 0;
     487            }
     488            if ($inverse) {
     489                $warp_id =  $image->{warp2};
     490                $exp_id = $image->{exp_id_2};
     491                $exp_name = $image->{exp_name_2};
     492                $chip_id = $image->{chip_id_2};
     493                $cam_id = $image->{cam_id_2};
     494            } else {
     495                $warp_id =  $image->{warp1};
     496                $exp_id = $image->{exp_id_1};
     497                $exp_name = $image->{exp_name_1};
     498                $chip_id = $image->{chip_id_1};
     499                $cam_id = $image->{cam_id_1};
     500            }
     501            # XXX difftool currently returns max long long for null
     502            # this line is ready if we switch the code to return zero for null
     503            if ($warp_id and ($warp_id != 9223372036854775807)) {
     504                $image->{warp_id} = $warp_id;
     505                $image->{exp_id} = $exp_id;
     506                $image->{exp_name} = $exp_name;
     507                $image->{chip_id} = $chip_id;
     508                $image->{cam_id} = $cam_id;
     509            }
     510        }
     511
     512        # XXX: If difftool doesn't return a camera insert it here
     513        if (!$image->{camera}) {
     514            $image->{camera} = "GPC1";
     515            # lie about the magicked status since stack stack diffs don't require destreaking
     516            # we can remove this once diff_mode gets included
     517            $image->{magicked} = 42;
     518        }
     519
    514520        if ($img_type eq "diff") {
    515521            # the $image is going to be returned directly in this case so we need to duplicate
Note: See TracChangeset for help on using the changeset viewer.