IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Feb 13, 2008, 2:13:09 PM (18 years ago)
Author:
Paul Price
Message:

Starting to attempt to support stacking of images that have been read in piecemeal (scan by scan). Added parameters to pmSubtractionKernels to specify size of the (original) image, so that normalisation can be done (during convolution) when the image size is not the original image size. Doing some algebraic gymnastics in the pixel rejection to account for the image being smaller than the original.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/psModules/src/imcombine/pmSubtraction.c

    r16352 r16423  
    44 *  @author GLG, MHPCC
    55 *
    6  *  @version $Revision: 1.77 $ $Name: not supported by cvs2svn $
    7  *  @date $Date: 2008-02-07 04:03:23 $
     6 *  @version $Revision: 1.78 $ $Name: not supported by cvs2svn $
     7 *  @date $Date: 2008-02-14 00:13:09 $
    88 *
    99 *  Copyright 2004-2007 Institute for Astronomy, University of Hawaii
     
    715715
    716716    int numCols = ro1->image->numCols, numRows = ro1->image->numRows; // Image dimensions
     717    int x0 = ro1->col0, y0 = ro1->row0; // Image offset
    717718
    718719    psImage *convImage1 = out1->image;   // Convolved image
     
    771772        yMax = PS_MIN(region->y1, yMax);
    772773    }
     774
     775    // Size to use when calculating normalised coordinates (different from actual size when convolving
     776    // subimage)
     777    int xNormSize = (kernels->numCols > 0 ? kernels->numCols : numCols);
     778    int yNormSize = (kernels->numRows > 0 ? kernels->numRows : numRows);
    773779
    774780    psMaskType maskSource;              // Mask these pixels when convolving
     
    798804    for (int j = yMin; j < yMax; j += fullSize) {
    799805        int ySubMax = PS_MIN(j + fullSize, yMax); // Range for subregion of interest
    800         float yNorm = 2.0 * (float)(j + size + 1 - numRows/2.0) / (float)numRows; // Normalised coordinate
     806        float yNorm = 2.0 * (float)(j + y0 + size + 1 - yNormSize/2.0) /
     807            (float)yNormSize; // Normalised coordinate
    801808        for (int i = xMin; i < xMax; i += fullSize) {
    802809            int xSubMax = PS_MIN(i + fullSize, xMax); // Range for subregion of interest
    803             float xNorm = 2.0 * (float)(i + size + 1 - numCols/2.0) / (float)numCols; // Normalised coordinate
     810            float xNorm = 2.0 * (float)(i + x0 + size + 1 - xNormSize/2.0) /
     811                (float)xNormSize; // Normalised coordinate
    804812
    805813            // Only generate polynomial values every kernel footprint, since we have already assumed
Note: See TracChangeset for help on using the changeset viewer.