Changeset 43112
- Timestamp:
- Oct 8, 2026, 12:58:31 PM (6 days ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
tags/ipp-ops-20220906/ippScripts/scripts/camera_exp.pl
r42247 r43112 110 110 &my_die("Unrecognised JPEG recipe", $cam_id, $PS_EXIT_CONFIG_ERROR) unless defined $recipe2; 111 111 112 my $recipe_jpeg = $ipprc->reduction($reduction, 'JPEG'); # Recipe to define colors and display scale 113 112 114 #my $recipe_addstar = $ipprc->reduction($reduction, 'ADDSTAR'); # Recipe to use 113 115 #&my_die("Unrecognised ADDSTAR recipe", $cam_id, $PS_EXIT_CONFIG_ERROR) unless defined $recipe_addstar; … … 132 134 &my_die("Unable to parse metadata config doc", $cam_id, $PS_EXIT_CONFIG_ERROR); 133 135 } 136 137 ## option to skip the astrometry analysis (but still do the jpegs) 138 ## if not defined in the config file, default is to not skip 139 my $skip_astrom = 0; 140 $skip_astrom = metadataLookupBool($recipeData, 'PSASTRO.SKIP.ASTROMETRY'); 141 print "skip astrom: $skip_astrom\n"; 142 if ($skip_astrom) { print "skip the astrom\n"; } 143 144 my $skip_bkg = metadataLookupBool($recipeData, 'PSASTRO.SKIP.BACKGROUND'); 145 146 print "skip bkg: $skip_bkg\n"; 134 147 135 148 my $cmdflags; … … 183 196 ($expFWHM) = $cmdflags =~ /-fwhm_major (\d+)/; 184 197 185 if ($expFWHM > $maxFWHM) { 198 if (not defined $expFWHM) { 199 print "FWHM not measured (no photometry?), Setting quality to 4077\n"; 200 $cmdflags .= " -quality 4077 "; # This corresponds to PSASTRO_ERR_DATA 201 $skip_astrom = 1; 202 } elsif ($expFWHM > $maxFWHM) { 186 203 print "Setting quality to 4007 due to large FWHM: exposure: $expFWHM maximum: $maxFWHM\n"; 187 204 $cmdflags .= " -quality 4007 "; # This corresponds to PSASTRO_ERR_DATA 188 $no_op = 1;189 }190 }191 }192 205 # $no_op = 1; 206 $skip_astrom = 1; # skip astrometry, but make the jpegs 207 } 208 } 209 } 193 210 194 211 my $do_masks; # Produce masks? … … 210 227 211 228 my $do_stats; 212 my $do_bkg ;229 my $do_bkg = !$skip_bkg; 213 230 my $do_jpegs; 214 231 my $fpaStats; … … 216 233 if ($run_state eq 'new') { 217 234 $do_stats = 1; 218 $do_bkg = 1;235 # $do_bkg = 1; 219 236 $do_jpegs = !$skip_binned; 220 237 $fpaStats = prepare_output("PSASTRO.STATS", $outroot, undef, 1); … … 224 241 $do_stats = 0; 225 242 $do_jpegs = 0; 226 $do_bkg = 1; # we could skip this step if camProcessedExp.backgroun_model is non zero243 # $do_bkg = 1; # we could skip this step if camProcessedExp.backgroun_model is non zero 227 244 228 245 if (!$do_masks) { … … 266 283 my @bkg_models; # Names of output background models 267 284 foreach my $file (@$files) { 285 # use the path_base as OUTPUT root and convert the filenames with ipprc->filename: 286 my $class_id = $file->{class_id}; 287 288 # include all of the binned images for the full JPEG (even if quality is bad) 289 print $list1File ($ipprc->filename("PPIMAGE.BIN1", $file->{path_base}, $class_id) . "\n"); 290 print $list2File ($ipprc->filename("PPIMAGE.BIN2", $file->{path_base}, $class_id) . "\n"); 291 292 # optionally generate the background (gpc1 only) 293 print $list5File ($ipprc->filename("PSPHOT.BACKMDL", $file->{path_base}, $class_id) . "\n") if $do_bkg; 294 268 295 # we perform astrometry iff photometry output exists 269 296 next if $file->{quality} != 0; 270 271 # use the path_base as OUTPUT root and convert the filenames with ipprc->filename:272 my $class_id = $file->{class_id};273 297 274 298 # If there is only one chip, we use this name for the input to addstar … … 277 301 my $chipMask = $ipprc->filename("PPIMAGE.CHIP.MASK", $file->{path_base}, $class_id); 278 302 279 print $list1File ($ipprc->filename("PPIMAGE.BIN1", $file->{path_base}, $class_id) . "\n");280 print $list2File ($ipprc->filename("PPIMAGE.BIN2", $file->{path_base}, $class_id) . "\n");281 303 print $list3File ($chipObjects . "\n"); 282 304 print $list4File ($chipMask . "\n"); 283 print $list5File ($ipprc->filename("PSPHOT.BACKMDL", $file->{path_base}, $class_id) . "\n");284 305 285 306 push @outMasks, prepare_output("PSASTRO.OUTPUT.MASK", $outroot, $class_id, 1) if $do_masks; … … 297 318 my $jpeg1 = prepare_output("PPIMAGE.JPEG1", $outroot, undef, 1) if $do_jpegs; 298 319 my $jpeg2 = prepare_output("PPIMAGE.JPEG2", $outroot, undef, 1) if $do_jpegs; 299 my $fpaObjects = prepare_output("PSASTRO.OUTPUT", $outroot, undef, 1) if !$bkg_only;320 my $fpaObjects = prepare_output("PSASTRO.OUTPUT", $outroot, undef, 1) if (!$bkg_only && !$skip_astrom); 300 321 301 322 my $configuration; … … 317 338 my $command = "$ppImage -list $list1Name $outroot"; # Command to run 318 339 $command .= " -recipe PPIMAGE $recipe1"; 340 $command .= " -recipe JPEG $recipe_jpeg" if defined $recipe_jpeg; # if not defined, use the defaults 319 341 $command .= " -dbname $dbname" if defined $dbname; 320 342 … … 331 353 $command = "$ppImage -list $list2Name $outroot"; # Command to run 332 354 $command .= " -recipe PPIMAGE $recipe2"; 355 $command .= " -recipe JPEG $recipe_jpeg" if defined $recipe_jpeg; # if not defined, use the defaults 333 356 $command .= " -dbname $dbname" if defined $dbname; 334 357 … … 342 365 } 343 366 344 if (!$bkg_only ) {367 if (!$bkg_only && !$skip_astrom) { 345 368 # run psastro on the chipObjects, producing fpaObjects 346 369 my $command; … … 408 431 # Construct FPA continuity corrected background images 409 432 # if (($camera =~ /ISP/)||($camera =~ /HSC/)||($camera =~ /gpc2/i)) { 410 if ($ camera =~ /gpc1/i) {433 if ($do_bkg && ($camera =~ /gpc1/i)) { 411 434 print "Generating FPA continuity corrected background images for GPC1 only\n"; 412 435 my $command;
Note:
See TracChangeset
for help on using the changeset viewer.
