Index: trunk/psModules/src/objects/pmPSF_IO.c
===================================================================
--- trunk/psModules/src/objects/pmPSF_IO.c	(revision 9770)
+++ trunk/psModules/src/objects/pmPSF_IO.c	(revision 10421)
@@ -6,6 +6,6 @@
  *  @author EAM, IfA
  *
- *  @version $Revision: 1.8 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2006-10-28 20:23:51 $
+ *  @version $Revision: 1.9 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2006-12-03 18:48:10 $
  *
  *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
@@ -117,5 +117,5 @@
 }
 
-bool pmFPAviewWritePSFmodel (const pmFPAview *view, pmFPAfile *file)
+bool pmFPAviewWritePSFmodel (const pmFPAview *view, pmFPAfile *file, pmConfig *config)
 {
 
@@ -123,5 +123,5 @@
 
     if (view->chip == -1) {
-        pmFPAWritePSFmodel (fpa, view, file);
+        pmFPAWritePSFmodel (fpa, view, file, config);
         return true;
     }
@@ -133,5 +133,5 @@
 
     if (view->cell == -1) {
-        pmChipWritePSFmodel (chip, view, file);
+        pmChipWritePSFmodel (chip, view, file, config);
         return true;
     }
@@ -143,5 +143,5 @@
 
     if (view->readout == -1) {
-        pmCellWritePSFmodel (cell, view, file);
+        pmCellWritePSFmodel (cell, view, file, config);
         return true;
     }
@@ -152,10 +152,10 @@
     pmReadout *readout = cell->readouts->data[view->readout];
 
-    pmReadoutWritePSFmodel (readout, view, file);
+    pmReadoutWritePSFmodel (readout, view, file, config);
     return true;
 }
 
 // read in all chip-level PSFmodel files for this FPA
-bool pmFPAWritePSFmodel (pmFPA *fpa, const pmFPAview *view, pmFPAfile *file)
+bool pmFPAWritePSFmodel (pmFPA *fpa, const pmFPAview *view, pmFPAfile *file, pmConfig *config)
 {
 
@@ -163,5 +163,5 @@
 
         pmChip *chip = fpa->chips->data[i];
-        pmChipWritePSFmodel (chip, view, file);
+        pmChipWritePSFmodel (chip, view, file, config);
     }
     return true;
@@ -169,5 +169,5 @@
 
 // read in all cell-level PSFmodel files for this chip
-bool pmChipWritePSFmodel (pmChip *chip, const pmFPAview *view, pmFPAfile *file)
+bool pmChipWritePSFmodel (pmChip *chip, const pmFPAview *view, pmFPAfile *file, pmConfig *config)
 {
 
@@ -175,5 +175,5 @@
 
         pmCell *cell = chip->cells->data[i];
-        pmCellWritePSFmodel (cell, view, file);
+        pmCellWritePSFmodel (cell, view, file, config);
     }
     return true;
@@ -181,5 +181,5 @@
 
 // read in all readout-level PSFmodel files for this cell
-bool pmCellWritePSFmodel (pmCell *cell, const pmFPAview *view, pmFPAfile *file)
+bool pmCellWritePSFmodel (pmCell *cell, const pmFPAview *view, pmFPAfile *file, pmConfig *config)
 {
 
@@ -187,5 +187,5 @@
 
         pmReadout *readout = cell->readouts->data[i];
-        pmReadoutWritePSFmodel (readout, view, file);
+        pmReadoutWritePSFmodel (readout, view, file, config);
     }
     return true;
@@ -193,8 +193,9 @@
 
 // read in all readout-level Objects files for this cell
