Index: trunk/magic/remove/src/streaksastrom.c
===================================================================
--- trunk/magic/remove/src/streaksastrom.c	(revision 20520)
+++ trunk/magic/remove/src/streaksastrom.c	(revision 20573)
@@ -1,7 +1,7 @@
-#include "streaks.h"
+#include "streaksremove.h"
 
 // Initialize the astrometry object for current cell
 strkAstrom *
-streakSetAstrometry(strkAstrom *astrom, pmFPA *fpa, pmChip *chip, bool fromCell, psMetadata *md, int numCols, int numRows)
+streakSetAstrometry(strkAstrom *astrom, ippStage stage, pmFPA *fpa, pmChip *chip, bool fromCell, psMetadata *md, int numCols, int numRows)
 {
     if (!astrom) {
@@ -39,11 +39,13 @@
             return false;
         }
-    } else if (md) {
+    } else if (md && (stage == IPP_STAGE_RAW)) {
         // The metadata is the raw header
         // Assumes GPC1
+        //
+        // Shouldn't these lookups be F32 ?
         cell_x0 =  psMetadataLookupS32(&mdok, md, "IMNPIX1");
         if (!mdok) {
             psError(PS_ERR_UNKNOWN, true, "IMNPIX1 for cell is not set.\n");
-            return NULL;
+            // return NULL;
         }
         cell_y0 = psMetadataLookupS32(&mdok, md, "IMNPIX2");
@@ -63,4 +65,5 @@
             return false;
         }
+
     } else {
         // no metadata regular cell
@@ -108,4 +111,6 @@
     outPt->y = (pt->chip->y - astrom->cell_y0) * astrom->yParity;
 
+//    printf("cell: %f %f chip: %f %f\n", outPt->x, outPt->y, pt->chip->x, pt->chip->y);
+
     return true;
 }
@@ -136,3 +141,11 @@
     return true;
 }
+
+void
+cellToChip(PixelPos *chip, strkAstrom *astrom, PixelPos *cell)
+{
+    // TODO: do I need to worry about going from int to float and back again here?
+    chip->x = (cell->x * astrom->xParity) + astrom->cell_x0;
+    chip->y = (cell->y * astrom->yParity) + astrom->cell_y0;
+}
  
