Changeset 35163
- Timestamp:
- Feb 13, 2013, 11:20:33 AM (13 years ago)
- File:
-
- 1 edited
-
trunk/ippScripts/scripts/publish_file.pl (modified) (7 diffs, 1 prop)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ippScripts/scripts/publish_file.pl
- Property svn:mergeinfo set to
r34485 r35163 92 92 93 93 my $comment; # Comment for exposure 94 my $exp_name_1; # Name of exposure 1 95 my $exp_name_2; # Name of exposure 2 94 96 if ($stage eq 'camera') { 95 97 my $command = "camtool -processedexp -cam_id $stage_id"; … … 168 170 my %negative; # Data for negative diff detections 169 171 foreach my $comp ( @$components ) { 170 my $path_base = $comp->{path_base}; # Base name for file172 my $path_base = $comp->{path_base}; # Base name for file 171 173 if (!$need_magic and $comp->{magicked}) { 172 174 # This client is authorized to receive uncensored detections … … 178 180 print "Warning: mis-matched comments\n" if defined $comment and $comment ne $comp->{comment}; 179 181 $comment = $comp->{comment} unless defined $comment; 182 $exp_name_1 = $comp->{exp_name_1} unless defined $exp_name_1; 183 $exp_name_2 = $comp->{exp_name_2} unless defined $exp_name_2; 180 184 181 185 (carp "Bad zpt_obs or exp_time for component" and next) if not defined $comp->{zpt_obs} or not defined $comp->{exp_time}; … … 192 196 &my_die("input file does not exist: $filename", $pub_id, $PS_EXIT_SYS_ERROR) if !$ipprc->file_exists($filename); 193 197 my $resolved = $ipprc->file_resolve($filename); 194 198 195 199 &my_die("unable to resolve input file: $filename", $pub_id, $PS_EXIT_SYS_ERROR) if !$resolved; 196 200 197 201 $filename = $resolved; 198 202 199 my $cam_id = $comp->{cam_id_1};200 #print "Getting info from camera stage $cam_id\n";201 my $cam_command = "$camtool -processedexp -cam_id $cam_id";202 $cam_command .= " -dbname $dbname" if defined $dbname;203 my ( $cam_success, $cam_error_code, $cam_full_buf, $cam_stdout_buf, $cam_stderr_buf ) =204 run(command => $cam_command, verbose => $verbose);205 &my_die( "Unable to retrieve filename", $pub_id, $PS_EXIT_SYS_ERROR) unless $cam_success;206 my $cam_metadata = $mdcParser->parse(join "", @$cam_stdout_buf) or207 &my_die("Unable to parse metadata config", $pub_id, $PS_EXIT_PROG_ERROR);208 my $cam_components = parse_md_list($cam_metadata) or209 &my_die("Unable to parse metadata list", $pub_id, $PS_EXIT_PROG_ERROR);210 &my_die("More than one entry for cam_id $stage_id", $pub_id, $PS_EXIT_PROG_ERROR) if scalar @$cam_components > 1;211 my $cam_comp = $$cam_components[0];212 213 my $exp_id = $comp->{exp_id_1};214 #print "Getting info from raw stage $exp_id\n";215 my $reg_command = "$regtool -processedimfile -exp_id $exp_id";216 $reg_command .= " -dbname $dbname" if defined $dbname;217 my ( $reg_success, $reg_error_code, $reg_full_buf, $reg_stdout_buf, $reg_stderr_buf ) =218 run(command => $reg_command, verbose => $verbose);219 &my_die( "Unable to retrieve filename", $pub_id, $PS_EXIT_SYS_ERROR) unless $reg_success;220 my $reg_metadata = $mdcParser->parse(join "", @$reg_stdout_buf) or221 &my_die("Unable to parse metadata config", $pub_id, $PS_EXIT_PROG_ERROR);222 my $reg_components = parse_md_list($reg_metadata) or223 &my_die("Unable to parse metadata list", $pub_id, $PS_EXIT_PROG_ERROR);224 my $reg_comp = $$reg_components[0];225 226 # Now get the difftype value from diff->{diff_mode}227 my $difftype = "";228 if ($comp->{diff_mode} == 1) {229 $difftype = "WW";230 } elsif ($comp->{diff_mode} == 2) {231 $difftype = "WS";232 } elsif ($comp->{diff_mode} == 3) {233 $difftype = "SW"; # Not used yet234 } elsif ($comp->{diff_mode} == 4) {235 $difftype = "SS";236 } else {237 $difftype = "Unsupported diff_mode value: [" . $comp->{diff_mode} . "]";238 }203 my $cam_id = $comp->{cam_id_1}; 204 #print "Getting info from camera stage $cam_id\n"; 205 my $cam_command = "$camtool -processedexp -cam_id $cam_id"; 206 $cam_command .= " -dbname $dbname" if defined $dbname; 207 my ( $cam_success, $cam_error_code, $cam_full_buf, $cam_stdout_buf, $cam_stderr_buf ) = 208 run(command => $cam_command, verbose => $verbose); 209 &my_die( "Unable to retrieve filename", $pub_id, $PS_EXIT_SYS_ERROR) unless $cam_success; 210 my $cam_metadata = $mdcParser->parse(join "", @$cam_stdout_buf) or 211 &my_die("Unable to parse metadata config", $pub_id, $PS_EXIT_PROG_ERROR); 212 my $cam_components = parse_md_list($cam_metadata) or 213 &my_die("Unable to parse metadata list", $pub_id, $PS_EXIT_PROG_ERROR); 214 &my_die("More than one entry for cam_id $stage_id", $pub_id, $PS_EXIT_PROG_ERROR) if scalar @$cam_components > 1; 215 my $cam_comp = $$cam_components[0]; 216 217 my $exp_id = $comp->{exp_id_1}; 218 #print "Getting info from raw stage $exp_id\n"; 219 my $reg_command = "$regtool -processedimfile -exp_id $exp_id"; 220 $reg_command .= " -dbname $dbname" if defined $dbname; 221 my ( $reg_success, $reg_error_code, $reg_full_buf, $reg_stdout_buf, $reg_stderr_buf ) = 222 run(command => $reg_command, verbose => $verbose); 223 &my_die( "Unable to retrieve filename", $pub_id, $PS_EXIT_SYS_ERROR) unless $reg_success; 224 my $reg_metadata = $mdcParser->parse(join "", @$reg_stdout_buf) or 225 &my_die("Unable to parse metadata config", $pub_id, $PS_EXIT_PROG_ERROR); 226 my $reg_components = parse_md_list($reg_metadata) or 227 &my_die("Unable to parse metadata list", $pub_id, $PS_EXIT_PROG_ERROR); 228 my $reg_comp = $$reg_components[0]; 229 230 # Now get the difftype value from diff->{diff_mode} 231 my $difftype = ""; 232 if ($comp->{diff_mode} == 1) { 233 $difftype = "WW"; 234 } elsif ($comp->{diff_mode} == 2) { 235 $difftype = "WS"; 236 } elsif ($comp->{diff_mode} == 3) { 237 $difftype = "SW"; # Not used yet 238 } elsif ($comp->{diff_mode} == 4) { 239 $difftype = "SS"; 240 } else { 241 $difftype = "Unsupported diff_mode value: [" . $comp->{diff_mode} . "]"; 242 } 239 243 240 244 my $data = { zp => $zp, … … 250 254 output_format => $comp->{output_format}, 251 255 direction => 1, 252 comment => $reg_comp->{comment},253 obsmode => $reg_comp->{obs_mode},254 difftype => $difftype,255 sky => $cam_comp->{bg},256 shutoutc => $reg_comp->{dateobs},256 comment => $reg_comp->{comment}, 257 obsmode => $reg_comp->{obs_mode}, 258 difftype => $difftype, 259 sky => $cam_comp->{bg}, 260 shutoutc => $reg_comp->{dateobs}, 257 261 }; 258 262 259 #warn("Checking for positive");263 #warn("Checking for positive"); 260 264 diff_check(\%positive, $data, "positive"); 261 265 … … 288 292 diff_id => $comp->{diff_id}, 289 293 direction => 0, 290 comment => $reg_comp->{comment},291 obsmode => $reg_comp->{obs_mode},292 difftype => $difftype,293 sky => $cam_comp->{bg},294 shutoutc => $reg_comp->{dateobs},294 comment => $reg_comp->{comment}, 295 obsmode => $reg_comp->{obs_mode}, 296 difftype => $difftype, 297 sky => $cam_comp->{bg}, 298 shutoutc => $reg_comp->{dateobs}, 295 299 }; 296 300 297 #warn("Checking for negative");301 #warn("Checking for negative"); 298 302 diff_check(\%negative, $data, "negative"); 299 303 … … 326 330 my $command = "$dsreg --add pub.$pub_id.$stage.$stage_id --copy --abspath --product $product --type $dsType --list $dsFileName"; 327 331 $command .= " --ps0 \"$comment\"" if defined $comment; 332 $command .= " --ps1 \"$exp_name_1\"" if defined $exp_name_1; 333 $command .= " --ps2 \"$exp_name_2\"" if defined $exp_name_2; 328 334 329 335 my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
Note:
See TracChangeset
for help on using the changeset viewer.