-bool pmReadoutWritePSFmodel (pmReadout *readout, const pmFPAview *view, pmFPAfile *file)
+bool pmReadoutWritePSFmodel (pmReadout *readout, const pmFPAview *view, pmFPAfile *file, pmConfig *config)
 {
     bool status;
     char *filename;
+    char *realname;
 
     pmPSF *psf = psMetadataLookupPtr (&status, readout->analysis, "PSPHOT.PSF");
@@ -203,7 +204,10 @@
     case PM_FPA_FILE_PSF:
         filename = pmFPAfileNameFromRule (file->filerule, file, view);
+        realname = pmConfigConvertFilename (filename, config);
+
         psMetadata *psfData = pmPSFtoMetadata (NULL, psf);
-        psMetadataConfigWrite (psfData, filename);
+        psMetadataConfigWrite (psfData, realname);
         psFree (psfData);
+        psFree (realname);
         psFree (filename);
         return true;
@@ -218,5 +222,5 @@
 
 
-bool pmFPAviewReadPSFmodel (const pmFPAview *view, pmFPAfile *file)
+bool pmFPAviewReadPSFmodel (const pmFPAview *view, pmFPAfile *file, pmConfig *config)
 {
 
@@ -224,5 +228,5 @@
 
     if (view->chip == -1) {
-        pmFPAReadPSFmodel (fpa, view, file);
+        pmFPAReadPSFmodel (fpa, view, file, config);
         return true;
     }
@@ -234,5 +238,5 @@
 
     if (view->cell == -1) {
-        pmChipReadPSFmodel (chip, view, file);
+        pmChipReadPSFmodel (chip, view, file, config);
         return true;
     }
@@ -244,5 +248,5 @@
 
     if (view->readout == -1) {
-        pmCellReadPSFmodel (cell, view, file);
+        pmCellReadPSFmodel (cell, view, file, config);
         return true;
     }
@@ -253,10 +257,10 @@
     pmReadout *readout = cell->readouts->data[view->readout];
 
-    pmReadoutReadPSFmodel (readout, view, file);
+    pmReadoutReadPSFmodel (readout, view, file, config);
     return true;
 }
 
 // read in all chip-level PSFmodel files for this FPA
-bool pmFPAReadPSFmodel (pmFPA *fpa, const pmFPAview *view, pmFPAfile *file)
+bool pmFPAReadPSFmodel (pmFPA *fpa, const pmFPAview *view, pmFPAfile *file, pmConfig *config)
 {
 
@@ -264,5 +268,5 @@
 
         pmChip *chip = fpa->chips->data[i];
-        pmChipReadPSFmodel (chip, view, file);
+        pmChipReadPSFmodel (chip, view, file, config);
     }
     return true;
@@ -270,5 +274,5 @@
 
 // read in all cell-level PSFmodel files for this chip
-bool pmChipReadPSFmodel (pmChip *chip, const pmFPAview *view, pmFPAfile *file)
+bool pmChipReadPSFmodel (pmChip *chip, const pmFPAview *view, pmFPAfile *file, pmConfig *config)
 {
 
@@ -276,5 +280,5 @@
 
         pmCell *cell = chip->cells->data[i];
-        pmCellReadPSFmodel (cell, view, file);
+        pmCellReadPSFmodel (cell, view, file, config);
     }
     return true;
@@ -282,5 +286,5 @@
 
 // read in all readout-level PSFmodel files for this cell
-bool pmCellReadPSFmodel (pmCell *cell, const pmFPAview *view, pmFPAfile *file)
+bool pmCellReadPSFmodel (pmCell *cell, const pmFPAview *view, pmFPAfile *file, pmConfig *config)
 {
 
@@ -288,5 +292,5 @@
 
         pmReadout *readout = cell->readouts->data[i];
-        pmReadoutReadPSFmodel (readout, view, file);
+        pmReadoutReadPSFmodel (readout, view, file, config);
     }
     return true;
@@ -294,15 +298,17 @@
 
 // read in all readout-level Objects files for this cell
-bool pmReadoutReadPSFmodel (pmReadout *readout, const pmFPAview *view, pmFPAfile *file)
+bool pmReadoutReadPSFmodel (pmReadout *readout, const pmFPAview *view, pmFPAfile *file, pmConfig *config)
 {
 
     unsigned int Nfail;
     char *filename;
+    char *realname;
 
     switch (file->type) {
     case PM_FPA_FILE_PSF:
         filename = pmFPAfileNameFromRule (file->filerule, file, view);
-
-        psMetadata *psfData = psMetadataConfigRead(NULL, &Nfail, filename, FALSE);
+        realname = pmConfigConvertFilename (filename, config);
+
+        psMetadata *psfData = psMetadataConfigRead(NULL, &Nfail, realname, FALSE);
         pmPSF *psf = pmPSFfromMetadata (psfData);
         psMetadataAdd (readout->analysis, PS_LIST_TAIL, "PSPHOT.PSF", PS_DATA_UNKNOWN, "psphot psf", psf);
@@ -310,4 +316,5 @@
         psFree (psf);
         psFree (psfData);
+        psFree (realname);
         psFree (filename);
 
