IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 15197


Ignore:
Timestamp:
Oct 3, 2007, 4:31:08 PM (19 years ago)
Author:
eugene
Message:

added PSASTRO.MAX.NREF

File:
1 edited

Legend:

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

    r13164 r15197  
    2929    pmFPAview *view = pmFPAviewAlloc (0);
    3030    pmFPA *fpa = input->fpa;
     31
     32    // sort by mag
     33    psVector *index = psArraySortIndex (NULL, refs, psastroSortByMag);
     34
     35    int nMax = psMetadataLookupS32 (&status, recipe, "PSASTRO.MAX.NREF");
    3136
    3237    // this loop selects the matched stars for all chips
     
    6166                // project the reference objects to this chip
    6267                for (int i = 0; i < refs->n; i++) {
    63                     pmAstromObj *ref = pmAstromObjCopy(refs->data[i]);
     68                    pmAstromObj *ref = pmAstromObjCopy(refs->data[index->data.S32[i]]);
    6469
    6570                    psProject (ref->TP, ref->sky, fpa->toSky);
     
    7681                skip:
    7782                    psFree (ref);
     83
     84                    if (nMax && (refstars->n >= nMax)) break;
    7885                }
    7986                psTrace ("psastro", 4, "Added %ld refstars\n", refstars->n);
     
    93100    }
    94101
     102    psFree (index);
    95103    psFree (view);
    96104    return true;
Note: See TracChangeset for help on using the changeset viewer.