IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 42663


Ignore:
Timestamp:
Apr 22, 2024, 3:53:54 PM (2 years ago)
Author:
eugene
Message:

fixup tasks and tools for xcstack - xccal

Location:
branches/eam_branches/ipp-20230313
Files:
2 added
7 edited

Legend:

Unmodified
Added
Removed
  • branches/eam_branches/ipp-20230313/ippScripts/scripts/xccal.pl

    r42602 r42663  
    5151    print "  --outroot (root)        : Output root name\n";
    5252    print "  --path_base (path_base) : path_base of input\n";
    53     print "  --filter (filter)       : filter of input\n";
    54     print "  --singlefilter          : the input is the result of a single filter analysis";
    5553    print "  --reduction (class)     : Reduction class\n";
    5654    print "  --verbose               : Be extra verbose\n";
     
    143141my $file = $ipprc->filename('PSPHOT.STACK.OUTPUT', $path_base, $xcstack_id);
    144142if (! $ipprc->file_resolve($file)) {
    145     print "\nfailed to resolve $file, is it a single-filter stack?\n";
     143    print "\nfailed to resolve $file, checking for a single-filter stack\n";
    146144    # input is from a single filter static sky run which used psphot instead of psphotStack
    147145    # The file rule is different for psphot
  • branches/eam_branches/ipp-20230313/ippScripts/scripts/xcstack_skycell.pl

    r42602 r42663  
    120120        my $stack_id = $input->{stack_id};
    121121
     122        my $good_frac = $input->{good_frac};
     123        my $Nsources  = $input->{sources};
     124
     125        print "camera: $camera_name, stack_id: $stack_id, good_frac: $good_frac, Nsources: $Nsources\n";
     126        if ($good_frac < 1e-4) { my_escape("low good_frac ($good_frac) for $camera_name, stack_id $stack_id", $xcstack_id, 6000); }
     127        if ($Nsources < 1) { my_escape("no sources for $camera_name, stack_id $stack_id", $xcstack_id, 6001); }
     128
    122129        # check for the input files
    123130        my $image    = $ipprc->filename("PPSTACK.UNCONV",          $input->{path_base}); # Image name
     
    131138        my $have_sources = $ipprc->file_exists( $sources );
    132139       
    133         &my_die("Image $image does not exist", $stack_id, $PS_EXIT_SYS_ERROR) unless $have_image;
    134         &my_die("Mask $mask does not exist", $stack_id, $PS_EXIT_SYS_ERROR) unless $have_mask;
    135         &my_die("Weight $weight does not exist", $stack_id, $PS_EXIT_SYS_ERROR) unless $have_weight;
    136         &my_die("Sources $sources does not exist", $stack_id, $PS_EXIT_SYS_ERROR) unless $have_sources;
     140        &my_die("Image $image does not exist for $camera_name, stack_id $stack_id", $xcstack_id, $PS_EXIT_SYS_ERROR) unless $have_image;
     141        &my_die("Mask $mask does not exist for $camera_name, stack_id $stack_id", $xcstack_id, $PS_EXIT_SYS_ERROR) unless $have_mask;
     142        &my_die("Weight $weight does not exist for $camera_name, stack_id $stack_id", $xcstack_id, $PS_EXIT_SYS_ERROR) unless $have_weight;
     143        &my_die("Sources $sources does not exist for $camera_name, stack_id $stack_id", $xcstack_id, $PS_EXIT_SYS_ERROR) unless $have_sources;
    137144       
    138145        print $listFile "INPUT$num\tMETADATA\n";
     
    148155close($listFile);
    149156
    150 &my_die("input list contains less than two elements", $xcstack_id, $PS_EXIT_DATA_ERROR) unless scalar $num >= 2;
     157if ($num < 2) { &my_escape("not enough input stacks to make an xcstack", $xcstack_id, 6002); }
    151158
    152159print "I've loaded my inputs: $xcstack_id\n";
     
    333340        }
    334341        $command .= " -dbname $dbname" if defined $dbname;
     342        print "running in my_die: $command\n";
    335343        system ($command);
    336344    }
    337345    exit $exit_code;
     346}
     347
     348sub my_escape
     349{
     350    my $msg = shift;            # Warning message on exit
     351    my $xcstack_id = shift;       # Xcstack identifier
     352    my $quality = shift;      # Exit code to add
     353
     354    carp($msg);
     355
     356    if (defined $xcstack_id and not $no_update) {
     357        my $command = "$xcstacktool -xcstack_id $xcstack_id";
     358        if ($run_state eq 'new') {
     359            $command .= " -addsumskyfile";
     360            $command .= " -path_base $outroot" if defined $outroot;
     361            $command .= " -hostname $host" if defined $host;
     362            $command .= " -quality $quality" if defined $quality;
     363            $command .= (" -dtime_script " . ((DateTime->now->mjd - $mjd_start) * 86400));
     364        } else {
     365            $command .= " -updatesumskyfile";
     366            $command .= " -set_quality $quality" if defined $quality;
     367        }
     368        $command .= " -dbname $dbname" if defined $dbname;
     369        print "running in my_die: $command\n";
     370        system ($command);
     371    }
     372    exit 0;
    338373}
    339374
  • branches/eam_branches/ipp-20230313/ippTasks/Makefile.am

    r42570 r42663  
    5252        fpcamera.pro \
    5353        xcstack.pro \
     54        xcsky.pro \
     55        xccal.pro \
    5456        fullforce.pro
    5557
  • branches/eam_branches/ipp-20230313/ippTasks/xcstack.pro

    r42570 r42663  
    9191
    9292  task.exec
     93    periods -exec $LOADEXEC
     94
    9395    if ($LABEL:n == 0) break
    9496    $run = xcstacktool -tosum
     
    106108    # change the limit (the last one on the command line takes precedence)
    107109    $run = $run -limit $POLL_LIMIT_XCSTACK
     110
     111    # re-try quickly until we run out
     112    periods -exec 0.05
    108113    command $run
    109114  end
  • branches/eam_branches/ipp-20230313/ippTools/src/xcskytool.c

    r42596 r42663  
    121121
    122122    PXOPT_COPY_S64(config->args, whereMD, "-select_xcstack_id",    "xcstackRun.xcstack_id",       "==");
     123    PXOPT_COPY_STR(config->args, whereMD, "-select_tess_id",       "xcstackRun.tess_id",          "==");
    123124    PXOPT_COPY_STR(config->args, whereMD, "-select_skycell_id",    "xcstackRun.skycell_id",       "LIKE");
    124     PXOPT_COPY_STR(config->args, whereMD, "-select_tess_id",       "xcstackRun.tess_id",          "==");
     125    pxAddLabelSearchArgs(config, whereMD, "-select_filter",        "xcstackRun.filter",           "LIKE");
    125126    PXOPT_COPY_F32(config->args, whereMD, "-select_good_frac_min", "xcstackSumSkyfile.good_frac", ">=");
    126127    pxAddLabelSearchArgs(config, whereMD, "-select_label",         "xcstackRun.label",            "LIKE");
    127128    pxAddLabelSearchArgs(config, whereMD, "-select_data_group",    "xcstackRun.data_group",       "LIKE");
    128     pxAddLabelSearchArgs(config, whereMD, "-select_filter",        "xcstackRun.filter",           "LIKE");
    129129    if (!pxskycellAddWhere(config, whereMD)) {
    130130        psError(PXTOOLS_ERR_CONFIG, false, "failed to add skycell search arguments");
     
    10711071    PXOPT_COPY_S64(config->args, whereMD, "-select_xcsky_id",      "xcskyRun.xcsky_id",           "==");
    10721072    PXOPT_COPY_S64(config->args, whereMD, "-select_xcstack_id",    "xcstackRun.xcstack_id",       "==");
    1073     PXOPT_COPY_STR(config->args, whereMD, "-select_skycell_id",    "xcstackRun.skycell_id",       "==");
    10741073    PXOPT_COPY_STR(config->args, whereMD, "-select_tess_id",       "xcstackRun.tess_id",          "==");
     1074    PXOPT_COPY_STR(config->args, whereMD, "-select_skycell_id",    "xcstackRun.skycell_id",       "LIKE");
    10751075    pxAddLabelSearchArgs(config, whereMD, "-select_filter",        "xcstackRun.filter",           "LIKE");
    10761076    PXOPT_COPY_F32(config->args, whereMD, "-select_good_frac_min", "xcstackSumSkyfile.good_frac", ">=");
  • branches/eam_branches/ipp-20230313/ippconfig/recipes/ppStack.config

    r42642 r42663  
    253253  SKIP.MISSING.INPUTS BOOL FALSE          # If some input warp images are missing, make the stack anyway
    254254 
    255   SKIP.BG.SUB     BOOL    TRUE            # Bypass background subtraction?
     255  SKIP.BG.SUB         BOOL TRUE            # Bypass background subtraction?
     256
     257  OUTPUT.NOCOMP       BOOL FALSE # use filerules that make compressed outputs
     258  OUTPUT.LOGFLUX      BOOL TRUE  # choose a log-scaling for output images
     259  OUTPUT.DEEPEXP      BOOL TRUE  # allow exptime maps with dynamic range up to 2^16 (64k) seconds
    256260END
    257261
  • branches/eam_branches/ipp-20230313/ippconfig/recipes/reductionClasses.mdc

    r42642 r42663  
    21432143    PSVIDEOPHOT                 STR     PSVIDEOPHOT
    21442144    XCSTACK_PPSTACK             STR     XCSTACK_UNIONS_DR4
    2145     XCSTACK_PSPHOT              STR     STACKPHOT_SINGLE
    2146 END
     2145#   XCSTACK_PSPHOT              STR     STACKPHOT_SINGLE
     2146    XCSTACK_PSPHOT              STR     UNIONS_DR3
     2147END
Note: See TracChangeset for help on using the changeset viewer.