Changeset 35081 for trunk/ippScripts/scripts/camera_exp.pl
- Timestamp:
- Feb 1, 2013, 5:01:08 PM (13 years ago)
- File:
-
- 1 edited
-
trunk/ippScripts/scripts/camera_exp.pl (modified) (8 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ippScripts/scripts/camera_exp.pl
r33576 r35081 41 41 42 42 my ( $exp_tag, $cam_id, $camera, $outroot, $dbname, $reduction, $dvodb, $verbose, $no_update, 43 $no_op, $redirect, $save_temps, $run_state, $skip_binned, $skip_masks );43 $no_op, $redirect, $save_temps, $run_state, $skip_binned, $skip_masks, $bkg_only); 44 44 GetOptions( 45 45 'exp_tag=s' => \$exp_tag, # Exposure identifier … … 53 53 'skip-binned' => \$skip_binned, # override recipe - don't create binned images 54 54 'skip-refmask' => \$skip_masks, # override recipe - don't create refmask 55 'bkg-only' => \$bkg_only, # override recipe - only do background continuity 55 56 'verbose' => \$verbose, # Print to stdout 56 57 'no-update' => \$no_update, # Update the database? … … 111 112 &my_die("Unrecognised PSASTRO recipe", $cam_id, $PS_EXIT_CONFIG_ERROR) unless defined $recipe_psastro; 112 113 114 my $bkg_recipe = 'PPIMAGE_BKGCONT'; # Add to reduction? 113 115 my $mdcParser = PS::IPP::Metadata::Config->new; # Parser for metadata config files 114 116 … … 215 217 my ($list4File, $list4Name) = tempfile( "/tmp/$exp_tag.cm.$cam_id.b4.list.XXXX", UNLINK => !$save_temps ); # For astrometry 216 218 219 ### Create temp file for background models 220 my ($list5File, $list5Name) = tempfile( "/tmp/$exp_tag.cm.$cam_id.b5.list.XXXX", UNLINK => !$save_temps ); # For background models 221 217 222 # XXX we perform astrometry iff photometry output exists 218 223 my @outMasks; # Names of output masks 224 my @bkg_models; # Names of output background models 219 225 foreach my $file (@$files) { 220 226 next if $file->{quality} != 0; … … 226 232 my $chipObjects = $ipprc->filename("PSPHOT.OUTPUT", $file->{path_base}, $class_id); 227 233 my $chipMask = $ipprc->filename("PPIMAGE.CHIP.MASK", $file->{path_base}, $class_id); 228 234 229 235 print $list1File ($ipprc->filename("PPIMAGE.BIN1", $file->{path_base}, $class_id) . "\n"); 230 236 print $list2File ($ipprc->filename("PPIMAGE.BIN2", $file->{path_base}, $class_id) . "\n"); 231 237 print $list3File ($chipObjects . "\n"); 232 238 print $list4File ($chipMask . "\n"); 239 print $list5File ($ipprc->filename("PSPHOT.BACKMDL", $file->{path_base}, $class_id) . "\n"); 233 240 234 241 push @outMasks, prepare_output("PSASTRO.OUTPUT.MASK", $outroot, $class_id, 1) if $produceMasks; 242 push @bkg_models, prepare_output("PPIMAGE.BACKMDL", $outroot, $class_id, 1); 235 243 } 236 244 close $list1File; … … 238 246 close $list3File; 239 247 close $list4File; 240 248 close $list5File; 241 249 # Output products 242 250 $ipprc->outroot_prepare($outroot); … … 291 299 } 292 300 293 {301 if (!$bkg_only) { 294 302 # run psastro on the chipObjects, producing fpaObjects 295 303 my $command; … … 353 361 } 354 362 } 363 } 364 # Construct FPA continuity corrected background images 365 { 366 my $command; 367 $command = "$ppImage"; 368 $command .= " -list $list5Name $outroot"; 369 $command .= " -recipe PPIMAGE $bkg_recipe"; 370 $command .= " -dbname $dbname" if defined $dbname; 371 372 my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) = 373 run(command => $command, verbose => $verbose); 374 unless ($success) { 375 $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR); 376 &my_die("Unable to perform ppImage to fix background: $error_code", $cam_id, $error_code); 377 } 378 foreach my $bkgModel (@bkg_models) { 379 check_output($bkgModel, $replicateOutputs); 380 } 355 381 } 356 382 }
Note:
See TracChangeset
for help on using the changeset viewer.
