Changeset 16018
- Timestamp:
- Jan 6, 2008, 1:59:05 PM (18 years ago)
- File:
-
- 1 edited
-
trunk/ippScripts/scripts/camera_exp.pl (modified) (9 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ippScripts/scripts/camera_exp.pl
r15387 r16018 28 28 $PS_EXIT_DATA_ERROR 29 29 $PS_EXIT_TIMEOUT_ERROR 30 metadataLookupStr 31 metadataLookupBool 30 32 caturi 31 33 ); … … 51 53 pod2usage( -msg => "Unknown option: @ARGV", -exitval => 2 ) if @ARGV; 52 54 pod2usage( 53 -msg => "Required options: --exp_tag --cam_id --camera",54 -exitval => 3,55 ) unless defined $exp_tag55 -msg => "Required options: --exp_tag --cam_id --camera", 56 -exitval => 3, 57 ) unless defined $exp_tag 56 58 and defined $cam_id 57 59 and defined $camera; … … 70 72 # values to extract from output metadata and the stats to calculate 71 73 my $CHIPSTATS = 72 [73 # PPSTATS KEYWORD STATISTIC CHIPTOOL FLAG74 [ 75 # PPSTATS KEYWORD STATISTIC CHIPTOOL FLAG 74 76 { name => "bg", type => "mean", flag => "-bg", dtype => "float" }, 75 77 { name => "bg_mean_stdev", type => "stdev", flag => "-bg_mean_stdev", dtype => "float" }, … … 90 92 # { name => "fringe_1", type => "rms", flag => "-fringe_1", dtype => "float" }, 91 93 # { name => "fringe_0", type => "stdev", flag => "-fringe_2", dtype => "float" }, 92 ];94 ]; 93 95 my $chipStats = PS::IPP::Metadata::Stats->new($CHIPSTATS); # Stats parser 94 96 … … 97 99 my $camtool = can_run('camtool') or (warn "Can't find camtool" and $missing_tools = 1); 98 100 my $ppImage = can_run('ppImage') or (warn "Can't find ppImage" and $missing_tools = 1); 101 my $ppConfigDump = can_run('ppConfigDump') or (warn "Can't find ppConfigDump" and $missing_tools = 1); 99 102 100 103 # test for addstar and psastro: … … 149 152 print $list3File ($chipObjects . "\n"); 150 153 151 # if any of the output chip astrometry files exist, we can run psastro / addstar below154 # if any of the output chip astrometry files exist, we can run psastro / addstar below 152 155 if ($ipprc->file_exists($chipObjects)) { 153 156 $chipObjectsExist = 1; … … 203 206 } 204 207 205 # only run psastro / addstar if any of the output chip astrometry files exist 208 # check recipe for PSASTRO.MOSAIC.MODE; run mosaic astrometry if 209 # requested by the camera's PSASTRO recipe 210 my $mosaicAstrom; # run mosaic-level astrometry? 211 { 212 my $command = "$ppConfigDump -camera $camera -dump-recipe PSASTRO -"; 213 my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) = 214 run(command => $command, verbose => 1); 215 unless ($success) { 216 $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR); 217 &my_die("Unable to perform ppConfigDump: $error_code", $cam_id, $error_code); 218 } 219 my $metadata = $mdcParser->parse(join "", @$stdout_buf) or 220 &my_die("Unable to parse metadata config doc", $cam_id, $PS_EXIT_PROG_ERROR); 221 $mosaicAstrom = metadataLookupBool($metadata, 'PSASTRO.MOSAIC.MODE'); 222 } 223 224 # only run psastro / addstar if any of the output chip astrometry files exist (should we test for successful astrometry?) 206 225 if ($chipObjectsExist) { 207 # run psastro +mosastro on the set of chips or copy the chipObjects to fpaObjects 208 # XXX note that this is wrong if imfiles are cells 209 # XXX add a ppStats call which will collect the astrometry stats 210 if (scalar @$files > 1) { 211 my $command = "$psastro -list $list3Name $outputRoot +mosastro -chipastro " . 212 "-F PSASTRO.OUTPUT PSASTRO.OUTPUT.MEF"; 226 if ($mosaicAstrom) { 227 # run psastro +mosastro on the set of chips or copy the chipObjects to fpaObjects 228 # XXX note that this is wrong if imfiles are cells 229 # XXX add a ppStats call which will collect the astrometry stats 230 my $command; 231 $command = "$psastro -list $list3Name $outputRoot"; 232 $command .= " +mosastro -chipastro"; 233 $command .= " -F PSASTRO.OUTPUT PSASTRO.OUTPUT.MEF"; 213 234 $command .= " -tracedest $traceDest -log $logDest"; 214 235 my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) = … … 218 239 &my_die("Unable to perform psastro: $error_code", $cam_id, $error_code); 219 240 } 220 } else {221 $ipprc->file_copy($chipObjects, $fpaObjects) unless $chipObjects eq $fpaObjects;241 # XXX do we want to give an error if astrometry fails here? 242 &my_die("Unable to find expected output file: $fpaObjects", $cam_id, $PS_EXIT_PROG_ERROR) unless -f $ipprc->file_resolve($fpaObjects); 222 243 } 223 &my_die("Unable to find expected output file: $fpaObjects", $cam_id, $PS_EXIT_PROG_ERROR) unless -f $ipprc->file_resolve($fpaObjects);224 244 245 # do we supply chipObjects or fpaObjects to addstar? 225 246 # run addstar on either the single chip output or the single fpa output 226 # XXX this construct requires the user to have a valid .ptolemyrc227 # XXX which in turn points at ippconfig/dvo.site228 229 # require a defined output dvo database to run addstar (ie, refuse to use the .ptolemyrc default)230 # XXX this needs to be converted to addstar_client...231 247 if (defined $dvodbReal) { 248 # XXX this construct requires the user to have a valid .ptolemyrc 249 # XXX which in turn points at ippconfig/dvo.site 250 # require a defined output dvo database to run addstar (ie, refuse to use the .ptolemyrc default) 251 # XXX this needs to be converted to addstar_client... 252 232 253 my $camdir = $ipprc->dvo_cameradir(); # Camera directory for addstar 233 my $command = "$addstar -D CAMERA $camdir " . $ipprc->file_resolve($fpaObjects); 254 my $command; 255 $command = "$addstar -D CAMERA $camdir "; 234 256 $command .= " -D CATDIR $dvodbReal"; 257 258 if ($mosaicAstrom) { 259 $command .= " $ipprc->file_resolve($fpaObjects)"; 260 } else { 261 print STDERR "ERROR: addstar needs to be update to support the -list input structure\n"; 262 $command .= " -list $list3File"; 263 } 235 264 236 265 my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) = … … 242 271 } 243 272 } 244 245 273 } 246 274
Note:
See TracChangeset
for help on using the changeset viewer.
