IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Jun 27, 2008, 12:05:30 PM (18 years ago)
Author:
Paul Price
Message:

Instead of being dependent upon a single list of sources, want to be able to use all the available information. So One common failure mode in the MOPS processing was that the source list didn't cover the entire skycell, so convolutions didn't succeed. Now we get a source list for each input image and merge these. Still retains (or at least, supposed to) the old way of inputting a single source list on the command line.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/ppStack/src/ppStackLoop.c

    r18168 r18346  
    1717
    1818// Files required in preparation for convolution
    19 static char *prepareFiles[] = { "PPSTACK.INPUT.PSF", "PPSTACK.SOURCES", NULL };
     19static char *prepareFiles[] = { "PPSTACK.INPUT.PSF", "PPSTACK.INPUT.SOURCES", NULL };
    2020
    2121// Files required for the convolution
     
    213213    // Preparation iteration: Load the sources, and get a target PSF model
    214214    psTrace("ppStack", 1, "Determining target PSF....\n");
    215     pmReadout *sources = NULL;          // Readout with sources to use for PSF matching
     215    psArray *sources = NULL;            // Sources to use for PSF matching
    216216    pmPSF *targetPSF = NULL;            // Target PSF
     217    bool haveSources = psMetadataLookupBool(NULL, config->arguments, "HAVE.SOURCES"); // Global sources?
    217218    if (psMetadataLookupBool(NULL, config->arguments, "HAVE.PSF")) {
    218219        pmFPAfileActivate(config->files, false, NULL);
     
    223224        }
    224225
    225         // We want to hang on to the 'sources' even when its host FPA is blown away
    226         sources = psMemIncrRefCounter(pmFPAfileThisReadout(config->files, view, "PPSTACK.SOURCES"));
    227         if (!sources) {
    228             psError(PS_ERR_UNKNOWN, true, "Unable to find sources.");
    229             psFree(view);
    230             return false;
    231         }
    232 
    233226        // Generate list of PSFs
    234227        psMetadataIterator *fileIter = psMetadataIteratorAlloc(config->files, PS_LIST_HEAD,
     
    236229        psMetadataItem *fileItem; // Item from iteration
    237230        psArray *psfs = psArrayAlloc(num); // PSFs for PSF envelope
     231        psArray *sourceLists = NULL;    // Source lists for merging sources from multiple readouts
    238232        int numCols = 0, numRows = 0;   // Size of image
    239233        int index = 0;                  // Index for file
     
    247241                psFree(view);
    248242                psFree(sources);
     243                psFree(sourceLists);
    249244                psFree(fileIter);
    250245                psFree(psfs);
     
    263258                psFree(view);
    264259                psFree(sources);
     260                psFree(sourceLists);
    265261                psFree(fileIter);
    266262                psFree(psfs);
     
    270266                numCols = naxis1;
    271267                numRows = naxis2;
     268            }
     269
     270            if (!haveSources) {
     271                pmReadout *ro = pmFPAviewThisReadout(view, inputFile->fpa); // Readout with sources
     272                sourceLists = ppStackSourceListAdd(sourceLists, ro, config);
     273                if (!sourceLists) {
     274                    psError(PS_ERR_UNKNOWN, false, "Unable to add sources to list.");
     275                    psFree(view);
     276                    psFree(sources);
     277                    psFree(fileIter);
     278                    psFree(psfs);
     279                    return false;
     280                }
    272281            }
    273282        }
     
    281290            psFree(sources);
    282291            return false;
     292        }
     293
     294        if (haveSources) {
     295            // We want to hang on to the 'sources' even when its host FPA is blown away
     296            sources = psMemIncrRefCounter(pmFPAfileThisReadout(config->files, view, "PPSTACK.INPUT.SOURCES"));
     297            if (!sources) {
     298                psError(PS_ERR_UNKNOWN, true, "Unable to find sources.");
     299                psFree(view);
     300                return false;
     301            }
     302        } else {
     303            sources = ppStackSourceListCombine(sourceLists, config);
     304            psFree(sourceLists);
     305            if (!sources) {
     306                psError(PS_ERR_UNKNOWN, false, "Unable to add sources to list.");
     307                psFree(view);
     308                psFree(psfs);
     309                return false;
     310            }
    283311        }
    284312
Note: See TracChangeset for help on using the changeset viewer.