IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Feb 5, 2009, 4:31:25 PM (17 years ago)
Author:
Paul Price
Message:

Merging pap_branch_20090128. Resolved a small number of conflicts. Compiles, but not tested in detail.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/psModules/src/imcombine/pmPSFEnvelope.c

    r21183 r21363  
    3636#define PEAK_FLUX 1.0e4                 // Peak flux for each source
    3737#define SKY_VALUE 0.0e0                 // Sky value for fake image
    38 #define WEIGHT_VAL 3.0                  // Weighting for image
    39 #define WEIGHT_FACTOR 10.0              // Factor to multiply image by to get weighting
     38#define VARIANCE_VAL 3.0                // Variance for image
     39#define VARIANCE_FACTOR 10.0            // Factor to multiply image by to get variance
    4040#define PSF_STATS PS_STAT_SAMPLE_MEDIAN | PS_STAT_SAMPLE_STDEV // Statistics options for measuring PSF
    4141#define SOURCE_FIT_ITERATIONS 100       // Number of iterations for source fitting
     
    149149            pmModel *model = pmModelFromPSFforXY(psf, x, y, PEAK_FLUX); // Model for source
    150150            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 source
     151            float srcRadius = model->modelRadius(model->params, PS_SQR(VARIANCE_VAL)); // Radius for source
    152152            if (srcRadius > maxRadius) {
    153153                maxRadius = srcRadius;
     
    216216    psFree(envelope);
    217217
    218     // XXX Setting the weight seems to be an art
     218    // XXX Setting the variance seems to be an art
    219219    // Can't set it too high so that pixels are rejected as insignificant
    220220    // Can't set it too low so that it's hard to get to the minimum
    221221    // 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));
    225226    readout->mask = psImageAlloc(numCols, numRows, PS_TYPE_IMAGE_MASK);
    226227    psImageInit(readout->mask, 0);
     
    242243
    243244        psFree(source->pixels);
    244         psFree(source->weight);
     245        psFree(source->variance);
    245246        psFree(source->maskView);
    246247        psFree(source->maskObj);
    247248        source->pixels = NULL;
    248         source->weight = NULL;
     249        source->variance = NULL;
    249250        source->maskView = NULL;
    250251        source->maskObj = NULL;
     
    280281    options->psfFieldYo = 0;
    281282
    282     pmSourceFitModelInit(SOURCE_FIT_ITERATIONS, 0.01, WEIGHT_VAL, true);
     283    pmSourceFitModelInit(SOURCE_FIT_ITERATIONS, 0.01, VARIANCE_VAL, true);
    283284
    284285    pmPSFtry *try = pmPSFtryModel(fakes, modelName, options, 0, 0xff);
Note: See TracChangeset for help on using the changeset viewer.