Index: /tags/ipp-20140114/psModules/src/objects/pmSourceIO_CFF.c
===================================================================
--- /tags/ipp-20140114/psModules/src/objects/pmSourceIO_CFF.c	(revision 36585)
+++ /tags/ipp-20140114/psModules/src/objects/pmSourceIO_CFF.c	(revision 36586)
@@ -246,4 +246,12 @@
     pmModelType sersicModelType = pmModelClassGetType("PS_MODEL_SERSIC");
 
+    psString modelToChoose = psMetadataLookupStr(&mdok, recipe, "EXT_MODEL_TYPE_FOR_CFF");
+    pmModelType selectedModelType = -1;
+    if (mdok && modelToChoose != NULL) {
+        if (strcmp(modelToChoose, "BEST")) {
+            selectedModelType = pmModelClassGetType(modelToChoose);
+        }
+    }
+
     for (int i = 0; i < sources->n; i++) {
         pmSource *thisSource = sources->data[i];
@@ -272,12 +280,9 @@
             theta = 0;
         } else {
-            // Choose the extended model to use for this source.
-            // For now we use the one set as the modelEXT for this source which had the best fit.
-            // XXX: make this controllable by recipe
-            //   use best (as implemented here)
-            //   choose specific type
+            //   Find the model with the selected type. If selected type is -1 choose the one selected ad
+            //   modelEXT which was the best
             int iModel = -1;
             if (source->modelEXT) {
-                pmModelType ext_model_type = source->modelEXT->type;
+                pmModelType ext_model_type =  selectedModelType != -1  ? selectedModelType : source->modelEXT->type;
                 for (int j=0; j<source->modelFits->n; j++) {
                     pmModel *aModel = source->modelFits->data[j];
