Index: /tags/ipp-ps2-20190404/ppSub/src/ppSubCamera.c
===================================================================
--- /tags/ipp-ps2-20190404/ppSub/src/ppSubCamera.c	(revision 41999)
+++ /tags/ipp-ps2-20190404/ppSub/src/ppSubCamera.c	(revision 42000)
@@ -180,4 +180,6 @@
     psAssert(config, "Require configuration");
 
+
+    
     // Input image
     pmFPAfile *input = defineInputFile(&success, config, NULL, "PPSUB.INPUT", "INPUT", PM_FPA_FILE_IMAGE);
@@ -205,9 +207,22 @@
     }
 
+    int did_rewrite = 0;
+    
     // Reference image
     pmFPAfile *ref = defineInputFile(&success, config, NULL, "PPSUB.REF", "REF", PM_FPA_FILE_IMAGE);
     if (!success) {
         psError(psErrorCodeLast(), false, "Failed to build FPA from PPSUB.REF");
-        return false;
+	//        return false;
+
+	psErrorClear();
+	fprintf(stderr,"%s\n", config->cameraName);
+	psStringSubstitute(&( config->cameraName ),"GPC1","GPC2");
+	fprintf(stderr,"%s\n", config->cameraName);
+	did_rewrite = 1;
+	
+	ref = defineInputFile(&success, config, NULL, "PPSUB.REF", "REF", PM_FPA_FILE_IMAGE);
+	if (!success) {
+	  return false;
+	}
     }
 
@@ -226,8 +241,30 @@
     defineInputFile(&success, config, NULL, "PPSUB.REF.SOURCES", "REF.SOURCES", PM_FPA_FILE_CMF);
     if (!success) {
+      if (did_rewrite == 1) {
+	// Sometimes we use the warp sources instead of the stack
+	psErrorClear();
+	did_rewrite = 0;
+	
+	fprintf(stderr,"%s\n", config->cameraName);
+	psStringSubstitute(&( config->cameraName ),"GPC2","GPC1");
+	fprintf(stderr,"%s\n", config->cameraName);
+	defineInputFile(&success, config, NULL, "PPSUB.REF.SOURCES", "REF.SOURCES", PM_FPA_FILE_CMF);
+	if (!success) {
+	  psError(psErrorCodeLast(), false, "Failed to build FPA from PPSUB.REF.SOURCES");
+	  return false;
+	}
+      }
+      else {
         psError(psErrorCodeLast(), false, "Failed to build FPA from PPSUB.REF.SOURCES");
         return false;
-    }
-
+      }
+    }
+
+    if (did_rewrite == 1) {
+      fprintf(stderr,"%s\n", config->cameraName);
+      psStringSubstitute(&( config->cameraName ),"GPC2","GPC1");
+      fprintf(stderr,"%s\n", config->cameraName);
+    }
+    
     // Now that the camera has been determined, we can read the recipe
     psMetadata *recipe = psMetadataLookupMetadata(NULL, config->recipes, PPSUB_RECIPE); // Recipe for ppSim
