Changeset 27838 for branches/tap_branches/ippScripts/scripts/camera_exp.pl
- Timestamp:
- May 3, 2010, 8:41:49 AM (16 years ago)
- Location:
- branches/tap_branches
- Files:
-
- 2 edited
-
. (modified) (1 prop)
-
ippScripts/scripts/camera_exp.pl (modified) (8 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/tap_branches
- Property svn:mergeinfo changed
-
branches/tap_branches/ippScripts/scripts/camera_exp.pl
r25835 r27838 8 8 use Sys::Hostname; 9 9 my $host = hostname(); 10 my $date = `date`; 10 11 print "\n\n"; 11 print "Starting script $0 on $host \n\n";12 print "Starting script $0 on $host at $date\n\n"; 12 13 13 14 use DateTime; … … 144 145 } 145 146 147 148 my $produceMasks; # Produce masks? 149 { 150 # Get the PSASTRO recipe 151 my $command = "$ppConfigDump -camera $camera -recipe PSASTRO $recipe_psastro -dump-recipe PSASTRO -"; 152 my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) = 153 run(command => $command, verbose => $verbose); 154 unless ($success) { 155 $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR); 156 &my_die("Unable to perform ppConfigDump: $error_code", $cam_id, $PS_EXIT_CONFIG_ERROR); 157 } 158 my $recipeData = $mdcParser->parse(join "", @$stdout_buf) or 159 &my_die("Unable to parse metadata config doc", $cam_id, $PS_EXIT_CONFIG_ERROR); 160 161 $produceMasks = metadataLookupBool($recipeData, 'REFSTAR_MASK'); 162 } 163 164 146 165 ### not needed to have such an extensive temp file name. 147 166 my ($list1File, $list1Name) = tempfile( "/tmp/$exp_tag.cm.$cam_id.b1.list.XXXX", UNLINK => !$save_temps ); # For binning 1 … … 153 172 154 173 # XXX we perform astrometry iff photometry output exists 155 my $chipObjectsExist = 0;174 my @outMasks; # Names of output masks 156 175 foreach my $file (@$files) { 176 next if $file->{quality} != 0; 157 177 # use the path_base as OUTPUT root and convert the filenames with ipprc->filename: 158 178 my $class_id = $file->{class_id}; … … 163 183 my $chipMask = $ipprc->filename("PPIMAGE.CHIP.MASK", $file->{path_base}, $class_id); 164 184 165 # if any of the output chip photometry files exist, we can run psastro / addstar below166 if ($ipprc->file_exists($chipObjects)) {167 $chipObjectsExist = 1;168 } else {169 if ($verbose) { print "skipping $chipObjects (not found)\n"; }170 next;171 }172 173 185 print $list1File ($ipprc->filename("PPIMAGE.BIN1", $file->{path_base}, $class_id) . "\n"); 174 186 print $list2File ($ipprc->filename("PPIMAGE.BIN2", $file->{path_base}, $class_id) . "\n"); 175 187 print $list3File ($chipObjects . "\n"); 176 188 print $list4File ($chipMask . "\n"); 189 190 push @outMasks, $ipprc->filename("PSASTRO.OUTPUT.MASK", $outroot, $class_id) if $produceMasks; 177 191 } 178 192 close $list1File; … … 222 236 &my_die("Unable to perform ppImage: $error_code", $cam_id, $error_code); 223 237 } 224 &my_die("Unable to find expected output file: $jpeg1", $cam_id, $PS_EXIT_ PROG_ERROR) unless -f $ipprc->file_resolve($jpeg1);238 &my_die("Unable to find expected output file: $jpeg1", $cam_id, $PS_EXIT_SYS_ERROR) unless $ipprc->file_exists($jpeg1); 225 239 } 226 240 … … 237 251 &my_die("Unable to perform ppImage: $error_code", $cam_id, $error_code); 238 252 } 239 &my_die("Unable to find expected output file: $jpeg2", $cam_id, $PS_EXIT_PROG_ERROR) unless -f $ipprc->file_resolve($jpeg2); 240 } 241 242 # only run psastro / addstar if any of the output chip astrometry files exist (should we test for successful astrometry?) 243 if ($chipObjectsExist) { 253 &my_die("Unable to find expected output file: $jpeg2", $cam_id, $PS_EXIT_SYS_ERROR) unless $ipprc->file_exists($jpeg2); 254 } 255 256 { 244 257 # run psastro on the chipObjects, producing fpaObjects 245 258 my $command; 246 259 $command = "$psastro"; 247 $command .= " -list $list3Name";248 $command .= " -masklist $list4Name";249 $command .= " $outroot";260 $command .= " -list $list3Name"; 261 $command .= " -masklist $list4Name"; 262 $command .= " $outroot"; 250 263 $command .= " -recipe PSASTRO $recipe_psastro"; 251 264 $command .= " -tracedest $traceDest -log $logDest"; … … 273 286 if ($do_stats) { 274 287 my $fpaStatsReal = $ipprc->file_resolve($fpaStats); 275 &my_die("Couldn't find expected output file: $fpaStats", $cam_id, $PS_EXIT_SYS_ERROR) unless -f $fpaStatsReal;288 &my_die("Couldn't find expected output file: $fpaStats", $cam_id, $PS_EXIT_SYS_ERROR) unless $ipprc->file_exists( $fpaStatsReal ); 276 289 277 290 # parse stats from metadata … … 292 305 293 306 if (!$quality) { 294 &my_die("Unable to find expected output file: $fpaObjects", $cam_id, $PS_EXIT_PROG_ERROR) unless -f $ipprc->file_resolve($fpaObjects); 307 &my_die("Unable to find expected output file: $fpaObjects", $cam_id, $PS_EXIT_SYS_ERROR) unless $ipprc->file_exists($fpaObjects); 308 309 foreach my $outMask (@outMasks) { 310 &my_die("Unable to find expected output file: $outMask", $cam_id, $PS_EXIT_SYS_ERROR) unless $ipprc->file_exists($outMask); 311 } 312 313 if ($run_state eq 'new') { 314 &my_die("Couldn't find expected output file: $configuration", $cam_id, $PS_EXIT_SYS_ERROR) unless $ipprc->file_exists($configuration); 315 } 295 316 } 296 317
Note:
See TracChangeset
for help on using the changeset viewer.
