Index: /trunk/ppMerge/src/ppMergeCheckInputs.c
===================================================================
--- /trunk/ppMerge/src/ppMergeCheckInputs.c	(revision 7000)
+++ /trunk/ppMerge/src/ppMergeCheckInputs.c	(revision 7000)
@@ -0,0 +1,41 @@
+#include <stdio.h>
+#include <assert.h>
+#include <pslib.h>
+#include <psmodules.h>
+
+#include "ppMergeCheckInputs.h"
+
+// Check input files to make sure everything's consistent
+bool ppCheckInputs(const pmConfig *config // Configuration
+    )
+{
+    psArray *filenames = psMetadataLookupPtr(NULL, config->arguments, "INPUT"); // The input file names
+    assert(filenames);
+    int numGood = 0;                    // Number of good files
+    for (int i = 0; i < filenames->n; i++) {
+        psString name = filenames->data[i]; // The name of the file
+        psFits *inFile = psFitsOpen(filenames->data[i], "r"); // The FITS file to read
+        if (!inFile) {
+            psErrorPrint(PS_ERR_IO, false, "Unable to open input file %s --- ignored.\n", name);
+            // Kick it out
+            psFree(filenames->data[i]);
+            filenames->data[i] = NULL;
+            continue;
+        }
+        psMetadata *header = psFitsReadHeader(NULL, inFile); // The FITS (primary) header
+        psMetadata *format = pmConfigCameraFormatFromHeader(config, header); // The camera format
+        psFree(header);
+        if (!format) {
+            psErrorPrint(PS_ERR_IO, false, "Unable to identify camera format for input file %s --- "
+                         "ignored.\n", name);
+            // Kick it out
+            psFree(filenames->data[i]);
+            filenames->data[i] = NULL;
+            continue;
+        }
+        psFitsClose(inFile);
+        numGood++;
+    }
+
+    return (numGood > 1);
+}
Index: /trunk/ppMerge/src/ppMergeCheckInputs.h
===================================================================
--- /trunk/ppMerge/src/ppMergeCheckInputs.h	(revision 7000)
+++ /trunk/ppMerge/src/ppMergeCheckInputs.h	(revision 7000)
@@ -0,0 +1,8 @@
+#ifndef PP_MERGE_CHECK_INPUTS_H
+#define PP_MERGE_CHECK_INPUTS_H
+
+// Check input files to make sure everything's consistent
+bool ppCheckInputs(const pmConfig *config // Configuration
+    );
+
+#endif
