Index: trunk/psastro/src/psastroTIOParseCamera.c
===================================================================
--- trunk/psastro/src/psastroTIOParseCamera.c	(revision 41895)
+++ trunk/psastro/src/psastroTIOParseCamera.c	(revision 42840)
@@ -31,4 +31,27 @@
     output->save = true;
 
+    // check if the user wants CFF output
+    {
+      // select the current recipe
+      psMetadata *recipe  = psMetadataLookupPtr (&status, config->recipes, PSASTRO_RECIPE);
+      if (!recipe) {
+	psError(PSASTRO_ERR_CONFIG, false, "Can't find PSASTRO recipe!\n");
+	return false;
+      }
+
+      bool writeCff = psMetadataLookupBool (&status, recipe, "PSASTRO.SAVE.CFF");
+      if (writeCff) {
+	pmFPAfile *file = pmFPAfileDefineOutputFromFile  (config, input, "PSPHOT.OUTPUT.CFF");
+	if (!file) {
+	  psError (PS_ERR_IO, false, "Can't find the output cff file definition");
+	  return NULL;
+	}
+	if (file->type != PM_FPA_FILE_CFF) {
+	  psError(PS_ERR_IO, true, "%s is not of type %s", "PSPHOT.OUTPUT.CFF", pmFPAfileStringFromType (PM_FPA_FILE_CFF));
+	  return NULL;
+	}
+	file->save = true;
+      }
+    }
 
     // Chip selection: turn on only the chips specified (option is not required)
