IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 43112


Ignore:
Timestamp:
Oct 8, 2026, 12:58:31 PM (6 days ago)
Author:
cclin33
Message:

generate jpg file on camera stage

File:
1 edited

Legend:

Unmodified
Added
Removed
  • tags/ipp-ops-20220906/ippScripts/scripts/camera_exp.pl

    r42247 r43112  
    110110&my_die("Unrecognised JPEG recipe", $cam_id, $PS_EXIT_CONFIG_ERROR) unless defined $recipe2;
    111111
     112my $recipe_jpeg = $ipprc->reduction($reduction, 'JPEG'); # Recipe to define colors and display scale
     113
    112114#my $recipe_addstar = $ipprc->reduction($reduction, 'ADDSTAR'); # Recipe to use
    113115#&my_die("Unrecognised ADDSTAR recipe", $cam_id, $PS_EXIT_CONFIG_ERROR) unless defined $recipe_addstar;
    … …  
    132134        &my_die("Unable to parse metadata config doc", $cam_id, $PS_EXIT_CONFIG_ERROR);
    133135}
     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
     139my $skip_astrom = 0;
     140$skip_astrom = metadataLookupBool($recipeData, 'PSASTRO.SKIP.ASTROMETRY');
     141print "skip astrom: $skip_astrom\n";
     142if ($skip_astrom) { print "skip the astrom\n"; }
     143
     144my $skip_bkg = metadataLookupBool($recipeData, 'PSASTRO.SKIP.BACKGROUND');
     145
     146print "skip bkg: $skip_bkg\n";
    134147
    135148my $cmdflags;
    … …  
    183196        ($expFWHM) = $cmdflags =~ /-fwhm_major (\d+)/; 
    184197       
    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) {
    186203            print "Setting quality to 4007 due to large FWHM: exposure: $expFWHM  maximum: $maxFWHM\n";
    187204            $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}
    193210
    194211my $do_masks;               # Produce masks?
    … …  
    210227
    211228my $do_stats;
    212 my $do_bkg;
     229my $do_bkg = !$skip_bkg;
    213230my $do_jpegs;
    214231my $fpaStats;
    … …  
    216233if ($run_state eq 'new') {
    217234    $do_stats = 1;
    218     $do_bkg = 1;
     235    # $do_bkg = 1;
    219236    $do_jpegs = !$skip_binned;
    220237    $fpaStats = prepare_output("PSASTRO.STATS",      $outroot, undef, 1);
    … …  
    224241    $do_stats = 0;
    225242    $do_jpegs = 0;
    226     $do_bkg = 1;        # we could skip this step if camProcessedExp.backgroun_model is non zero
     243    # $do_bkg = 1;        # we could skip this step if camProcessedExp.backgroun_model is non zero
    227244
    228245    if (!$do_masks) {
    … …  
    266283my @bkg_models;                 # Names of output background models
    267284foreach 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
    268295    # we perform astrometry iff photometry output exists
    269296    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};
    273297
    274298    # If there is only one chip, we use this name for the input to addstar
    … …  
    277301    my $chipMask   = $ipprc->filename("PPIMAGE.CHIP.MASK", $file->{path_base}, $class_id);
    278302   
    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");
    281303    print $list3File ($chipObjects . "\n");
    282304    print $list4File ($chipMask . "\n");
    283     print $list5File ($ipprc->filename("PSPHOT.BACKMDL", $file->{path_base}, $class_id) . "\n");
    284305
    285306    push @outMasks, prepare_output("PSASTRO.OUTPUT.MASK", $outroot, $class_id, 1) if $do_masks;
    … …  
    297318my $jpeg1      = prepare_output("PPIMAGE.JPEG1",      $outroot, undef, 1) if $do_jpegs;
    298319my $jpeg2      = prepare_output("PPIMAGE.JPEG2",      $outroot, undef, 1) if $do_jpegs;
    299 my $fpaObjects = prepare_output("PSASTRO.OUTPUT",     $outroot, undef, 1) if !$bkg_only;
     320my $fpaObjects = prepare_output("PSASTRO.OUTPUT",     $outroot, undef, 1) if (!$bkg_only && !$skip_astrom);
    300321
    301322my $configuration;
    … …  
    317338        my $command = "$ppImage -list $list1Name $outroot"; # Command to run
    318339        $command .= " -recipe PPIMAGE $recipe1";
     340        $command .= " -recipe JPEG $recipe_jpeg" if defined $recipe_jpeg; # if not defined, use the defaults
    319341        $command .= " -dbname $dbname" if defined $dbname;
    320342
    … …  
    331353        $command = "$ppImage -list $list2Name $outroot"; # Command to run
    332354        $command .= " -recipe PPIMAGE $recipe2";
     355        $command .= " -recipe JPEG $recipe_jpeg" if defined $recipe_jpeg; # if not defined, use the defaults
    333356        $command .= " -dbname $dbname" if defined $dbname;
    334357
    … …  
    342365    }
    343366
    344     if (!$bkg_only) {
     367    if (!$bkg_only && !$skip_astrom) {
    345368        # run psastro on the chipObjects, producing fpaObjects
    346369        my $command;
    … …  
    408431    # Construct FPA continuity corrected background images
    409432    # if (($camera =~ /ISP/)||($camera =~ /HSC/)||($camera =~ /gpc2/i)) {
    410     if ($camera =~ /gpc1/i) {
     433    if ($do_bkg && ($camera =~ /gpc1/i)) {
    411434        print "Generating FPA continuity corrected background images for GPC1 only\n";
    412435        my $command;
Note: See TracChangeset for help on using the changeset viewer.