IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Apr 21, 2026, 3:48:50 PM (2 weeks ago)
Author:
eugene
Message:

make background model optional (PSASTRO.SKIP.BACKGROUND)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/ippScripts/scripts/camera_exp.pl

    r42388 r42986  
    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;
     
    139141print "skip astrom: $skip_astrom\n";
    140142if ($skip_astrom) { print "skip the astrom\n"; }
     143
     144my $skip_bkg = metadataLookupBool($recipeData, 'PSASTRO.SKIP.BACKGROUND');
     145
     146print "skip bkg: $skip_bkg\n";
    141147
    142148my $cmdflags;
     
    221227
    222228my $do_stats;
    223 my $do_bkg;
     229my $do_bkg = !$skip_bkg;
    224230my $do_jpegs;
    225231my $fpaStats;
     
    227233if ($run_state eq 'new') {
    228234    $do_stats = 1;
    229     $do_bkg = 1;
     235    # $do_bkg = 1;
    230236    $do_jpegs = !$skip_binned;
    231237    $fpaStats = prepare_output("PSASTRO.STATS",      $outroot, undef, 1);
     
    235241    $do_stats = 0;
    236242    $do_jpegs = 0;
    237     $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
    238244
    239245    if (!$do_masks) {
     
    277283my @bkg_models;                 # Names of output background models
    278284foreach 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
    279295    # we perform astrometry iff photometry output exists
    280296    next if $file->{quality} != 0;
    281 
    282     # use the path_base as OUTPUT root and convert the filenames with ipprc->filename:
    283     my $class_id = $file->{class_id};
    284297
    285298    # If there is only one chip, we use this name for the input to addstar
     
    288301    my $chipMask   = $ipprc->filename("PPIMAGE.CHIP.MASK", $file->{path_base}, $class_id);
    289302   
    290     print $list1File ($ipprc->filename("PPIMAGE.BIN1", $file->{path_base}, $class_id) . "\n");
    291     print $list2File ($ipprc->filename("PPIMAGE.BIN2", $file->{path_base}, $class_id) . "\n");
    292303    print $list3File ($chipObjects . "\n");
    293304    print $list4File ($chipMask . "\n");
    294     print $list5File ($ipprc->filename("PSPHOT.BACKMDL", $file->{path_base}, $class_id) . "\n");
    295305
    296306    push @outMasks, prepare_output("PSASTRO.OUTPUT.MASK", $outroot, $class_id, 1) if $do_masks;
     
    328338        my $command = "$ppImage -list $list1Name $outroot"; # Command to run
    329339        $command .= " -recipe PPIMAGE $recipe1";
     340        $command .= " -recipe JPEG $recipe_jpeg" if defined $recipe_jpeg; # if not defined, use the defaults
    330341        $command .= " -dbname $dbname" if defined $dbname;
    331342
     
    342353        $command = "$ppImage -list $list2Name $outroot"; # Command to run
    343354        $command .= " -recipe PPIMAGE $recipe2";
     355        $command .= " -recipe JPEG $recipe_jpeg" if defined $recipe_jpeg; # if not defined, use the defaults
    344356        $command .= " -dbname $dbname" if defined $dbname;
    345357
     
    419431    # Construct FPA continuity corrected background images
    420432    # if (($camera =~ /ISP/)||($camera =~ /HSC/)||($camera =~ /gpc2/i)) {
    421     if ($camera =~ /gpc1/i) {
     433    if ($do_bkg && ($camera =~ /gpc1/i)) {
    422434        print "Generating FPA continuity corrected background images for GPC1 only\n";
    423435        my $command;
Note: See TracChangeset for help on using the changeset viewer.