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/pmPSFtry.c

    r4977 r5058  
    3131pmPSFtry *pmPSFtryAlloc (psArray *sources, char *modelName) {
    3232
     33    pmModelType type;
     34
    3335    pmPSFtry *test = (pmPSFtry *) psAlloc(sizeof(pmPSFtry));
    3436
    3537    // XXX probably need to increment ref counter
    36     test->modelType   = pmModelSetType (modelName);
    37     test->psf         = pmPSFAlloc (test->modelType);
    38     test->sources     = psMemCopy(sources);
    39     test->modelFLT    = psArrayAlloc (sources->n);
    40     test->modelPSF    = psArrayAlloc (sources->n);
    41     test->metric      = psVectorAlloc (sources->n, PS_TYPE_F64);
    42     test->fitMag      = psVectorAlloc (sources->n, PS_TYPE_F64);
    43     test->mask        = psVectorAlloc (sources->n, PS_TYPE_U8);
    44     test->ApResid     = 0;
    45     test->dApResid    = 0;
    46     test->skyBias     = 0;
     38    type           = pmModelSetType (modelName);
     39    test->psf      = pmPSFAlloc (type);
     40    test->sources  = psMemCopy(sources);
     41    test->modelFLT = psArrayAlloc (sources->n);
     42    test->modelPSF = psArrayAlloc (sources->n);
     43    test->metric   = psVectorAlloc (sources->n, PS_TYPE_F64);
     44    test->fitMag   = psVectorAlloc (sources->n, PS_TYPE_F64);
     45    test->mask     = psVectorAlloc (sources->n, PS_TYPE_U8);
    4746
    4847    for (int i = 0; i < test->modelFLT->n; i++) {
     
    8483
    8584        pmSource *source = try->sources->data[i];
    86         pmModel  *model  = pmSourceModelGuess (source, try->modelType);
     85        pmModel  *model  = pmSourceModelGuess (source, try->psf->type);
    8786        x = source->peak->x;
    8887        y = source->peak->y;
     
    164163    pmPSFtryMetric (try, RADIUS);
    165164    psLogMsg ("psphot.pspsf", 3, "try model %s, ap-fit: %f +/- %f, sky bias: %f\n",
    166               modelName, try->ApResid, try->dApResid, try->skyBias);
     165              modelName, try->psf->ApResid, try->psf->dApResid, try->psf->skyBias);
    167166
    168167    return (try);
     
    279278  stats = psVectorStats (stats, daResid, NULL, maskB, 1);
    280279
    281   try->ApResid = poly->coeff[0];
    282   try->dApResid = stats->clippedStdev;
    283   try->skyBias = poly->coeff[1] / (M_PI * PS_SQR(RADIUS));
     280  try->psf->ApResid = poly->coeff[0];
     281  try->psf->dApResid = stats->clippedStdev;
     282  try->psf->skyBias = poly->coeff[1] / (M_PI * PS_SQR(RADIUS));
    284283
    285284  psFree (rflux);
Note: See TracChangeset for help on using the changeset viewer.