Changeset 21363 for trunk/psModules/src/imcombine/pmPSFEnvelope.c
- Timestamp:
- Feb 5, 2009, 4:31:25 PM (17 years ago)
- File:
-
- 1 edited
-
trunk/psModules/src/imcombine/pmPSFEnvelope.c (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psModules/src/imcombine/pmPSFEnvelope.c
r21183 r21363 36 36 #define PEAK_FLUX 1.0e4 // Peak flux for each source 37 37 #define SKY_VALUE 0.0e0 // Sky value for fake image 38 #define WEIGHT_VAL 3.0 // Weightingfor image39 #define WEIGHT_FACTOR 10.0 // Factor to multiply image by to get weighting38 #define VARIANCE_VAL 3.0 // Variance for image 39 #define VARIANCE_FACTOR 10.0 // Factor to multiply image by to get variance 40 40 #define PSF_STATS PS_STAT_SAMPLE_MEDIAN | PS_STAT_SAMPLE_STDEV // Statistics options for measuring PSF 41 41 #define SOURCE_FIT_ITERATIONS 100 // Number of iterations for source fitting … … 149 149 pmModel *model = pmModelFromPSFforXY(psf, x, y, PEAK_FLUX); // Model for source 150 150 psAssert (model, "failed to generate model: should this be an error or not?"); 151 float srcRadius = model->modelRadius(model->params, PS_SQR( WEIGHT_VAL)); // Radius for source151 float srcRadius = model->modelRadius(model->params, PS_SQR(VARIANCE_VAL)); // Radius for source 152 152 if (srcRadius > maxRadius) { 153 153 maxRadius = srcRadius; … … 216 216 psFree(envelope); 217 217 218 // XXX Setting the weightseems to be an art218 // XXX Setting the variance seems to be an art 219 219 // Can't set it too high so that pixels are rejected as insignificant 220 220 // Can't set it too low so that it's hard to get to the minimum 221 221 // Have also tried: 222 // *** readout->weight = (psImage*)psBinaryOp(NULL, readout->image, "*", readout->image); 223 // *** readout->weight = (psImage*)psBinaryOp(NULL, readout->image, "*", psScalarAlloc(WEIGHT_FACTOR, PS_TYPE_F32)); 224 readout->weight = (psImage*)psBinaryOp(NULL, readout->image, "+", psScalarAlloc(WEIGHT_VAL, PS_TYPE_F32)); 222 // *** readout->variance = (psImage*)psBinaryOp(NULL, readout->image, "*", readout->image); 223 // *** readout->variance = (psImage*)psBinaryOp(NULL, readout->image, "*", psScalarAlloc(VARIANCE_FACTOR, PS_TYPE_F32)); 224 readout->variance = (psImage*)psBinaryOp(NULL, readout->image, "+", 225 psScalarAlloc(VARIANCE_VAL, PS_TYPE_F32)); 225 226 readout->mask = psImageAlloc(numCols, numRows, PS_TYPE_IMAGE_MASK); 226 227 psImageInit(readout->mask, 0); … … 242 243 243 244 psFree(source->pixels); 244 psFree(source-> weight);245 psFree(source->variance); 245 246 psFree(source->maskView); 246 247 psFree(source->maskObj); 247 248 source->pixels = NULL; 248 source-> weight= NULL;249 source->variance = NULL; 249 250 source->maskView = NULL; 250 251 source->maskObj = NULL; … … 280 281 options->psfFieldYo = 0; 281 282 282 pmSourceFitModelInit(SOURCE_FIT_ITERATIONS, 0.01, WEIGHT_VAL, true);283 pmSourceFitModelInit(SOURCE_FIT_ITERATIONS, 0.01, VARIANCE_VAL, true); 283 284 284 285 pmPSFtry *try = pmPSFtryModel(fakes, modelName, options, 0, 0xff);
Note:
See TracChangeset
for help on using the changeset viewer.
