Changeset 18009
- Timestamp:
- Jun 8, 2008, 3:54:09 PM (18 years ago)
- File:
-
- 1 edited
-
trunk/ippScripts/scripts/camera_exp.pl (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ippScripts/scripts/camera_exp.pl
r17803 r18009 91 91 { name => "n_extended", type => "sum", flag => "-n_extended", dtype => "int" }, 92 92 { name => "n_cr", type => "sum", flag => "-n_cr", dtype => "int" }, 93 { name => "n_astrom", type => "sum", flag => "-n_astrom", dtype => "int" },94 95 96 # these are not defined for the database table camProcessedExp97 93 ]; 98 94 my $chipStats = PS::IPP::Metadata::Stats->new($CHIPSTATS); # Stats parser 95 96 # values to extract from camera-level output metadata and the stats to calculate 97 my $CAMSTATS = 98 [ 99 # PPSTATS KEYWORD STATISTIC CHIPTOOL FLAG 100 { name => "CERROR", type => "rms", flag => "-sigma_ra", dtype => "float" }, 101 { name => "CERROR", type => "rms", flag => "-sigma_dec", dtype => "float" }, 102 { name => "DT_ASTR", type => "sum", flag => "-dtime_astrom", dtype => "float" }, 103 { name => "NASTRO", type => "sum", flag => "-n_astrom", dtype => "int" }, 104 # { name => "ZP??", type => "mean", flag => "-zp_mean", dtype => "float" }, 105 # { name => "ZP??", type => "rms", flag => "-zp_stdev", dtype => "float" }, 106 ]; 107 my $camStats = PS::IPP::Metadata::Stats->new($CAMSTATS); # Stats parser 99 108 100 109 # Look for programs we need … … 174 183 my $jpeg2 = $ipprc->filename("PPIMAGE.JPEG2", $outroot) or &my_die("Missing entry from camera config", $cam_id, $PS_EXIT_CONFIG_ERROR); 175 184 my $fpaObjects = $ipprc->filename("PSASTRO.OUTPUT", $outroot) or &my_die("Missing entry from camera config", $cam_id, $PS_EXIT_CONFIG_ERROR); 185 my $fpaStats = $ipprc->filename("PSASTRO.STATS", $outroot) or &my_die("Missing entry from camera config", $cam_id, $PS_EXIT_CONFIG_ERROR); 176 186 my $traceDest = $ipprc->filename("TRACE.EXP", $outroot) or &my_die("Missing entry from camera config", $cam_id, $PS_EXIT_CONFIG_ERROR); 177 187 my $logDest = $ipprc->filename("LOG.EXP", $outroot) or &my_die("Missing entry from camera config", $cam_id, $PS_EXIT_CONFIG_ERROR); … … 223 233 $command = "$psastro -list $list3Name $outroot"; 224 234 $command .= " -tracedest $traceDest -log $logDest"; 235 $command .= " -stats $fpaStats"; 225 236 $command .= " -dbname $dbname" if defined $dbname; 226 237 … … 233 244 # XXX do we want to give an error if astrometry fails here? 234 245 &my_die("Unable to find expected output file: $fpaObjects", $cam_id, $PS_EXIT_PROG_ERROR) unless -f $ipprc->file_resolve($fpaObjects); 246 &my_die("Unable to find expected output file: $fpaStats", $cam_id, $PS_EXIT_PROG_ERROR) unless -f $ipprc->file_resolve($fpaObjects); 247 248 # Get the statistics on the processed image 249 my $statsFile; # File handle 250 open $statsFile, $ipprc->file_resolve($fpaStats) or &my_die("Can't open statistics file $outputStats: $!", $cam_id, $PS_EXIT_SYS_ERROR); 251 my @contents = <$statsFile>; # Contents of file 252 close $statsFile; 253 254 # parse the statistics MDC file 255 my $mdcParser = PS::IPP::Metadata::Config->new(); # Parser for metadata config files 256 my $metadata = $mdcParser->parse(join "", @contents); 257 unless ($metadata) { 258 &my_die("Unable to parse metadata config doc", $cam_id, $PS_EXIT_PROG_ERROR); 259 } 260 261 # extract the stats from the metadata 262 unless ($stats->parse($metadata)) { 263 &my_die("Failure extracting metadata from the statistics output file.\n", $exp_id, $chip_id, $class_id, $PS_EXIT_PROG_ERROR); 264 } 235 265 236 266 # run addstar on the output fpaObjects (if a DVO database is defined) … … 266 296 $fpaCommand .= " -dbname $dbname" if defined $dbname; 267 297 $fpaCommand .= $chipStats->cmdflags(); 298 $fpaCommand .= $camStats->cmdflags(); 268 299 269 300 # Add the result into the database
Note:
See TracChangeset
for help on using the changeset viewer.
