Index: trunk/pswarp/src/pswarpArguments.c
===================================================================
--- trunk/pswarp/src/pswarpArguments.c	(revision 12567)
+++ trunk/pswarp/src/pswarpArguments.c	(revision 12771)
@@ -47,4 +47,5 @@
     }
 
+
     psArray *array;
 
@@ -58,4 +59,76 @@
     psFree (array);
 
+
+    // Parse the recipe and format into the arguments
+    {
+
+        // Select the appropriate recipe
+        psMetadata *recipe  = psMetadataLookupPtr (NULL, config->recipes, PSWARP_RECIPE);
+        if (!recipe) {
+            psError(PSWARP_ERR_CONFIG, true, "Can't find %s recipe!\n", PSWARP_RECIPE);
+            return false;
+        }
+
+        // Get grid size
+        bool status;                        // Status of MD lookup
+        int nGridX = psMetadataLookupS32 (&status, recipe, "GRID.NX");
+        if (!status) nGridX = 128;
+        int nGridY = psMetadataLookupS32 (&status, recipe, "GRID.NY");
+        if (!status) nGridY = 128;
+
+        // Get interpolation mode
+        psImageInterpolateMode interpolationMode; // Mode for interpolation
+        const char *name = psMetadataLookupStr (&status, recipe, "INTERPOLATION.MODE"); // Name of interp mode
+        if (!name) {
+            interpolationMode = PS_INTERPOLATE_BILINEAR;
+            psLogMsg ("pswarp", 3, "defaulting to bilinear interpolation\n");
+        } else {
+            interpolationMode = psImageInterpolateModeFromString (name);
+            if (interpolationMode == PS_INTERPOLATE_NONE) {
+                interpolationMode = PS_INTERPOLATE_BILINEAR;
+                psLogMsg ("pswarp", 3,
+                          "Unknown interpolation mode %s, defaulting to bilinear interpolation\n", name);
+            }
+        }
+
+        // Get mask parameters
+        psMaskType maskIn = psMetadataLookupU8(&status, recipe, "MASK.IN"); // Mask for input data
+        if (!status) {
+            maskIn = 0x00;
+            psWarning("MASK.IN is not set in the %s recipe --- defaulting to %x.", PSWARP_RECIPE, maskIn);
+        }
+        psMaskType maskPoor = psMetadataLookupU8(&status, recipe, "MASK.POOR"); // Mask for "poor" warped data
+        if (!status) {
+            maskPoor = 0x00;
+            psWarning("MASK.POOR is not set in the %s recipe --- defaulting to %x.", PSWARP_RECIPE, maskPoor);
+        }
+        psMaskType maskBad = psMetadataLookupU8(&status, recipe, "MASK.IN"); // Mask for bad warped data
+        if (!status) {
+            maskBad = 0x00;
+            psWarning("MASK.BAD is not set in the %s recipe --- defaulting to %x.", PSWARP_RECIPE, maskBad);
+        }
+        float poorFrac = psMetadataLookupF32(&status, recipe, "POOR.FRAC"); // Frac of bad flux for a "poor"
+        if (!status) {
+            poorFrac = 0.0;
+            psWarning("POOR.FRAC is not set in the %s recipe --- defaulting to %f.", PSWARP_RECIPE, poorFrac);
+        }
+
+        // Set recipe values in the arguments
+        psMetadataAddS32(config->arguments, PS_LIST_TAIL, "GRID.NX", 0,
+                         "Iso-astrom grid spacing in x", nGridX);
+        psMetadataAddS32(config->arguments, PS_LIST_TAIL, "GRID.NY", 0,
+                         "Iso-astrom grid spacing in x", nGridX);
+        psMetadataAddS32(config->arguments, PS_LIST_TAIL, "INTERPOLATION.MODE", 0,
+                         "Interpolation mode", interpolationMode);
+        psMetadataAddU8(config->arguments, PS_LIST_TAIL, "MASK.IN", 0,
+                         "Mask for input data", maskIn);
+        psMetadataAddU8(config->arguments, PS_LIST_TAIL, "MASK.POOR", 0,
+                         "Mask for poor warped data", maskPoor);
+        psMetadataAddU8(config->arguments, PS_LIST_TAIL, "MASK.BAD", 0,
+                         "Mask for bad warped data", maskBad);
+        psMetadataAddF32(config->arguments, PS_LIST_TAIL, "POOR.FRAC", 0,
+                         "Fraction of bad flux for a pixel to be marked as poor", poorFrac);
+    }
+
     psTrace("pswarp", 1, "Done with pswarpArguments...\n");
     return (config);
