IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Aug 17, 2007, 11:27:05 AM (19 years ago)
Author:
eugene
Message:

changed APIs pmIsFooBar to pmFooBarTest

changed pmModelGroup to pmModelClass (and rationalized some names)

using pmModelPSFforXY for clearer code

using new pmModel member functions for limits, etc

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/eam_branch_20070817/psphot/src/psphotChoosePSF.c

    r13900 r14545  
    295295    }
    296296
    297     char *modelName = pmModelGetType (psf->type);
     297    char *modelName = pmModelClassGetName (psf->type);
    298298    psLogMsg ("psphot.pspsf", PS_LOG_INFO, "select psf model: %f sec\n", psTimerMark ("psphot"));
    299299    psLogMsg ("psphot.pspsf", PS_LOG_INFO, "psf model %s, ApResid: %f +/- %f\n", modelName, psf->ApResid, psf->dApResid);
     
    315315    PS_ASSERT_PTR_NON_NULL(image, false);
    316316
    317     pmModel *modelEXT = pmModelAlloc (psf->type);
    318     PS_ASSERT_PTR_NON_NULL(modelEXT, false);
    319 
    320     // make a model with unit central intensity at the image center
    321     modelEXT->params->data.F32[PM_PAR_SKY] = 0;
    322     modelEXT->params->data.F32[PM_PAR_I0] = 1;
    323     modelEXT->params->data.F32[PM_PAR_XPOS] = 0.5*image->numCols;
    324     modelEXT->params->data.F32[PM_PAR_YPOS] = 0.5*image->numRows;
    325 
    326     // construct a PSF model at this coordinate
    327     pmModel *modelPSF = pmModelFromPSF (modelEXT, psf);
     317    // construct a normalized PSF model at this coordinate (Io = 1.0)
     318    pmModel *modelPSF = pmModelFromPSFforXY (psf, 0.5*image->numCols, 0.5*image->numRows, 1.0);
    328319    if (modelPSF == NULL) {
    329320        psError(PSPHOT_ERR_PSF, false, "Failed to estimate PSF model at image centre");
    330         psFree(modelEXT);
    331321        return false;
    332322    }
    333323
    334     // get the correct model-radius function
    335     pmModelRadius modelRadiusFunc = pmModelRadius_GetFunction (psf->type);
    336 
    337324    // get the model full-width at half-max
    338     psF64 FWHM_X = 2*modelRadiusFunc (modelPSF->params, 0.5);
     325    psF64 FWHM_X = 2*modelPSF->modelRadius (modelPSF->params, 0.5);
    339326
    340327    // XXX make sure this is consistent with the re-definition of PM_PAR_SXX
     
    351338    psMetadataAddS32 (recipe, PS_LIST_TAIL, "NPSFSTAR", PS_META_REPLACE, "Number of stars used to make PSF", psf->nPSFstars);
    352339    psMetadataAddBool(recipe, PS_LIST_TAIL, "PSFMODEL", PS_META_REPLACE, "Valid PSF Model?", true);
    353 
    354     psFree (modelEXT);
    355340    psFree (modelPSF);
    356341
Note: See TracChangeset for help on using the changeset viewer.