Index: /trunk/ppImage/src/ppImagePhotom.c
===================================================================
--- /trunk/ppImage/src/ppImagePhotom.c	(revision 12820)
+++ /trunk/ppImage/src/ppImagePhotom.c	(revision 12821)
@@ -21,12 +21,8 @@
     }
 
-    # if (0)
-    // replace this chip with a new copy
-    pmChip *oldChip = input->fpa->chips->data[view->chip];
-    pmChip *newChip = pmChipDuplicate (input->fpa, oldChip);
-    assert (newChip);
-    input->fpa->chips->data[view->chip] = newChip;
-    psFree (oldChip);
-    # endif
+    // we make a new copy of the output chip to keep psphot from modifying the output image
+    pmChip *oldChip = pmFPAviewThisChip (view, input->src);
+    pmChip *newChip = pmFPAviewThisChip (view, input->fpa);
+    pmChipCopy (newChip, oldChip);
 
     // iterate over the cells and readout for this chip
