Changeset 35723 for trunk/ippScripts/scripts/camera_exp.pl
- Timestamp:
- Jun 28, 2013, 3:32:59 PM (13 years ago)
- File:
-
- 1 edited
-
trunk/ippScripts/scripts/camera_exp.pl (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ippScripts/scripts/camera_exp.pl
r35715 r35723 117 117 my $mdcParser = PS::IPP::Metadata::Config->new; # Parser for metadata config files 118 118 119 my $recipeData; 120 { 121 # Get the PSASTRO recipe 122 my $command = "$ppConfigDump -camera $camera -recipe PSASTRO $recipe_psastro -dump-recipe PSASTRO -"; 123 my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) = 124 run(command => $command, verbose => $verbose); 125 unless ($success) { 126 $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR); 127 &my_die("Unable to perform ppConfigDump: $error_code", $cam_id, $PS_EXIT_CONFIG_ERROR); 128 } 129 $recipeData = $mdcParser->parse(join "", @$stdout_buf) or 130 &my_die("Unable to parse metadata config doc", $cam_id, $PS_EXIT_CONFIG_ERROR); 131 } 132 119 133 my $cmdflags; 120 134 … … 160 174 chomp $cmdflags; 161 175 162 { # Determine if FWHM is too large to bother continuing. 163 my $maxFWHM = 0; 164 # XXX: temporary hack if this is a CNP exposure set maxFWHM to a large 165 # value. 166 # Before the next tag we will put this into a recipe 167 if ($outroot =~ /CNP/) { 168 $maxFWHM = 25; 169 } else { 170 my $command = "$ppConfigDump -camera $camera -get-key MAX_ALLOWED_FWHM"; 171 my ($success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) = 172 run(command => $command, verbose => $verbose); 173 unless ($success) { 174 $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR); 175 &my_die("Unable to perform ppConfigDump: $error_code", $cam_id, $PS_EXIT_CONFIG_ERROR); 176 } 177 if (@$stdout_buf) { 178 my $cameraConfig = $mdcParser->parse(join "", @$stdout_buf) or 179 &my_die("Unable to parse metadata config doc", $cam_id, $PS_EXIT_CONFIG_ERROR); 180 $maxFWHM = metadataLookupStr($cameraConfig, 'MAX_ALLOWED_FWHM'); 181 } 182 } 183 if ($maxFWHM) { 184 my $expFWHM; 185 ($expFWHM) = $cmdflags =~ /-fwhm_major (\d+)/; 186 187 if ($expFWHM > $maxFWHM) { 188 print "Setting quality to 4007 due to large FWHM: exposure: $expFWHM maximum: $maxFWHM\n"; 189 $cmdflags .= " -quality 4007 "; # This corresponds to PSASTRO_ERR_DATA 190 $no_op = 1; 191 } 192 } 176 # Determine if FWHM is too large to bother continuing. 177 my $maxFWHM = metadataLookupF32($recipeData, 'PSASTRO.MAX.ALLOWED.FWHM'); 178 if ($maxFWHM) { 179 my $expFWHM; 180 ($expFWHM) = $cmdflags =~ /-fwhm_major (\d+)/; 181 182 if ($expFWHM > $maxFWHM) { 183 print "Setting quality to 4007 due to large FWHM: exposure: $expFWHM maximum: $maxFWHM\n"; 184 $cmdflags .= " -quality 4007 "; # This corresponds to PSASTRO_ERR_DATA 185 $no_op = 1; 186 } 193 187 } 194 188 } … … 197 191 my $do_masks; # Produce masks? 198 192 if (!$skip_masks) { 199 # Get the PSASTRO recipe200 my $command = "$ppConfigDump -camera $camera -recipe PSASTRO $recipe_psastro -dump-recipe PSASTRO -";201 my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =202 run(command => $command, verbose => $verbose);203 unless ($success) {204 $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR);205 &my_die("Unable to perform ppConfigDump: $error_code", $cam_id, $PS_EXIT_CONFIG_ERROR);206 }207 my $recipeData = $mdcParser->parse(join "", @$stdout_buf) or208 &my_die("Unable to parse metadata config doc", $cam_id, $PS_EXIT_CONFIG_ERROR);209 210 193 $do_masks = metadataLookupBool($recipeData, 'REFSTAR_MASK'); 211 194 } … … 235 218 $psastroInputArg = " -list $list3Name"; 236 219 } else { 237 # for $run_state eq 'update' we onl ly rebuild the masks using psastro220 # for $run_state eq 'update' we only rebuild the masks using psastro 238 221 $do_stats = 0; 239 222 $do_jpegs = 0; … … 317 300 $configuration = prepare_output("PSASTRO.CONFIG", $outroot, undef, 1); 318 301 } else { 319 # Do not use the original recipes because they might contain the302 # Do not use the original recipes for updates because they might contain the 320 303 # recipe values that caused the masks to get fouled up in the first place 321 304 # $configuration = $ipprc->filename("PSASTRO.CONFIG", $outroot, undef);
Note:
See TracChangeset
for help on using the changeset viewer.
