Index: trunk/psModules/src/objects/pmSourceIO.c
===================================================================
--- trunk/psModules/src/objects/pmSourceIO.c	(revision 13192)
+++ trunk/psModules/src/objects/pmSourceIO.c	(revision 13347)
@@ -3,6 +3,6 @@
  *  @author EAM, IfA
  *
- *  @version $Revision: 1.39 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2007-05-03 20:04:31 $
+ *  @version $Revision: 1.40 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2007-05-11 03:44:16 $
  *
  *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
@@ -17,5 +17,5 @@
 #include <math.h>
 #include <string.h>
-#include <strings.h>		/* for strn?casecmp */
+#include <strings.h>            /* for strn?casecmp */
 #include <pslib.h>
 
@@ -71,11 +71,11 @@
 {
     if (type == 4) {
-	source->mode |= PM_SOURCE_MODE_FAIL;
+        source->mode |= PM_SOURCE_MODE_FAIL;
     }
     if (type == 7) {
-	source->mode |= PM_SOURCE_MODE_POOR;
+        source->mode |= PM_SOURCE_MODE_POOR;
     }
     if (type == 10) {
-	source->mode |= PM_SOURCE_MODE_SATSTAR;
+        source->mode |= PM_SOURCE_MODE_SATSTAR;
     }
 
@@ -85,14 +85,14 @@
       case 7:
       case 10:
-	source->type = PM_SOURCE_TYPE_STAR; 
-	return true;
+        source->type = PM_SOURCE_TYPE_STAR;
+        return true;
       case 2:
-	source->type = PM_SOURCE_TYPE_EXTENDED; 
-	return true;
+        source->type = PM_SOURCE_TYPE_EXTENDED;
+        return true;
       case 8:
-	source->type = PM_SOURCE_TYPE_DEFECT; 
-	return true;
+        source->type = PM_SOURCE_TYPE_DEFECT;
+        return true;
       default:
-	return false;
+        return false;
     }
     return false;
@@ -209,6 +209,4 @@
     bool status;
     char *exttype;
-    char *realname;
-    char *filename;
     char *dataname;
     char *headname;
@@ -223,29 +221,15 @@
         return true;
 
-    bool create = file->mode == PM_FPA_MODE_WRITE ? true : false;
-
     switch (file->type) {
       case PM_FPA_FILE_RAW:
-        filename = pmFPAfileNameFromRule (file->filerule, file, view);
-        realname = pmConfigConvertFilename (filename, config, create);
-        pmSourcesWriteRAW (sources, realname);
-        psFree (realname);
-        psFree (filename);
+        pmSourcesWriteRAW (sources, file->filename);
         break;
 
       case PM_FPA_FILE_OBJ:
-        filename = pmFPAfileNameFromRule (file->filerule, file, view);
-        realname = pmConfigConvertFilename (filename, config, create);
-        pmSourcesWriteOBJ (sources, realname);
-        psFree (realname);
-        psFree (filename);
+        pmSourcesWriteOBJ (sources, file->filename);
         break;
 
       case PM_FPA_FILE_SX:
-        filename = pmFPAfileNameFromRule (file->filerule, file, view);
-        realname = pmConfigConvertFilename (filename, config, create);
-        pmSourcesWriteSX (sources, realname);
-        psFree (realname);
-        psFree (filename);
+        pmSourcesWriteSX (sources, file->filename);
         break;
 
@@ -253,6 +237,4 @@
         // a SPLIT format : only one header and object table per file
         hdu = pmFPAviewThisHDU (view, file->fpa);
-        filename = pmFPAfileNameFromRule (file->filerule, file, view);
-        realname = pmConfigConvertFilename (filename, config, create);
 
         // copy the header to an output header, add the output header data
@@ -271,8 +253,6 @@
         }
 
-        bool status = pmSourcesWriteCMP (sources, realname, outhead);
+        bool status = pmSourcesWriteCMP (sources, file->filename, outhead);
         psFree (outhead);
