- Timestamp:
- Apr 10, 2008, 9:38:11 PM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branch_20080408/ippScripts/scripts/camera_exp.pl
r17409 r17432 38 38 39 39 my ( $exp_tag, $cam_id, $camera, $outroot, $recipe, $dbname, $reduction, $dvodb, $verbose, $no_update, 40 $no_op );40 $no_op, $save_temps ); 41 41 GetOptions( 42 42 'exp_tag=s' => \$exp_tag, # Exposure identifier … … 51 51 'no-update' => \$no_update, # Update the database? 52 52 'no-op' => \$no_op, # Don't do any operations? 53 'save-temps' => \$save_temps, # Save temporary files? 53 54 ) or pod2usage( 2 ); 54 55 … … 75 76 76 77 # values to extract from output metadata and the stats to calculate 77 # these should be coming from the psastro results for Nimfile > 1,78 # these should be coming from the psastro results 78 79 my $CHIPSTATS = 79 80 [ … … 150 151 151 152 ### not needed to have such an extensive temp file name. 152 my ($list1File, $list1Name) = tempfile( "$exp_tag.cm.$cam_id.b1.list.XXXX", UNLINK => 1 ); # For binning 1 153 my ($list2File, $list2Name) = tempfile( "$exp_tag.cm.$cam_id.b2.list.XXXX", UNLINK => 1 ); # For binning 2 154 my ($list3File, $list3Name) = tempfile( "$exp_tag.cm.$cam_id.b3.list.XXXX", UNLINK => 1 ); # For astrometry 155 153 my ($list1File, $list1Name) = tempfile( "$exp_tag.cm.$cam_id.b1.list.XXXX", UNLINK => !$save_temps ); # For binning 1 154 my ($list2File, $list2Name) = tempfile( "$exp_tag.cm.$cam_id.b2.list.XXXX", UNLINK => !$save_temps ); # For binning 2 155 my ($list3File, $list3Name) = tempfile( "$exp_tag.cm.$cam_id.b3.list.XXXX", UNLINK => !$save_temps ); # For astrometry 156 157 # XXX we perform astrometry iff photometry output exists 156 158 my $chipObjects; 157 159 my $chipObjectsExist = 0; … … 200 202 { 201 203 my $command = "$ppImage -list $list1Name $outroot -recipe PPIMAGE $recipe1"; # Command to run 204 $command .= " -dbname $dbname" if defined $dbname; 205 202 206 my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) = 203 207 run(command => $command, verbose => $verbose); … … 212 216 { 213 217 my $command = "$ppImage -list $list2Name $outroot -recipe PPIMAGE $recipe2"; # Command to run 218 $command .= " -dbname $dbname" if defined $dbname; 219 214 220 my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) = 215 221 run(command => $command, verbose => $verbose); … … 221 227 } 222 228 223 # check recipe for PSASTRO.MOSAIC.MODE; run mosaic astrometry if224 # requested by the camera's PSASTRO recipe225 my $mosaicAstrom; # run mosaic-level astrometry?226 {227 my $command = "$ppConfigDump -camera $camera -dump-recipe PSASTRO -";228 my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =229 run(command => $command, verbose => $verbose);230 unless ($success) {231 $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR);232 &my_die("Unable to perform ppConfigDump: $error_code", $cam_id, $error_code);233 }234 my $metadata = $mdcParser->parse(join "", @$stdout_buf) or235 &my_die("Unable to parse metadata config doc", $cam_id, $PS_EXIT_PROG_ERROR);236 $mosaicAstrom = metadataLookupBool($metadata, 'PSASTRO.MOSAIC.MODE');237 }238 239 229 # only run psastro / addstar if any of the output chip astrometry files exist (should we test for successful astrometry?) 240 230 if ($chipObjectsExist) { 241 if ($mosaicAstrom) { 242 # run psastro +mosastro on the set of chips or copy the chipObjects to fpaObjects 243 # XXX note that this is wrong if imfiles are cells 244 # XXX add a ppStats call which will collect the astrometry stats 245 my $command; 246 $command = "$psastro -list $list3Name $outroot"; 247 $command .= " +mosastro -chipastro"; 248 $command .= " -F PSASTRO.OUTPUT PSASTRO.OUTPUT.MEF"; 249 $command .= " -tracedest $traceDest -log $logDest"; 250 my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) = 251 run(command => $command, verbose => $verbose); 252 unless ($success) { 253 $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR); 254 &my_die("Unable to perform psastro: $error_code", $cam_id, $error_code); 255 } 256 # XXX do we want to give an error if astrometry fails here? 257 &my_die("Unable to find expected output file: $fpaObjects", $cam_id, $PS_EXIT_PROG_ERROR) unless -f $ipprc->file_resolve($fpaObjects); 231 # run psastro on the chipObjects, producing fpaObjects 232 # XXX add a ppStats call which will collect the astrometry stats 233 my $command; 234 $command = "$psastro -list $list3Name $outroot"; 235 $command .= " -tracedest $traceDest -log $logDest"; 236 $command .= " -dbname $dbname" if defined $dbname; 237 238 my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) = 239 run(command => $command, verbose => $verbose); 240 unless ($success) { 241 $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR); 242 &my_die("Unable to perform psastro: $error_code", $cam_id, $error_code); 258 243 } 244 # XXX do we want to give an error if astrometry fails here? 245 &my_die("Unable to find expected output file: $fpaObjects", $cam_id, $PS_EXIT_PROG_ERROR) unless -f $ipprc->file_resolve($fpaObjects); 259 246 260 # do we supply chipObjects or fpaObjects to addstar? 261 # run addstar on either the single chip output or the single fpa output 247 # run addstar on the output fpaObjects (if a DVO database is defined) 262 248 if (defined $dvodbReal) { 263 249 # XXX this construct requires the user to have a valid .ptolemyrc … … 271 257 $command .= " -D CATDIR $dvodbReal"; 272 258 273 if ($mosaicAstrom) { 274 my $realFile = $ipprc->file_resolve($fpaObjects); 275 $command .= " $realFile"; 276 } else { 277 $command .= " -list $list3Name"; 278 } 259 my $realFile = $ipprc->file_resolve($fpaObjects); 260 $command .= " $realFile"; 279 261 280 262 my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
Note:
See TracChangeset
for help on using the changeset viewer.
