IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Aug 25, 2008, 3:15:48 PM (18 years ago)
Author:
Paul Price
Message:

Don't blindly use all input sources as stamps.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/psModules/src/imcombine/pmSubtractionStamps.c

    r19164 r19201  
    2424
    2525#define STAMP_LIST_BUFFER 20            // Number of stamps to add to list at a time
     26
     27#define SOURCE_MASK (PM_SOURCE_MODE_CR_LIMIT | PM_SOURCE_MODE_SATURATED | PM_SOURCE_MODE_DEFECT | \
     28                     PM_SOURCE_MODE_SATSTAR | PM_SOURCE_MODE_FAIL) // Mask for bad sources
    2629
    2730//////////////////////////////////////////////////////////////////////////////////////////////////////////////
     
    582585    // Let pmSubtractionStampsSet take care of the rest of the assertions
    583586
    584     int numSources = sources->n;          // Number of stars
    585 
    586     psVector *x = psVectorAlloc(numSources, PS_TYPE_F32); // x coordinates
    587     psVector *y = psVectorAlloc(numSources, PS_TYPE_F32); // y coordinates
    588     psVector *flux = psVectorAlloc(numSources, PS_TYPE_F32); // Fluxes
    589 
     587    int numIn = sources->n;             // Number of sources in input list
     588
     589    psVector *x = psVectorAlloc(numIn, PS_TYPE_F32); // x coordinates
     590    psVector *y = psVectorAlloc(numIn, PS_TYPE_F32); // y coordinates
     591    psVector *flux = psVectorAlloc(numIn, PS_TYPE_F32); // Fluxes
     592
     593    int numOut = 0;                     // Number of sources in output list
    590594    for (int i = 0; i < numSources; i++) {
    591595        pmSource *source = sources->data[i]; // Source of interest
     596        if (source->mode & SOURCE_MASK) {
     597            continue;
     598        }
    592599        if (source->modelPSF) {
    593             x->data.F32[i] = source->modelPSF->params->data.F32[PM_PAR_XPOS];
    594             y->data.F32[i] = source->modelPSF->params->data.F32[PM_PAR_YPOS];
     600            x->data.F32[numOut] = source->modelPSF->params->data.F32[PM_PAR_XPOS];
     601            y->data.F32[numOut] = source->modelPSF->params->data.F32[PM_PAR_YPOS];
    595602        } else {
    596             x->data.F32[i] = source->peak->xf;
    597             y->data.F32[i] = source->peak->yf;
    598         }
    599         flux->data.F32[i] = powf(10.0, -0.4 * source->psfMag);
     603            x->data.F32[numOut] = source->peak->xf;
     604            y->data.F32[numOut] = source->peak->yf;
     605        }
     606        flux->data.F32[numOut] = powf(10.0, -0.4 * source->psfMag);
     607        numOut++;
    600608    }
    601609
Note: See TracChangeset for help on using the changeset viewer.