Index: trunk/psModules/src/objects/pmSourceIO.c
===================================================================
--- trunk/psModules/src/objects/pmSourceIO.c	(revision 17832)
+++ trunk/psModules/src/objects/pmSourceIO.c	(revision 17850)
@@ -3,6 +3,6 @@
  *  @author EAM, IfA
  *
- *  @version $Revision: 1.59 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2008-05-28 21:48:49 $
+ *  @version $Revision: 1.60 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2008-05-29 13:25:35 $
  *
  *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
@@ -257,10 +257,10 @@
     char *headname = NULL;
 
-    // XXX if sources is NULL, skip the cell or write out empty tables?
-    // XXX if we use the file->name here, then we can use different pmFPAfiles for source output
-    psArray *sources = psMetadataLookupPtr (&status, readout->analysis, file->name);
+    // if sources is NULL, write out an empty table
+    // input / output sources are stored on the readout->analysis as "PSPHOT.SOURCES" -- a better name might be something like PM_SOURCE_DATA
+    psArray *sources = psMetadataLookupPtr (&status, readout->analysis, "PSPHOT.SOURCES");
     if (!sources) {
         sources = psArrayAlloc(0);
-        psMetadataAddArray(readout->analysis, PS_LIST_TAIL, file->name, PS_META_REPLACE, "Blank array of sources", sources);
+        psMetadataAddArray(readout->analysis, PS_LIST_TAIL, "PSPHOT.SOURCES", PS_META_REPLACE, "Blank array of sources", sources);
         psFree(sources); // Held onto by the metadata, so we can continue to use
     }
@@ -872,5 +872,5 @@
     }
     readout->data_exists = true;
-    status = psMetadataAdd (readout->analysis, PS_LIST_TAIL, file->name, PS_DATA_ARRAY, "input sources", sources);
+    status = psMetadataAdd (readout->analysis, PS_LIST_TAIL, "PSPHOT.SOURCES", PS_DATA_ARRAY, "input sources", sources);
     psFree (sources);
     return true;
@@ -886,5 +886,5 @@
 
     if (view->chip == -1) {
-        bool exists = pmFPACheckDataStatusForSources (fpa, file->name);
+        bool exists = pmFPACheckDataStatusForSources (fpa);
         return exists;
     }
@@ -896,5 +896,5 @@
 
     if (view->cell == -1) {
-        bool exists = pmChipCheckDataStatusForSources (chip, file->name);
+        bool exists = pmChipCheckDataStatusForSources (chip);
         return exists;
     }
@@ -906,5 +906,5 @@
 
     if (view->readout == -1) {
-        bool exists = pmCellCheckDataStatusForSources (cell, file->name);
+        bool exists = pmCellCheckDataStatusForSources (cell);
         return exists;
     }
@@ -916,9 +916,9 @@
     pmReadout *readout = cell->readouts->data[view->readout];
 
-    bool exists = pmReadoutCheckDataStatusForSources (readout, file->name);
+    bool exists = pmReadoutCheckDataStatusForSources (readout);
     return exists;
 }
 
-bool pmFPACheckDataStatusForSources (const pmFPA *fpa, const char *name)
+bool pmFPACheckDataStatusForSources (const pmFPA *fpa)
 {
     PS_ASSERT_PTR_NON_NULL(fpa, false);
@@ -928,10 +928,10 @@
         pmChip *chip = fpa->chips->data[i];
         if (!chip) continue;
-        if (pmChipCheckDataStatusForSources (chip, name)) return true;
+        if (pmChipCheckDataStatusForSources (chip)) return true;
     }
     return false;
 }
 
-bool pmChipCheckDataStatusForSources (const pmChip *chip, const char *name)
+bool pmChipCheckDataStatusForSources (const pmChip *chip)
 {
     PS_ASSERT_PTR_NON_NULL(chip, false);
@@ -941,10 +941,10 @@
         pmCell *cell = chip->cells->data[i];
         if (!cell) continue;
-        if (pmCellCheckDataStatusForSources (cell, name)) return true;
+        if (pmCellCheckDataStatusForSources (cell)) return true;
     }
     return false;
 }
 
-bool pmCellCheckDataStatusForSources (const pmCell *cell, const char *name)
+bool pmCellCheckDataStatusForSources (const pmCell *cell)
 {
     PS_ASSERT_PTR_NON_NULL(cell, false);
@@ -954,10 +954,10 @@
         pmReadout *readout = cell->readouts->data[i];
         if (!readout) continue;
-        if (pmReadoutCheckDataStatusForSources (readout, name)) return true;
+        if (pmReadoutCheckDataStatusForSources (readout)) return true;
     }
     return false;
 }
 
-bool pmReadoutCheckDataStatusForSources (const pmReadout *readout, const char *name)
+bool pmReadoutCheckDataStatusForSources (const pmReadout *readout)
 {
     PS_ASSERT_PTR_NON_NULL(readout, false);
@@ -966,5 +966,5 @@
 
     // select the psf of interest
-    pmPSF *psf = psMetadataLookupPtr (&status, readout->analysis, name);
+    pmPSF *psf = psMetadataLookupPtr (&status, readout->analysis, "PSPHOT.SOURCES");
     if (!psf) return false;
     return true;
Index: trunk/psModules/src/objects/pmSourceIO.h
===================================================================
--- trunk/psModules/src/objects/pmSourceIO.h	(revision 17832)
+++ trunk/psModules/src/objects/pmSourceIO.h	(revision 17850)
@@ -4,6 +4,6 @@
  * @author EAM, IfA; GLG, MHPCC
  *
- * @version $Revision: 1.16 $ $Name: not supported by cvs2svn $
- * @date $Date: 2008-05-28 21:48:49 $
+ * @version $Revision: 1.17 $ $Name: not supported by cvs2svn $
+ * @date $Date: 2008-05-29 13:25:38 $
  * Copyright 2004 Maui High Performance Computing Center, University of Hawaii
  *
@@ -57,8 +57,8 @@
 
 bool pmFPAviewCheckDataStatusForSources (const pmFPAview *view, const pmFPAfile *file);
-bool pmFPACheckDataStatusForSources (const pmFPA *fpa, const char *name);
-bool pmChipCheckDataStatusForSources (const pmChip *chip, const char *name);
-bool pmCellCheckDataStatusForSources (const pmCell *cell, const char *name);
-bool pmReadoutCheckDataStatusForSources (const pmReadout *readout, const char *name);
+bool pmFPACheckDataStatusForSources (const pmFPA *fpa);
+bool pmChipCheckDataStatusForSources (const pmChip *chip);
+bool pmCellCheckDataStatusForSources (const pmCell *cell);
+bool pmReadoutCheckDataStatusForSources (const pmReadout *readout);
 
 /// @}
