- Timestamp:
- Jul 29, 2010, 2:35:46 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branches/ipp-20100621/psModules/src/objects/pmSourceFitPCM.c
r28692 r28781 107 107 bool pmSourceModelGuessPCM (pmPCMdata *pcm, pmSource *source, psImageMaskType maskVal, psImageMaskType markVal) { 108 108 109 pcm->modelConv->modelGuess(pcm->modelConv, source); 109 if (!pcm->modelConv->modelGuess(pcm->modelConv, source)) { 110 return false; 111 } 112 return true; 110 113 111 114 // generate copy of the model … … 114 117 115 118 // XXX test : modify the Io, SXX, SYY terms based on the psf SXX, SYY terms: 119 // SXX,SYY in model parameters are sqrt(2) * shape.Sxx,Syy 116 120 psEllipseShape psfShape; 117 121 psfShape.sx = source->modelPSF->params->data.F32[PM_PAR_SXX] / M_SQRT2; 118 122 psfShape.sxy = source->modelPSF->params->data.F32[PM_PAR_SXY]; 119 123 psfShape.sy = source->modelPSF->params->data.F32[PM_PAR_SYY] / M_SQRT2; 124 120 125 psEllipseAxes psfAxes = psEllipseShapeToAxes (psfShape, 20.0); 126 if (!isfinite(psfAxes.major)) return false; 127 if (!isfinite(psfAxes.minor)) return false; 128 if (!isfinite(psfAxes.theta)) return false; 121 129 122 130 // XXX test : modify the Io, SXX, SYY terms based on the psf SXX, SYY terms: … … 125 133 extShape.sxy = pcm->modelConv->params->data.F32[PM_PAR_SXY]; 126 134 extShape.sy = pcm->modelConv->params->data.F32[PM_PAR_SYY] / M_SQRT2; 135 127 136 psEllipseAxes extAxes = psEllipseShapeToAxes (extShape, 20.0); 137 if (!isfinite(extAxes.major)) return false; 138 if (!isfinite(extAxes.minor)) return false; 139 if (!isfinite(extAxes.theta)) return false; 128 140 129 141 // decrease the initial guess ellipse by psf_minor axis: 130 142 psEllipseAxes extAxesMod; 131 extAxesMod.major = sqrt (PS_MAX ( 1.0, PS_SQR(extAxes.major) - PS_SQR(psfAxes.minor)));132 extAxesMod.minor = sqrt (PS_MAX ( 1.0, PS_SQR(extAxes.minor) - PS_SQR(psfAxes.minor)));143 extAxesMod.major = sqrt (PS_MAX (0.25, PS_SQR(extAxes.major) - PS_SQR(psfAxes.minor))); 144 extAxesMod.minor = sqrt (PS_MAX (0.25, PS_SQR(extAxes.minor) - PS_SQR(psfAxes.minor))); 133 145 extAxesMod.theta = extAxes.theta; 134 146 135 147 psEllipseShape extShapeMod = psEllipseAxesToShape (extAxesMod); 148 if (!isfinite(extShapeMod.sx)) return false; 149 if (!isfinite(extShapeMod.sy)) return false; 150 if (!isfinite(extShapeMod.sxy)) return false; 151 136 152 pcm->modelConv->params->data.F32[PM_PAR_SXX] = extShapeMod.sx * M_SQRT2; 137 153 pcm->modelConv->params->data.F32[PM_PAR_SXY] = extShapeMod.sxy;
Note:
See TracChangeset
for help on using the changeset viewer.
