IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 14520


Ignore:
Timestamp:
Aug 15, 2007, 4:18:51 PM (19 years ago)
Author:
Paul Price
Message:

Ensuring seeing, weighting, scale are set to reasonable values.

Location:
trunk/ppStack/src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/ppStack/src/ppStackCamera.c

    r14404 r14520  
    4040        psString weight = psMetadataLookupStr(&mdok, input, "WEIGHT"); // Name of weight map
    4141
    42         float seeing = psMetadataLookupF32(NULL, input, "SEEING"); // Seeing FWHM
    43         if (isnan(seeing)) {
     42        float seeing = psMetadataLookupF32(&mdok, input, "SEEING"); // Seeing FWHM
     43        if (!mdok || isnan(seeing) || seeing == 0.0) {
    4444            psError(PS_ERR_BAD_PARAMETER_VALUE, true, "Component %s lacks SEEING of type F32", item->name);
    4545            psFree(iter);
     
    4747        }
    4848
    49         float weighting = psMetadataLookupF32(NULL, input, "WEIGHTING"); // Relative weighting
    50         if (isnan(weighting)) {
     49        float weighting = psMetadataLookupF32(&mdok, input, "WEIGHTING"); // Relative weighting
     50        if (!mdok || isnan(weighting) || weighting == 0.0) {
    5151            psError(PS_ERR_BAD_PARAMETER_VALUE, true, "Component %s lacks WEIGHTING of type F32", item->name);
    5252            psFree(iter);
     
    5454        }
    5555
    56         float scale = psMetadataLookupF32(NULL, input, "SCALE"); // Relative scale
    57         if (isnan(scale)) {
     56        float scale = psMetadataLookupF32(&mdok, input, "SCALE"); // Relative scale
     57        if (!mdok || isnan(scale) || scale == 0.0) {
    5858            psError(PS_ERR_BAD_PARAMETER_VALUE, true, "Component %s lacks SCALE of type F32", item->name);
    5959            psFree(iter);
  • trunk/ppStack/src/ppStackReadout.c

    r14470 r14520  
    5252        psListAdd(cellList, PS_LIST_TAIL, ro->parent);
    5353
    54         float seeing = psMetadataLookupF32(NULL, inputFile->fpa->analysis, "PPSTACK.SEEING"); // Seeing FWHM
    55         float weighting = psMetadataLookupF32(NULL, inputFile->fpa->analysis,
     54        bool mdok;                      // Status of MD lookup
     55        float seeing = psMetadataLookupF32(&mdok, inputFile->fpa->analysis, "PPSTACK.SEEING"); // Seeing FWHM
     56        if (!mdok || !isfinite(seeing)) {
     57            psWarning("No SEEING supplied for image %d --- set to unity.", fileNum);
     58            seeing = 1.0;
     59        }
     60        float weighting = psMetadataLookupF32(&mdok, inputFile->fpa->analysis,
    5661                                              "PPSTACK.WEIGHTING"); // Relative weighting
    57         float scale = psMetadataLookupF32(NULL, inputFile->fpa->analysis, "PPSTACK.SCALE"); // Rel. scale
     62        if (!mdok || !isfinite(weighting)) {
     63            psWarning("No WEIGHTING supplied for image %d --- set to unity.", fileNum);
     64            weighting = 1.0;
     65        }
     66        float scale = psMetadataLookupF32(&mdok, inputFile->fpa->analysis, "PPSTACK.SCALE"); // Rel. scale
     67        if (!mdok || !isfinite(scale)) {
     68            psWarning("No SCALE supplied for image %d --- set to unity.", fileNum);
     69            scale = 1.0;
     70        }
    5871
    5972        // Brain-dead background subtraction
     
    6982            return false;
    7083        }
     84        psTrace("ppStack", 3, "Background for image %d is %f\n", fileNum, stats->robustMedian);
    7185        (void)psBinaryOp(ro->image, ro->image, "-", psScalarAlloc(stats->robustMedian, PS_TYPE_F32));
    7286
Note: See TracChangeset for help on using the changeset viewer.