Index: trunk/psModules/src/objects/pmSourceIO.c
===================================================================
--- trunk/psModules/src/objects/pmSourceIO.c	(revision 13527)
+++ trunk/psModules/src/objects/pmSourceIO.c	(revision 13670)
@@ -3,6 +3,6 @@
  *  @author EAM, IfA
  *
- *  @version $Revision: 1.41 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2007-05-26 02:52:53 $
+ *  @version $Revision: 1.42 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2007-06-06 02:23:33 $
  *
  *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
@@ -161,13 +161,17 @@
 bool pmFPAWriteObjects (pmFPA *fpa, const pmFPAview *view, pmFPAfile *file, const pmConfig *config)
 {
+    pmFPAview *thisView = pmFPAviewAlloc (view->nRows);
+    *thisView = *view;
 
     for (int i = 0; i < fpa->chips->n; i++) {
-
         pmChip *chip = fpa->chips->data[i];
-        if (!pmChipWriteObjects (chip, view, file, config)) {
+	thisView->chip = i;
+        if (!pmChipWriteObjects (chip, thisView, file, config)) {
             psError(PS_ERR_IO, false, "Failed to write %dth chip", i);
-            return false;
-        }
-    }
+	    psFree (thisView);
+            return false;
+        }
+    }
+    psFree (thisView);
     return true;
 }
@@ -176,13 +180,18 @@
 bool pmChipWriteObjects (pmChip *chip, const pmFPAview *view, pmFPAfile *file, const pmConfig *config)
 {
+    pmFPAview *thisView = pmFPAviewAlloc (view->nRows);
+    *thisView = *view;
 
     for (int i = 0; i < chip->cells->n; i++) {
 
         pmCell *cell = chip->cells->data[i];
-        if (!pmCellWriteObjects (cell, view, file, config)) {
+	thisView->cell = i;
+        if (!pmCellWriteObjects (cell, thisView, file, config)) {
             psError(PS_ERR_IO, false, "Failed to write %dth cell", i);
-            return false;
-        }
-    }
+	    psFree (thisView);
+            return false;
+        }
+    }
+    psFree (thisView);
     return true;
 }
@@ -191,13 +200,18 @@
 bool pmCellWriteObjects (pmCell *cell, const pmFPAview *view, pmFPAfile *file, const pmConfig *config)
 {
+    pmFPAview *thisView = pmFPAviewAlloc (view->nRows);
+    *thisView = *view;
 
     for (int i = 0; i < cell->readouts->n; i++) {
 
         pmReadout *readout = cell->readouts->data[i];
-        if (!pmReadoutWriteObjects (readout, view, file, config)) {
+	thisView->readout = i;
+        if (!pmReadoutWriteObjects (readout, thisView, file, config)) {
             psError(PS_ERR_IO, false, "Failed to write %dth readout", i);
-            return false;
-        }
-    }
+	    psFree (thisView);
+            return false;
+        }
+    }
+    psFree (thisView);
     return true;
 }
@@ -464,8 +478,13 @@
 bool pmFPAReadObjects (pmFPA *fpa, const pmFPAview *view, pmFPAfile *file, const pmConfig *config)
 {
+    pmFPAview *thisView = pmFPAviewAlloc (view->nRows);
+    *thisView = *view;
+
     for (int i = 0; i < fpa->chips->n; i++) {
         pmChip *chip = fpa->chips->data[i];
-        pmChipReadObjects (chip, view, file, config);
-    }
+	thisView->chip = i;
+        pmChipReadObjects (chip, thisView, file, config);
+    }
+    psFree (thisView);
     return true;
 }
@@ -474,11 +493,16 @@
 bool pmChipReadObjects (pmChip *chip, const pmFPAview *view, pmFPAfile *file, const pmConfig *config)
 {
+    pmFPAview *thisView = pmFPAviewAlloc (view->nRows);
+    *thisView = *view;
+
     chip->data_exists = false;
     for (int i = 0; i < chip->cells->n; i++) {
         pmCell *cell = chip->cells->data[i];
-        pmCellReadObjects (cell, view, file, config);
+	thisView->cell = i;
+        pmCellReadObjects (cell, thisView, file, config);
         if (!cell->data_exists) continue;
         chip->data_exists = true;
     }
+    psFree (thisView);
     return true;
 }
@@ -487,4 +511,7 @@
 bool pmCellReadObjects (pmCell *cell, const pmFPAview *view, pmFPAfile *file, const pmConfig *config)
 {
+    pmFPAview *thisView = pmFPAviewAlloc (view->nRows);
+    *thisView = *view;
+
     // multiple readout mode is not yet defined for CMP or CMF files
     // if they have not been allocated, allocate a single readout
@@ -497,5 +524,6 @@
     for (int i = 0; i < cell->readouts->n; i++) {
         pmReadout *readout = cell->readouts->data[i];
-        pmReadoutReadObjects (readout, view, file, config);
+	thisView->readout = i;
+        pmReadoutReadObjects (readout, thisView, file, config);
         if (!readout->data_exists) {
             continue;
@@ -510,4 +538,5 @@
         cell->data_exists = true;
     }
+    psFree (thisView);
     return true;
 }
