Index: /branches/eam_branches/ipp-20230313/psastro/src/psastroTIODataSave.c
===================================================================
--- /branches/eam_branches/ipp-20230313/psastro/src/psastroTIODataSave.c	(revision 42708)
+++ /branches/eam_branches/ipp-20230313/psastro/src/psastroTIODataSave.c	(revision 42709)
@@ -46,4 +46,5 @@
     pmFPAfileActivate (config->files, false, NULL);
     pmFPAfileActivate (config->files, true, "PSASTRO.OUTPUT");
+    pmFPAfileActivate (config->files, true, "PSPHOT.OUTPUT.CFF");
 
     pmFPAview *view = pmFPAviewAlloc (0);
Index: /branches/eam_branches/ipp-20230313/psastro/src/psastroTIOParseCamera.c
===================================================================
--- /branches/eam_branches/ipp-20230313/psastro/src/psastroTIOParseCamera.c	(revision 42708)
+++ /branches/eam_branches/ipp-20230313/psastro/src/psastroTIOParseCamera.c	(revision 42709)
@@ -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)
