Changeset 23961
- Timestamp:
- Apr 23, 2009, 6:12:44 PM (17 years ago)
- File:
-
- 1 edited
-
trunk/psModules/src/imcombine/pmPSFEnvelope.c (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psModules/src/imcombine/pmPSFEnvelope.c
r23960 r23961 114 114 psImageInit(envelope, SKY_VALUE); 115 115 pmReadout *fakeRO = pmReadoutAlloc(NULL); // Fake readout 116 float maxRadius = 0.0; // Maximum radius for sources 116 117 psVector *numbers = psVectorAlloc(numFakes, PS_TYPE_S32); // Number of detections for each source 117 118 psVectorInit(numbers, 0); … … 156 157 psFree(subEnv); 157 158 159 // Get the radius 160 pmModel *model = pmModelFromPSFforXY(psf, x, y, PEAK_FLUX); // Model for source 161 if (!model || (model->flags & MODEL_MASK)) { 162 continue; 163 } 164 float srcRadius = model->modelRadius(model->params, PS_SQR(VARIANCE_VAL)); // Radius for source 165 if (srcRadius == 0) { 166 continue; 167 } 168 if (srcRadius > maxRadius) { 169 maxRadius = srcRadius; 170 } 171 158 172 // If we got this far, the source is decent 159 173 numbers->data.S32[j]++; … … 229 243 numFakes = fakes->n; 230 244 245 if (numFakes == 0.0) { 246 psError(PS_ERR_UNKNOWN, false, "No fake sources are suitable for PSF fitting."); 247 psFree(fakes); 248 psFree(readout); 249 return false; 250 } 251 231 252 // XXX Setting the variance seems to be an art 232 253 // Can't set it too high so that pixels are rejected as insignificant … … 239 260 readout->mask = psImageAlloc(numCols, numRows, PS_TYPE_IMAGE_MASK); 240 261 psImageInit(readout->mask, 0); 262 263 if (maxRadius > radius) { 264 maxRadius = radius; 265 } 241 266 242 267 #ifdef TESTING
Note:
See TracChangeset
for help on using the changeset viewer.
