IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Sep 5, 2012, 4:04:34 PM (14 years ago)
Author:
eugene
Message:

merge changes from trunk

Location:
branches/eam_branches/ipp-20120805/psphot
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • branches/eam_branches/ipp-20120805/psphot

  • branches/eam_branches/ipp-20120805/psphot/src

  • branches/eam_branches/ipp-20120805/psphot/src/psphotStackMatchPSFsNext.c

    r34136 r34399  
    8181    psImageMaskType maskVal = psMetadataLookupImageMask(&status, recipe, "MASK.PSPHOT"); // Mask value for bad pixels
    8282    psAssert (maskVal, "missing mask value?");
     83    psImageMaskType maskSat = psMetadataLookupImageMask(&status, recipe, "MASK.SAT"); // Mask value for bad pixels
     84    psAssert (maskSat, "missing mask value?");
     85
    8386
    8487    float minGauss = psMetadataLookupF32(NULL, recipe, "PEAKS_MIN_GAUSS"); // Minimum valid fraction of kernel
     
    123126    psImageSmoothMask_Threaded(readout->variance, readout->variance, readout->mask, maskVal, SIGMA_SMTH * M_SQRT1_2, NSIGMA_SMTH, minGauss);
    124127    psLogMsg("psphot", PS_LOG_MINUTIA, "smooth variance: %f sec\n", psTimerMark("psphot.smooth"));
     128
     129    // Insure that invalid pixels are masked
     130    // XXX: the smoothing seems to generate nan pixels in the variance image
     131    // XXX: We may need to loop over the cached sources and redefine the maskObj images...
     132    pmReadoutMaskInvalid(readout, maskVal, maskSat);
     133    {
     134        // Now go rebuild the sources' copies of the mask
     135        pmDetections *detections = psMetadataLookupPtr (&status, readout->analysis, "PSPHOT.DETECTIONS");
     136        psAssert (detections, "missing detections?");
     137
     138        psArray *sources = detections->allSources;
     139
     140        if (sources && sources->n) {
     141            for (int i = 0 ; i < sources->n; i++) {
     142                // XXX: move this to a function in pmSource.c
     143                pmSource *source = sources->data[i];
     144                if (source->maskObj && source->maskView) {
     145                    psFree(source->maskObj);
     146                    source->maskObj = psImageCopy (source->maskObj, source->maskView, PS_TYPE_IMAGE_MASK);
     147                }
     148            }
     149        }
     150    }
    125151
    126152    psLogMsg("psphot", PS_LOG_INFO, "smoothed");
Note: See TracChangeset for help on using the changeset viewer.