IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 13569


Ignore:
Timestamp:
May 31, 2007, 2:47:33 AM (19 years ago)
Author:
rhl
Message:

If PSF reconstruction fails, try the centre of the image

File:
1 edited

Legend:

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

    r13343 r13569  
    5656    // set PSF parameters for this model (apply 2D shape model)
    5757    pmModel *modelPSF = pmModelFromPSF (modelEXT, psf);
     58    if (modelPSF == NULL) {
     59        psError(PSPHOT_ERR_PSF, false,
     60                "Failed to determine PSF model at r,c = (%d,%d); trying centre of image",
     61                source->peak->y, source->peak->x);
     62        //
     63        // Try the centre of the image
     64        //
     65        modelEXT->params->data.F32[PM_PAR_XPOS] = 0.5*readout->image->numCols;
     66        modelEXT->params->data.F32[PM_PAR_YPOS] = 0.5*readout->image->numRows;
     67        modelPSF = pmModelFromPSF (modelEXT, psf);
     68        if (modelPSF == NULL) {
     69            psError(PSPHOT_ERR_PSF, false,
     70                    "Failed to determine PSF model at centre of image");
     71            psFree(modelEXT);
     72            return false;
     73        }
     74
     75        source->mode |= PM_SOURCE_MODE_BADPSF;
     76    }
    5877    psFree (modelEXT);
    5978
Note: See TracChangeset for help on using the changeset viewer.