-        psFree (realname);
-        psFree (filename);
 
         if (!status) {
@@ -355,5 +335,5 @@
         // this header block is new, write it to disk
         if (hdu->header != file->header) {
-	    // XXX I was building a new copy, why?  supplement the output header
+            // XXX I was building a new copy, why?  supplement the output header
             // outhead = psMetadataCopy (NULL, hdu->header);
 
@@ -547,7 +527,9 @@
         // read in header, if not yet loaded
         hdu = pmFPAviewThisHDU (view, file->fpa);
+#if 0
         if (file->filename)
             psFree (file->filename);
         file->filename = pmFPAfileNameFromRule (file->filerule, file, view);
+#endif
 
         // indirect filenames
@@ -562,9 +544,6 @@
         }
 
-        bool create = file->mode == PM_FPA_MODE_WRITE ? true : false;
-        psString realname = pmConfigConvertFilename (file->filename, config, create);
-
         // read the PHU from this file
-        file->fits = psFitsOpen (realname, "r");
+        file->fits = psFitsOpen (file->filename, "r");
         if (hdu->header != NULL) {
             psFree (hdu->header);
@@ -574,6 +553,5 @@
         file->fits = NULL;
 
-        sources = pmSourcesReadCMP (realname, hdu->header);
-        psFree (realname);
+        sources = pmSourcesReadCMP (file->filename, hdu->header);
         break;
 
@@ -667,9 +645,9 @@
 
     if (view->chip == -1) {
-	bool exists = pmFPACheckDataStatusForSources (fpa);
+        bool exists = pmFPACheckDataStatusForSources (fpa);
         return exists;
     }
     if (view->chip >= fpa->chips->n) {
-	psError(PS_ERR_IO, true, "Requested chip == %d >= fpa->chips->n == %ld", view->chip, fpa->chips->n);
+        psError(PS_ERR_IO, true, "Requested chip == %d >= fpa->chips->n == %ld", view->chip, fpa->chips->n);
         return false;
     }
@@ -681,5 +659,5 @@
     }
     if (view->cell >= chip->cells->n) {
-	psError(PS_ERR_IO, true, "Requested cell == %d >= chip->cells->n == %ld", view->cell, chip->cells->n);
+        psError(PS_ERR_IO, true, "Requested cell == %d >= chip->cells->n == %ld", view->cell, chip->cells->n);
         return false;
     }
@@ -692,5 +670,5 @@
 
     if (view->readout >= cell->readouts->n) {
-	psError(PS_ERR_IO, true, "Requested readout == %d >= cell->readouds->n == %ld", view->readout, cell->readouts->n);
+        psError(PS_ERR_IO, true, "Requested readout == %d >= cell->readouds->n == %ld", view->readout, cell->readouts->n);
         return false;
     }
@@ -704,7 +682,7 @@
 
     for (int i = 0; i < fpa->chips->n; i++) {
-	pmChip *chip = fpa->chips->data[i];
-	if (!chip) continue;
-	if (pmChipCheckDataStatusForSources (chip)) return true;
+        pmChip *chip = fpa->chips->data[i];
+        if (!chip) continue;
+        if (pmChipCheckDataStatusForSources (chip)) return true;
     }
     return false;
@@ -714,7 +692,7 @@
 
     for (int i = 0; i < chip->cells->n; i++) {
-	pmCell *cell = chip->cells->data[i];
-	if (!cell) continue;
-	if (pmCellCheckDataStatusForSources (cell)) return true;
+        pmCell *cell = chip->cells->data[i];
+        if (!cell) continue;
+        if (pmCellCheckDataStatusForSources (cell)) return true;
     }
     return false;
@@ -724,7 +702,7 @@
 
     for (int i = 0; i < cell->readouts->n; i++) {
-	pmReadout *readout = cell->readouts->data[i];
-	if (!readout) continue;
-	if (pmReadoutCheckDataStatusForSources (readout)) return true;
+        pmReadout *readout = cell->readouts->data[i];
+        if (!readout) continue;
+        if (pmReadoutCheckDataStatusForSources (readout)) return true;
     }
     return false;
