IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Sep 15, 2005, 12:12:26 PM (21 years ago)
Author:
eugene
Message:

moved ApResid, etc into pmPSF from pmPSFtry

File:
1 edited

Legend:

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

    r5048 r5058  
    1212
    1313    // array to store candidate PSF stars
     14    int NSTARS = psMetadataLookupS32 (&status, config, "PSF_MAX_NSTARS");
     15    if (!status) NSTARS = sources->n;
    1416    stars = psArrayAlloc (sources->n);
    1517    stars->n = 0;
    1618
    1719    // select the candidate PSF stars (pointers to original sources)
    18     for (int i = 0; i < sources->n; i++) {
     20    for (int i = 0; (i < sources->n) && (stars->n < NSTARS); i++) {
    1921        pmSource *source = sources->data[i];
    2022        if (source->type != PM_SOURCE_PSFSTAR) continue;
     
    5557    try = models->data[0];
    5658    int bestN = 0;
    57     float bestM = try->dApResid;
     59    float bestM = try->psf->dApResid;
    5860    for (int i = 1; i < models->n; i++) {
    5961        try = models->data[i];
    60         float M = try->dApResid;
     62        float M = try->psf->dApResid;
    6163        if (M < bestM) {
    6264            bestM = M;
     
    6769    // keep only the selected model:
    6870    try = models->data[bestN];
    69     modelName = pmModelGetType (try->modelType);
    70     psLogMsg ("psphot.pspsf", 3, "selected psf model %s, ApResid: %f +/- %f\n", modelName, try->ApResid, try->dApResid);
     71    pmPSF *psf = psMemCopy(try->psf);
     72    psFree (models);                             // keep only the pmPSF resulting from this analysis
    7173
    72     // keep only the pmPSF resulting from this analysis
    73     pmPSF *psf = psMemCopy(try->psf);
    74     psFree (models);
     74    modelName = pmModelGetType (psf->type);
     75    psLogMsg ("psphot.pspsf", 3, "selected psf model %s, ApResid: %f +/- %f\n", modelName, psf->ApResid, psf->dApResid);
     76
    7577    return (psf);
    7678}
Note: See TracChangeset for help on using the changeset viewer.