Index: /branches/eam_branches/ipp-20220316/psModules/src/camera/pmFPABin.c
===================================================================
--- /branches/eam_branches/ipp-20220316/psModules/src/camera/pmFPABin.c	(revision 42374)
+++ /branches/eam_branches/ipp-20220316/psModules/src/camera/pmFPABin.c	(revision 42375)
@@ -31,14 +31,14 @@
     psImage *outImage;                  // Output image
     if (out->image && out->image->numCols >= numColsOut && out->image->numRows >= numRowsOut) {
-        outImage = out->image;
+	outImage = out->image;
     } else {
-        outImage = out->image = psImageRecycle(out->image,  numColsOut, numRowsOut, PS_TYPE_F32);
+	outImage = out->image = psImageRecycle(out->image,  numColsOut, numRowsOut, PS_TYPE_F32);
     }
 
     psImage *outMask;                   // Output mask
     if (out->mask && out->mask->numCols >= numColsOut && out->mask->numRows >= numRowsOut) {
-        outMask = out->mask;
+	outMask = out->mask;
     } else {
-        outMask = out->mask = psImageRecycle(out->mask,  numColsOut, numRowsOut, PS_TYPE_IMAGE_MASK);
+	outMask = out->mask = psImageRecycle(out->mask,  numColsOut, numRowsOut, PS_TYPE_IMAGE_MASK);
     }
 
