IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 20463


Ignore:
Timestamp:
Oct 29, 2008, 10:46:15 AM (18 years ago)
Author:
eugene
Message:

using threaded version of psImageSmoothMask

File:
1 edited

Legend:

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

    r20453 r20463  
    1212    // smooth the image and weight map
    1313    psTimerStart ("psphot.smooth");
     14    psImageConvolveSetThreads(true);
    1415
    1516    // XXX we can a) choose fft to convolve if needed and b) multithread fftw
     
    4445    // smooth the image, applying the mask as we go
    4546    psImage *smooth_im = psImageCopy(NULL, readout->image, PS_TYPE_F32);
    46     psImageSmoothMask(smooth_im, smooth_im, readout->mask, maskVal, SIGMA_SMTH, NSIGMA_SMTH, minGauss);
     47    psImageSmoothMask_Threaded(smooth_im, smooth_im, readout->mask, maskVal, SIGMA_SMTH, NSIGMA_SMTH, minGauss);
    4748    psLogMsg("psphot", PS_LOG_MINUTIA, "smooth image: %f sec\n", psTimerMark("psphot.smooth"));
    4849
     
    5556    // effective per-pixel variance is maintained.
    5657    psImage *smooth_wt = psImageCopy(NULL, readout->weight, PS_TYPE_F32);
    57     psImageSmoothMask(smooth_wt, smooth_wt, readout->mask, maskVal, SIGMA_SMTH * M_SQRT1_2,
     58    psImageSmoothMask_Threaded(smooth_wt, smooth_wt, readout->mask, maskVal, SIGMA_SMTH * M_SQRT1_2,
    5859                      NSIGMA_SMTH, minGauss);
    5960    psLogMsg("psphot", PS_LOG_MINUTIA, "smooth weight: %f sec\n", psTimerMark("psphot.smooth"));
     
    130131}
    131132
     133# if (0)
     134{
     135    // threadingdemo
     136    // smooth the image, applying the mask as we go
     137    psImage *smooth_im = psImageCopy(NULL, readout->image, PS_TYPE_F32);
     138    psImageSmoothMask(smooth_im, smooth_im, readout->mask, maskVal, SIGMA_SMTH, NSIGMA_SMTH, minGauss);
     139
     140    psLogMsg("psphot", PS_LOG_INFO, "smooth image: %f sec\n", psTimerMark("psphot.smooth"));
     141
     142    psImageConvolveSetThreads(true);
     143
     144    psTimerStart ("psphot.smooth");
     145
     146    // XXX a quick test of the threaded version of the function:
     147    psImage *smooth_test = psImageCopy(NULL, readout->image, PS_TYPE_F32);
     148    psImageSmoothMask_Threaded(smooth_test, smooth_test, readout->mask, maskVal, SIGMA_SMTH, NSIGMA_SMTH, minGauss);
     149
     150    psLogMsg("psphot", PS_LOG_INFO, "smooth_threaded image: %f sec\n", psTimerMark("psphot.smooth"));
     151
     152    psphotSaveImage (NULL, smooth_im, "smooth_im.fits");
     153    psphotSaveImage (NULL, smooth_test, "smooth_test.fits");
     154    exit (0);
     155}
     156# endif
Note: See TracChangeset for help on using the changeset viewer.