IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Jun 18, 2010, 4:40:10 PM (16 years ago)
Author:
Paul Price
Message:

Publish diffphots similar to diffs, but slightly different.

File:
1 edited

Legend:

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

    r28395 r28413  
    140140    print $dsFile "$file|||$product|$name|\n";
    141141
    142 } elsif ($stage eq 'diff') {
    143     my $command =  "difftool -diffskyfile -diff_id $stage_id";
     142} elsif ($stage eq 'diff' or $stage eq 'diffphot') {
     143    my $command;                # Command to run
     144    if ($stage eq 'diff') {
     145        $command = "difftool -diffskyfile -diff_id $stage_id";
     146    } elsif ($stage eq 'diffphot') {
     147        $command = "diffphottool -data -diff_phot_id $stage_id";
     148    }
    144149    $command .= " -dbname $dbname" if defined $dbname;
    145150    my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
     
    147152    &my_die( "Unable to retrieve filename", $pub_id, $PS_EXIT_SYS_ERROR) unless $success;
    148153
    149     my $metadata = $mdcParser->parse(join "", @$stdout_buf) or
     154    my $components = $mdcParser->parse_list(join "", @$stdout_buf) or
    150155        &my_die("Unable to parse metadata config", $pub_id, $PS_EXIT_PROG_ERROR);
    151156
    152     my $components = parse_md_list($metadata) or
    153         &my_die("Unable to parse metadata list", $pub_id, $PS_EXIT_PROG_ERROR);
    154 
    155     my ($mopsPositiveFile, $mopsPositiveFileName) = tempfile("/tmp/publish.$pub_id.mops.pos.XXXX", UNLINK => !$save_temps ) if $product eq 'IPP-MOPS';
    156     my ($mopsNegativeFile, $mopsNegativeFileName) = tempfile("/tmp/publish.$pub_id.mops.neg.XXXX", UNLINK => !$save_temps ) if $product eq 'IPP-MOPS';
     157    my $mops = ($product =~ /^IPP-MOPS/ ? 1 : 0); # Format for MOPS?
     158    my ($mopsPositiveFile, $mopsPositiveFileName) = tempfile("/tmp/publish.$pub_id.mops.pos.XXXX", UNLINK => !$save_temps ) if $mops;
     159    my ($mopsNegativeFile, $mopsNegativeFileName) = tempfile("/tmp/publish.$pub_id.mops.neg.XXXX", UNLINK => !$save_temps ) if $mops;
    157160
    158161    my %positive;               # Data for positive diff detections
     
    169172
    170173        my $skycell_id = $comp->{skycell_id};
    171         my $filename = $ipprc->filename( "PPSUB.OUTPUT.SOURCES", $path_base );
     174        my $filename;
     175        if ($stage eq 'diff') {
     176            $filename = $ipprc->filename( "PPSUB.OUTPUT.SOURCES", $path_base );
     177        } elsif ($stage eq 'diffphot') {
     178            $filename = $ipprc->filename( "PSPHOT.OUT.CMF.MEF", "$path_base.pos" );
     179        }
    172180        $filename = $ipprc->file_resolve($filename);
    173181
     
    187195        diff_check(\%positive, $data, "positive");
    188196
    189         if ($product eq 'IPP-MOPS') {
     197        if ($mops) {
    190198            print $mopsPositiveFile "$filename\n";
    191199        } else {
     
    195203        # Negative direction
    196204        if (defined $comp->{bothways} and $comp->{bothways}) {
    197             my $filename = $ipprc->filename( "PPSUB.INVERSE.SOURCES", $path_base );
     205            my $filename;
     206            if ($stage eq 'diff') {
     207                $filename = $ipprc->filename( "PPSUB.INVERSE.SOURCES", $path_base );
     208            } elsif ($stage eq 'diffphot') {
     209                $filename = $ipprc->filename( "PSPHOT.OUT.CMF.MEF", "$path_base.neg" );
     210            }
     211
    198212            $filename = $ipprc->file_resolve($filename);
    199213
     
    213227            diff_check(\%negative, $data, "negative");
    214228
    215             if ($product eq 'IPP-MOPS') {
     229            if ($mops) {
    216230                print $mopsNegativeFile "$filename\n";
    217231            } else {
     
    221235    }
    222236
    223     close $mopsPositiveFile if $product eq 'IPP-MOPS';
    224     close $mopsNegativeFile if $product eq 'IPP-MOPS';
    225 
    226     if ($product eq 'IPP-MOPS') {
     237    close $mopsPositiveFile if $mops;
     238    close $mopsNegativeFile if $mops;
     239
     240    if ($mops) {
    227241        if (scalar keys %positive > 0) {
    228242            my $output = mops_combine(\%positive, "$outroot.pos.mops", $mopsPositiveFileName);
Note: See TracChangeset for help on using the changeset viewer.