IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 21249


Ignore:
Timestamp:
Feb 1, 2009, 11:47:31 AM (17 years ago)
Author:
eugene
Message:

modify psphotReadoutFindPSF to use supplied sources

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/psphot/src/psphotReadoutFindPSF.c

    r21177 r21249  
    33// in this psphotReadout-variant, we are only trying to determine the PSF given an existing set
    44// of input source positions to use as initial PSF stars.
    5 bool psphotReadoutFindPSF(pmConfig *config, const pmFPAview *view) {
     5bool psphotReadoutFindPSF(pmConfig *config, const pmFPAview *view, psArray *inSources) {
    66
    7     // measure the total elapsed time in psphotReadout.  XXX the current threading plan
    8     // for psphot envisions threading within psphotReadout, not multiple threads calling
    9     // the same psphotReadout.  In the current plan, this dtime is the elapsed time used
    10     // jointly by the multiple threads, not the total time used by all threads.
    117    psTimerStart ("psphotReadout");
    128
     
    2824    psphotVisualShowImage (readout);
    2925
    30     // include externally-supplied sources
    31     // XXX this requires sources to be supplied as PSPHOT.INPUT.CMF
    32     pmDetections *detections = psphotLoadPSFSources (config, view);
     26    // Note that in this implementation, we do NOT model the background and we do not
     27    // attempt to detect the sources in the image
     28
     29    // include externally-supplied sources (supplied as PSPHOT.INPUT.CMF)
     30    pmDetections *detections = psphotDetectionsFromSources (config, inSources);
    3331    if (!detections || !detections->peaks) {
    3432        psError(PSPHOT_ERR_ARGUMENTS, true, "Can't find PSF stars");
     
    4038    if (!sources) return false;
    4139
    42     // mark all sources as PSFSTAR
     40    // peak flux is wrong : set based on previous image
     41    // use the peak measured in the moments analysis:
    4342    for (int i = 0; i < sources->n; i++) {
    4443      pmSource *source = sources->data[i];
    45       source->type = PM_SOURCE_TYPE_STAR;
    46       source->mode |= PM_SOURCE_MODE_PSFSTAR;
     44      source->peak->flux = source->moments->Peak;
     45    }
    4746
    48       // peak flux is wrong : set based on previous image
    49       // use the peak measured in the moments analysis:
    50       source->peak->flux = source->moments->Peak;
     47    // classify sources based on moments, brightness (psf is not known)
     48    if (!psphotRoughClass (readout, sources, recipe, false)) {
     49        psLogMsg ("psphot", 3, "failed to find a valid PSF clump for image");
     50        return psphotReadoutCleanup (config, readout, recipe, detections, NULL, sources);
    5151    }
    5252
Note: See TracChangeset for help on using the changeset viewer.