Index: /branches/eam_branches/ipp-20130419/pswarp/doc/notes.20130406.txt
===================================================================
--- /branches/eam_branches/ipp-20130419/pswarp/doc/notes.20130406.txt	(revision 35537)
+++ /branches/eam_branches/ipp-20130419/pswarp/doc/notes.20130406.txt	(revision 35538)
@@ -1,2 +1,4 @@
+
+20130406
 
 examining pswarp to handle inverse transformations or more general transformations:
Index: /branches/eam_branches/ipp-20130419/pswarp/src/pswarpParseCamera.c
===================================================================
--- /branches/eam_branches/ipp-20130419/pswarp/src/pswarpParseCamera.c	(revision 35537)
+++ /branches/eam_branches/ipp-20130419/pswarp/src/pswarpParseCamera.c	(revision 35538)
@@ -64,6 +64,11 @@
     }
 
+    // use the skycell camera or the input camera?
+    bool useInputCamera = !strcmp (skycell->cameraName, "SIMPLE");
+
     // The output skycell
-    pmFPAfile *output = pmFPAfileDefineOutputForFormat(config, NULL, "PSWARP.OUTPUT", skycell->cameraName, skycell->formatName);
+    pmFPAfile *output = useInputCamera ? 
+	pmFPAfileDefineSkycell(config, NULL, "PSWARP.OUTPUT") :
+	pmFPAfileDefineOutputForFormat(config, NULL, "PSWARP.OUTPUT", skycell->cameraName, skycell->formatName);
     if (!output) {
         psError(psErrorCodeLast(), false, "Failed to build FPA from PSWARP.OUTPUT");
@@ -72,5 +77,7 @@
     output->save = true;
 
-    pmFPAfile *outMask = pmFPAfileDefineOutputForFormat(config, output->fpa, "PSWARP.OUTPUT.MASK", skycell->cameraName, skycell->formatName);
+    pmFPAfile *outMask = useInputCamera ?
+	pmFPAfileDefineSkycell(config, output->fpa, "PSWARP.OUTPUT.MASK"):
+	pmFPAfileDefineOutputForFormat(config, output->fpa, "PSWARP.OUTPUT.MASK", skycell->cameraName, skycell->formatName);
     if (!outMask) {
         psError(psErrorCodeLast(), false, "Failed to build FPA from PSWARP.OUTPUT.MASK");
@@ -81,5 +88,7 @@
     // only create an output variance in we supply an input variance
     if (foundVariance) {
-	pmFPAfile *outVariance = pmFPAfileDefineOutputForFormat(config, output->fpa, "PSWARP.OUTPUT.VARIANCE", skycell->cameraName, skycell->formatName);
+	pmFPAfile *outVariance = useInputCamera ? 
+	    pmFPAfileDefineSkycell(config, output->fpa, "PSWARP.OUTPUT.VARIANCE"):
+	    pmFPAfileDefineOutputForFormat(config, output->fpa, "PSWARP.OUTPUT.VARIANCE", skycell->cameraName, skycell->formatName);
         if (!outVariance) {
             psError(psErrorCodeLast(), false, "Failed to build FPA from PSWARP.OUTPUT.VARIANCE");
@@ -91,5 +100,7 @@
     // XXX we assume input sources come from the input astrom description, but this need not be true (we could define an input sources file)
     if (foundAstrom && psMetadataLookupBool(&status, recipe, "SOURCES")) {
-	pmFPAfile *outSources = pmFPAfileDefineOutputForFormat(config, output->fpa, "PSWARP.OUTPUT.SOURCES", skycell->cameraName, skycell->formatName);
+	pmFPAfile *outSources = useInputCamera ? 
+	    pmFPAfileDefineSkycell(config, output->fpa, "PSWARP.OUTPUT.SOURCES"):
+	    pmFPAfileDefineOutputForFormat(config, output->fpa, "PSWARP.OUTPUT.SOURCES", skycell->cameraName, skycell->formatName);
         if (!outSources) {
             psError(psErrorCodeLast(), false, "Failed to build FPA from PSWARP.OUTPUT.SOURCES");
@@ -102,5 +113,7 @@
     if (foundBackground && psMetadataLookupBool(&status, recipe, "BACKGROUND.MODEL")) {
 	// pmFPAfile *outBackground = pmFPAfileDefineSkycell(config, NULL, "PSWARP.OUTPUT.BKGMODEL");
-	pmFPAfile *outBackground = pmFPAfileDefineOutputForFormat(config, NULL, "PSWARP.OUTPUT.BKGMODEL", skycell->cameraName, skycell->formatName);
+	pmFPAfile *outBackground = useInputCamera ? 
+	    pmFPAfileDefineSkycell(config, NULL, "PSWARP.OUTPUT.BKGMODEL"):
+	    pmFPAfileDefineOutputForFormat(config, NULL, "PSWARP.OUTPUT.BKGMODEL", skycell->cameraName, skycell->formatName);
 	outBackground->xBin = psMetadataLookupS32(&status, recipe, "BKG.XGRID");
 	outBackground->yBin = psMetadataLookupS32(&status, recipe, "BKG.YGRID");
@@ -115,5 +128,7 @@
     if (psMetadataLookupBool(&status, recipe, "PSF")) {
         // This file, PSPHOT.INPUT, is just used as a carrier; output files (eg, PSPHOT.RESID) are defined by psphotDefineFiles
-	pmFPAfile *psphotInput = pmFPAfileDefineOutputForFormat(config, NULL, "PSPHOT.INPUT", skycell->cameraName, skycell->formatName);
+	pmFPAfile *psphotInput = useInputCamera ? 
+	    pmFPAfileDefineSkycell(config, NULL, "PSPHOT.INPUT"):
+	    pmFPAfileDefineOutputForFormat(config, NULL, "PSPHOT.INPUT", skycell->cameraName, skycell->formatName);
         if (!psphotInput) {
             psError(psErrorCodeLast(), false, _("Unable to generate output file from PSPHOT.INPUT"));
@@ -131,5 +146,7 @@
 
         // pmFPAfile *psphotInSources = pmFPAfileDefineSkycell(config, output->fpa, "PSPHOT.INPUT.CMF");
-	pmFPAfile *psphotInSources = pmFPAfileDefineOutputForFormat(config, output->fpa, "PSPHOT.INPUT.CMF", skycell->cameraName, skycell->formatName);
+	pmFPAfile *psphotInSources = useInputCamera ? 
+	    pmFPAfileDefineSkycell(config, output->fpa, "PSPHOT.INPUT.CMF"):
+	    pmFPAfileDefineOutputForFormat(config, output->fpa, "PSPHOT.INPUT.CMF", skycell->cameraName, skycell->formatName);
         if (!psphotInSources) {
             psError(psErrorCodeLast(), false, _("Unable to generate output file from PSPHOT.INPUT.CMF"));
