IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Jun 13, 2007, 2:00:08 PM (19 years ago)
Author:
eugene
Message:

replaced pmModel.status with pmModel.flags; using bit values instead of ints; names are now of the form PM_MODEL_STATUS_XXX; no error on limit saturation for model parameters

File:
1 edited

Legend:

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

    r13516 r13804  
    55
    66    bool            status;
    7     char           *modelName;
    8     pmPSF          *psf = NULL;
    9     pmPSFtry       *try = NULL;
    10     psArray        *stars = NULL;
    117
    128    psTimerStart ("psphot");
     
    5147    }
    5248
    53     stars = psArrayAllocEmpty (sources->n);
     49    psArray *stars = psArrayAllocEmpty (sources->n);
    5450
    5551    // select the candidate PSF stars (pointers to original sources)
     
    9288    for (int i = 0; i < models->n; i++) {
    9389        psMetadataItem *item = psListGetAndIncrement (iter);
    94         modelName = item->data.V;
     90        char *modelName = item->data.V;
    9591        models->data[i] = pmPSFtryModel (stars, modelName, RADIUS, POISSON_ERRORS, psfTrendMask, PSF_PARAM_WEIGHTS);
    9692    }
     
    106102    float bestM = 0.0;
    107103    for (int i = 0; i < models->n; i++) {
    108         try = models->data[i];
     104        pmPSFtry *try = models->data[i];
    109105        if (try == NULL) {
    110106            psError(PSPHOT_ERR_PSF, false, "PSF model %d is NULL", i);
     
    125121    }
    126122
    127     try = models->data[bestN];
     123    pmPSFtry *try = models->data[bestN];
     124
     125    // print/dump psf parameters
     126    if (psTraceGetLevel("psphot") >= 5) {
     127        for (int i = PM_PAR_SXX; i < try->psf->params_NEW->n; i++) {
     128            psPolynomial2D *poly = try->psf->params_NEW->data[i];
     129            for (int nx = 0; nx <= poly->nX; nx++) {
     130                for (int ny = 0; ny <= poly->nY; ny++) {
     131                    if (poly->mask[nx][ny]) continue;
     132                    fprintf (stderr, "%g x^%d y^%d\n", poly->coeff[nx][ny], nx, ny);
     133                }
     134            }
     135        }
     136    }
    128137
    129138    // measure and save the median value of dparams[PM_PAR_SXX],dparams[PM_PAR_SYY]
     
    275284    // XXX we are not saving the fitted sources
    276285    // XXX do we want to keep them so we may optionally write them out?
    277     psf = psMemIncrRefCounter(try->psf);
     286    pmPSF *psf = psMemIncrRefCounter(try->psf);
    278287    psFree (models);
    279288
     
    284293    }
    285294
    286     modelName = pmModelGetType (psf->type);
     295    char *modelName = pmModelGetType (psf->type);
    287296    psLogMsg ("psphot.pspsf", PS_LOG_INFO, "select psf model: %f sec\n", psTimerMark ("psphot"));
    288297    psLogMsg ("psphot.pspsf", PS_LOG_INFO, "psf model %s, ApResid: %f +/- %f\n", modelName, psf->ApResid, psf->dApResid);
Note: See TracChangeset for help on using the changeset viewer.