@@ -50,74 +50,74 @@
     int yStart = psImageBinningGetFineY(binning, 0); // Starting input y for binning
     for (int yOut = 0; yOut < numRowsOut; yOut++) {
-        int yStop = psImageBinningGetFineY(binning, yOut + 1); // Stopping input y for binning
-        yStop = PS_MIN(yStop, yLast);
-        int xStart = psImageBinningGetFineX(binning, 0); // Starting input x for binning
-        for (int xOut = 0; xOut < numColsOut; xOut++) {
-            int xStop = psImageBinningGetFineX(binning, xOut + 1); // Stopping input x for binning
-            xStop = PS_MIN(xStop, xLast);
+	int yStop = psImageBinningGetFineY(binning, yOut + 1); // Stopping input y for binning
+	yStop = PS_MIN(yStop, yLast);
+	int xStart = psImageBinningGetFineX(binning, 0); // Starting input x for binning
+	for (int xOut = 0; xOut < numColsOut; xOut++) {
+	    int xStop = psImageBinningGetFineX(binning, xOut + 1); // Stopping input x for binning
+	    xStop = PS_MIN(xStop, xLast);
 
-            float sum = 0.0;            // Sum of pixels
-            int numPix = 0;             // Number of pixels
+	    float sum = 0.0;            // Sum of pixels
+	    int numPix = 0;             // Number of pixels
 
 	    for (int j = 0; j < Nbits; j++) { // Reset bit counter
-	      bitcounter[j] = 0;
+		bitcounter[j] = 0;
 	    }
 	    pxlcount = 0;
 	    
-            for (int y = yStart; y < yStop; y++) {
-                for (int x = xStart; x < xStop; x++) {
-		  if (false && inMask && (inMask->data.PS_TYPE_IMAGE_MASK_DATA[y][x] != 0)) {
-		      for (int j = 0; j < Nbits; j++) {
-			psImageMaskType M = (psImageMaskType) pow(2,j);
-			if (inMask->data.PS_TYPE_IMAGE_MASK_DATA[y][x] & M) {
-			  bitcounter[j]++;
+	    for (int y = yStart; y < yStop; y++) {
+		for (int x = xStart; x < xStop; x++) {
+		    if (false && inMask && (inMask->data.PS_TYPE_IMAGE_MASK_DATA[y][x] != 0)) {
+			for (int j = 0; j < Nbits; j++) {
+			    psImageMaskType M = (psImageMaskType) pow(2,j);
+			    if (inMask->data.PS_TYPE_IMAGE_MASK_DATA[y][x] & M) {
+				bitcounter[j]++;
+			    }
 			}
-		      }
 		    }
 		  
-                    if (inMask && (inMask->data.PS_TYPE_IMAGE_MASK_DATA[y][x] & maskVal)) {
-                        continue;
-                    }
-                    if (!isfinite(inImage->data.F32[y][x])) {
-                        continue;
-                    }
-                    sum += inImage->data.F32[y][x];
-                    numPix++;
+		    if (inMask && (inMask->data.PS_TYPE_IMAGE_MASK_DATA[y][x] & maskVal)) {
+			continue;
+		    }
+		    if (!isfinite(inImage->data.F32[y][x])) {
+			continue;
+		    }
+		    sum += inImage->data.F32[y][x];
+		    numPix++;
 
 
-                }
-            }
+		}
+	    }
 	    
 	    // Values to set
-            float imageValue;
+	    float imageValue;
 	    psImageMaskType maskValue;
-            if (numPix > 0) {
-                imageValue = sum / numPix;
-                maskValue = 0;
-            } else {
-                imageValue = NAN;
-                maskValue = maskVal;
-            }
-            outImage->data.F32[yOut][xOut] = imageValue;
+	    if (numPix > 0) {
+		imageValue = sum / numPix;
+		maskValue = 0;
+	    } else {
+		imageValue = NAN;
+		maskValue = maskVal;
+	    }
+	    outImage->data.F32[yOut][xOut] = imageValue;
 	    if (true) {
-	      outMask->data.PS_TYPE_IMAGE_MASK_DATA[yOut][xOut] = maskValue;
+		outMask->data.PS_TYPE_IMAGE_MASK_DATA[yOut][xOut] = maskValue;
 	    } else {
-	      outMask->data.PS_TYPE_IMAGE_MASK_DATA[yOut][xOut] = 0;
+		outMask->data.PS_TYPE_IMAGE_MASK_DATA[yOut][xOut] = 0;
 	    }
 	    // this loop is pointless if pxlcount == 0 (all masked)
 	    if (false) {
-	      if (pxlcount) {
-		for (int j = 0; j < Nbits; j++) {
-		  if (bitcounter[j] > 0.5 * pxlcount) {
-		    outMask->data.PS_TYPE_IMAGE_MASK_DATA[yOut][xOut] |= (1 << j);
-		  }
+		if (pxlcount) {
+		    for (int j = 0; j < Nbits; j++) {
+			if (bitcounter[j] > 0.5 * pxlcount) {
+			    outMask->data.PS_TYPE_IMAGE_MASK_DATA[yOut][xOut] |= (1 << j);
+			}
+		    }
+		} else {
+		    outMask->data.PS_TYPE_IMAGE_MASK_DATA[yOut][xOut] = maskValue;
 		}
-	      } else {
-		outMask->data.PS_TYPE_IMAGE_MASK_DATA[yOut][xOut] = maskValue;
-	      }
 	    }
 	    xStart = xStop;
-        }
-        yStart = yStop;
+	}
+	yStart = yStop;
     }
 
@@ -126,10 +126,10 @@
     out->data_exists = true;
     if (out->parent) {
-        pmCell *outCell = out->parent;  // Output cell
-        outCell->data_exists = outCell->parent->data_exists = true;
+	pmCell *outCell = out->parent;  // Output cell
+	outCell->data_exists = outCell->parent->data_exists = true;
 
-        // We would copy the concepts from the input cell, except that is done by pmFPACopy,
-        // pmChipCopyStructure, etc.  This function just does the mechanics of binning.
-        // We don't even update the CELL.XBIN, CELL.YBIN because that would apply the correction twice.
+	// We would copy the concepts from the input cell, except that is done by pmFPACopy,
+	// pmChipCopyStructure, etc.  This function just does the mechanics of binning.
+	// We don't even update the CELL.XBIN, CELL.YBIN because that would apply the correction twice.
     }
 
