IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Jun 19, 2007, 4:40:44 PM (19 years ago)
Author:
Paul Price
Message:

Extensive changes to APIs to allow use of a nominated value to mask
against (the maskVal). Previously, the mask values were either
hard-coded (e.g., PM_MASK_SAT) or taken as anything non-zero. The
code is tested with psModules (which has similar changes) and does not
crash, but neither is it successful in marking all bad pixels. For
this reason, I have left the "gutter" pixels (cell gaps) set to 0
instead of NAN in pmFPAMosaic.

File:
1 edited

Legend:

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

    r13569 r13900  
    1717
    1818// construct an initial PSF model for each object
    19 bool psphotGuessModels (pmReadout *readout, psArray *sources, psMetadata *recipe, pmPSF *psf) {
     19bool psphotGuessModels (pmReadout *readout, psArray *sources, psMetadata *recipe, pmPSF *psf, psMaskType maskVal) {
    2020
    2121  psTimerStart ("psphot");
     
    5757    pmModel *modelPSF = pmModelFromPSF (modelEXT, psf);
    5858    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         }
     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        }
    7474
    75         source->mode |= PM_SOURCE_MODE_BADPSF;
     75        source->mode |= PM_SOURCE_MODE_BADPSF;
    7676    }
    7777    psFree (modelEXT);
     
    8585    source->modelPSF->residuals = psf->residuals;
    8686
    87     pmSourceCacheModel (source);
     87    pmSourceCacheModel (source, maskVal);
    8888  }
    8989  psLogMsg ("psphot.models", 4, "built models for %ld objects: %f sec\n", sources->n, psTimerMark ("psphot"));
Note: See TracChangeset for help on using the changeset viewer.