IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Aug 23, 2007, 2:40:16 PM (19 years ago)
Author:
eugene
Message:

* updates from branch eam_branch_20070817

  • changed pmIsFoo to pmFooTest
  • changed pmModelGroup to pmModelClass
  • added offsets to pmSourceOp
  • changed pmModel.params_NEW to pmModel.params
  • use new APIs to define a pmModel from a pmPSF at X,Y (pmModelFromPSFforXY)
  • use pmModel member functions instead of _GetFunction functions
  • added modelParamsFromPSF for STRAIL and TEST1
  • move output psf model from readout->analysis to chip->analysis
File:
1 edited

Legend:

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

    r13900 r14655  
    127127    // print/dump psf parameters
    128128    if (psTraceGetLevel("psphot") >= 5) {
    129         for (int i = PM_PAR_SXX; i < try->psf->params_NEW->n; i++) {
    130             psPolynomial2D *poly = try->psf->params_NEW->data[i];
     129        for (int i = PM_PAR_SXX; i < try->psf->params->n; i++) {
     130            psPolynomial2D *poly = try->psf->params->data[i];
    131131            for (int nx = 0; nx <= poly->nX; nx++) {
    132132                for (int ny = 0; ny <= poly->nY; ny++) {
     
    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.