Changeset 28413 for trunk/ippScripts/scripts/publish_file.pl
- Timestamp:
- Jun 18, 2010, 4:40:10 PM (16 years ago)
- File:
-
- 1 edited
-
trunk/ippScripts/scripts/publish_file.pl (modified) (7 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ippScripts/scripts/publish_file.pl
r28395 r28413 140 140 print $dsFile "$file|||$product|$name|\n"; 141 141 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 } 144 149 $command .= " -dbname $dbname" if defined $dbname; 145 150 my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) = … … 147 152 &my_die( "Unable to retrieve filename", $pub_id, $PS_EXIT_SYS_ERROR) unless $success; 148 153 149 my $ metadata = $mdcParser->parse(join "", @$stdout_buf) or154 my $components = $mdcParser->parse_list(join "", @$stdout_buf) or 150 155 &my_die("Unable to parse metadata config", $pub_id, $PS_EXIT_PROG_ERROR); 151 156 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; 157 160 158 161 my %positive; # Data for positive diff detections … … 169 172 170 173 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 } 172 180 $filename = $ipprc->file_resolve($filename); 173 181 … … 187 195 diff_check(\%positive, $data, "positive"); 188 196 189 if ($ product eq 'IPP-MOPS') {197 if ($mops) { 190 198 print $mopsPositiveFile "$filename\n"; 191 199 } else { … … 195 203 # Negative direction 196 204 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 198 212 $filename = $ipprc->file_resolve($filename); 199 213 … … 213 227 diff_check(\%negative, $data, "negative"); 214 228 215 if ($ product eq 'IPP-MOPS') {229 if ($mops) { 216 230 print $mopsNegativeFile "$filename\n"; 217 231 } else { … … 221 235 } 222 236 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) { 227 241 if (scalar keys %positive > 0) { 228 242 my $output = mops_combine(\%positive, "$outroot.pos.mops", $mopsPositiveFileName);
Note:
See TracChangeset
for help on using the changeset viewer.
