IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Nov 20, 2007, 9:12:05 PM (18 years ago)
Author:
eugene
Message:

add min/max mag message

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/psastro/src/psastroConvert.c

    r15636 r15667  
    5555    float iMagMin = psMetadataLookupF32 (&status, recipe, "PSASTRO.MIN.INST.MAG.RAW");
    5656
     57
    5758    // choose the first nMax sources
    5859    int j = 0;
    5960    psArray *rawStars = psArrayAlloc (PS_MIN (nMax, inStars->n));
     61
     62    float mMin = +100.0;
     63    float mMax = -100.0;
     64
    6065    for (int i = 0; (i < inStars->n) && (j < rawStars->n); i++) {
    6166        int n = index->data.S32[i];
     
    6469        if ((iMagMax != 0.0) && (source->psfMag > iMagMax)) continue;
    6570        if ((iMagMin != 0.0) && (source->psfMag < iMagMin)) continue;
     71        if (!isfinite(source->psfMag)) continue;
     72        mMin = PS_MIN (mMin, source->psfMag);
     73        mMax = PS_MAX (mMax, source->psfMag);
    6674        rawStars->data[j] = psMemIncrRefCounter (inStars->data[n]);
    6775        j++;
     
    7078
    7179    psMetadataAdd (readout->analysis, PS_LIST_TAIL, "PSASTRO.RAWSTARS", PS_DATA_ARRAY, "astrometry objects", rawStars);
    72     psLogMsg ("psastro", 4, "loaded %ld sources, using %ld of %ld good sources\n", sources->n, rawStars->n, inStars->n);
     80    psLogMsg ("psastro", 4, "loaded %ld sources, using %ld of %ld good sources (inst mag: %f to %f)\n", sources->n, rawStars->n, inStars->n, mMin, mMax);
    7381
    7482    psFree (index);
Note: See TracChangeset for help on using the changeset viewer.