IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Feb 24, 2006, 6:23:34 PM (20 years ago)
Author:
magnier
Message:

added profile enabling, some attempts at optimization

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/rel10_ifa/psModules/src/objects/pmObjects.c

    r6480 r6493  
    66 *  @author EAM, IfA: significant modifications.
    77 *
    8  *  @version $Revision: 1.9.4.2 $ $Name: not supported by cvs2svn $
    9  *  @date $Date: 2006-02-24 04:03:45 $
     8 *  @version $Revision: 1.9.4.3 $ $Name: not supported by cvs2svn $
     9 *  @date $Date: 2006-02-25 04:23:34 $
    1010 *
    1111 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    909909    // XXX EAM : mask == 0 is valid
    910910
    911     psF32 **vPix = source->pixels->data.F32;
    912     psF32 **vWgt = source->weight->data.F32;
    913     psU8  **vMsk = source->mask->data.U8;
    914 
    915911    for (psS32 row = 0; row < source->pixels->numRows ; row++) {
    916         for (psS32 col = 0; col < source->pixels->numCols ; col++) {
    917             if ((source->mask != NULL) && (vMsk[row][col])) {
     912
     913        psF32 *vPix = source->pixels->data.F32[row];
     914        psF32 *vWgt = source->weight->data.F32[row];
     915        psU8  *vMsk = (source->mask == NULL) ? NULL : source->mask->data.U8[row];
     916
     917        for (psS32 col = 0; col < source->pixels->numCols ; col++, vPix++, vWgt++) {
     918            if ((vMsk != NULL) && *vMsk) {
     919                vMsk++;
    918920                continue;
    919921            }
    920 
    921             // psF32 xDiff = col + source->pixels->col0 - xPeak;
    922             // psF32 yDiff = row + source->pixels->row0 - yPeak;
    923922
    924923            psF32 xDiff = col + xOff;
    925924            psF32 yDiff = row + yOff;
    926925
    927             // XXX EAM : calculate xDiff, yDiff up front;
    928             //           radius is just a function of (xDiff, yDiff)
     926            // radius is just a function of (xDiff, yDiff)
    929927            if (!VALID_RADIUS(xDiff, yDiff, R2)) {
     928                if (vMsk != NULL)
     929                    vMsk++;
    930930                continue;
    931931            }
    932932
    933             psF32 pDiff = vPix[row][col] - sky;
    934             psF32 wDiff = vWgt[row][col];
     933            psF32 pDiff = *vPix - sky;
     934            psF32 wDiff = *vWgt;
    935935
    936936            // XXX EAM : check for valid S/N in pixel
    937937            // XXX EAM : should this limit be user-defined?
    938938            if (PS_SQR(pDiff) < wDiff) {
     939                if (vMsk != NULL)
     940                    vMsk++;
    939941                continue;
    940942            }
     
    948950            X1  += xWght;
    949951            Y1  += yWght;
     952
    950953            XY  += xDiff * yWght;
    951 
    952954            X2  += xDiff * xWght;
    953955            Y2  += yDiff * yWght;
    954956
    955             peakPixel = PS_MAX (vPix[row][col], peakPixel);
     957            peakPixel = PS_MAX (*vPix, peakPixel);
    956958            numPixels++;
     959            if (vMsk != NULL)
     960                vMsk++;
    957961        }
    958962    }
Note: See TracChangeset for help on using the changeset viewer.