IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
May 18, 2010, 4:11:53 PM (16 years ago)
Author:
eugene
Message:

merge changes from branches/eam_branches/psphot,psModules.20100506 (finish basic psphotStack)

Location:
trunk/psphot
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/psphot

  • trunk/psphot/src/psphotStackChisqImage.c

    r27657 r28013  
    66
    77// XXX supply filename or keep PSPHOT.INPUT fixed?
    8 bool psphotStackChisqImage (pmConfig *config, const pmFPAview *view)
     8bool psphotStackChisqImage (pmConfig *config, const pmFPAview *view, const char *ruleDet, const char *ruleCnv)
    99{
    1010    bool status = false;
     
    2121
    2222    // loop over the available readouts
     23    // generate the chisq image from the 'detection' images
    2324    for (int i = 0; i < num; i++) {
    24         if (!psphotStackChisqImageAddReadout(config, view, &chiReadout, "PSPHOT.INPUT", i)) {
    25             psError (PSPHOT_ERR_CONFIG, false, "failed to model background for PSPHOT.INPUT entry %d", i);
     25        if (!psphotStackChisqImageAddReadout(config, view, ruleDet, &chiReadout, i)) {
     26            psError (PSPHOT_ERR_CONFIG, false, "failed to model background for %s entry %d", ruleDet, i);
    2627            return false;
    2728        }
     
    3536    psMetadataAddS32(config->arguments, PS_LIST_TAIL, "PSPHOT.INPUT.NUM", PS_META_REPLACE, "", num);
    3637
    37     // need to save the resulting image somewhere (PSPHOT.INPUT?)
    38     if (!psMetadataAddPtr(config->files, PS_LIST_TAIL, "PSPHOT.INPUT", PS_DATA_UNKNOWN | PS_META_DUPLICATE_OK, "", chisqFile)) {
     38    // save the resulting image in the 'detection' set
     39    if (!psMetadataAddPtr(config->files, PS_LIST_TAIL, ruleDet, PS_DATA_UNKNOWN | PS_META_DUPLICATE_OK, "", chisqFile)) {
     40        psError(PM_ERR_CONFIG, false, "could not add chisqFPA to config files");
     41        return false;
     42    }
     43
     44    // save the resulting image in the 'convolved' set
     45    if (!psMetadataAddPtr(config->files, PS_LIST_TAIL, ruleCnv, PS_DATA_UNKNOWN | PS_META_DUPLICATE_OK, "", chisqFile)) {
    3946        psError(PM_ERR_CONFIG, false, "could not add chisqFPA to config files");
    4047        return false;
     
    4855bool psphotStackChisqImageAddReadout(const pmConfig *config, // Configuration
    4956                                     const pmFPAview *view,
     57                                     const char *filerule,
    5058                                     pmReadout **chiReadout,
    51                                      char *filename,
    5259                                     int index)
    5360{
     
    5562
    5663    // find the currently selected readout
    57     pmFPAfile *input = pmFPAfileSelectSingle(config->files, filename, index); // File of interest
     64    pmFPAfile *input = pmFPAfileSelectSingle(config->files, filerule, index); // File of interest
    5865    psAssert (input, "missing file?");
    5966
     
    111118}
    112119
    113 bool psphotStackRemoveChisqFromInputs (pmConfig *config) {
     120bool psphotStackRemoveChisqFromInputs (pmConfig *config, const char *filerule) {
    114121
    115122    bool status = false;
     
    121128    psAssert (status, "programming error: must define PSPHOT.INPUT.NUM");
    122129
    123     pmFPAfileRemoveSingle (config->files, "PSPHOT.INPUT", chisqNum);
     130    pmFPAfileRemoveSingle (config->files, filerule, chisqNum);
    124131
    125132    inputNum --;
Note: See TracChangeset for help on using the changeset viewer.