Index: trunk/pswarp/src/pswarpDefine.c
===================================================================
--- trunk/pswarp/src/pswarpDefine.c	(revision 10952)
+++ trunk/pswarp/src/pswarpDefine.c	(revision 10954)
@@ -23,4 +23,25 @@
     pmFPAfileRead (skycell, view, config);
 
+    // XXX this is not a sufficient test
+    view->chip = 0;
+    pmChip *chip = pmFPAviewThisChip (view, skycell->fpa);
+    pmHDU *phu = pmFPAviewThisPHU (view, skycell->fpa);
+    pmHDU *hdu = pmFPAviewThisHDU (view, skycell->fpa);
+    bool bilevelAstrometry = false;
+    if (phu) {
+      char *ctype = psMetadataLookupStr (NULL, phu->header, "CTYPE1");
+      if (ctype) {
+	bilevelAstrometry = !strcmp (&ctype[4], "-DIS");
+      }
+    }
+    if (bilevelAstrometry) {
+      pmAstromReadBilevelMosaic (skycell->fpa, phu->header);
+      pmAstromReadBilevelChip (chip, hdu->header); 
+    } else {
+      // XXX get pixelScale from recipes.  does it matter?
+      float pixelScale = 13.5;
+      pmAstromReadWCS (skycell->fpa, chip, hdu->header, pixelScale);
+    }
+
     // construct the output fpa here
     pmFPAfile *output = psMetadataLookupPtr (NULL, config->files, "PSWARP.OUTPUT");
