Index: trunk/archive/modules/src/pmAstrom.c
===================================================================
--- trunk/archive/modules/src/pmAstrom.c	(revision 5353)
+++ trunk/archive/modules/src/pmAstrom.c	(revision 5494)
@@ -32,5 +32,5 @@
 */
 
-pmAstromGridMatchStat pmAstromGridMatch (psArray *st1, psArray *st2, pmAstromOpt *opt) {
+psArray *pmAstromGridMatch (psArray *raw, psArray *ref, psMetadata *options) {
 
     pmAstromGridMatchStat minStat, newStat
@@ -59,31 +59,4 @@
     }
     return (minStat);
-}
-
-// rotate the focal-plane coordinates about the center coordinate
-// angle specified in radians
-psArray *pmAstromRotateObj (psArray *old, double angle, double pCenter, double qCenter) {
-
-    pmAstromObj *ob;
-
-    psArray *new = psArrayAlloc (old->n);
-
-    cs = cos(angle);
-    sn = sin(angle);
-    
-    for (int i = 0; i < old->n; i++) {
-
-	oldObj = (pmAstromObj *)old->data[i];
-	newObj = pmAstromObjCopy (oldObj);
-
-	P = oldObj->P - pCenter;
-	Q = oldObj->Q - qCenter;
-	
-	newObj->P = P*cs + Q*sn;
-	newObj->Q = Q*cs - P*sn;
-	
-	new->data[i] = newObj;
-    }
-    return (new);
 }
 
@@ -250,2 +223,74 @@
     psPolynomial2D *yt = psVectorFitPolynomial2D (NULL, stats, NULL, 0, Y, NULL, x, y)
     psPolynomial2D *yt = psVectorClipFitPolynomial2D (NULL, stats, NULL, 0, Y, NULL, x, y)
+
+      }
+
+}
+
+
+// rotate the focal-plane coordinates about the center coordinate
+// angle specified in radians
+psArray *pmAstromRotateObj (psArray *old, psPlane *center, double angle) {
+
+    pmAstromObj *newObj;
+
+    psArray *new = psArrayAlloc (old->n);
+
+    cs = cos(angle);
+    sn = sin(angle);
+    xCenter = center.x;
+    yCenter = center.y;
+    
+    for (int i = 0; i < old->n; i++) {
+
+	oldObj = (pmAstromObj *)old->data[i];
+	newObj = pmAstromObjCopy (oldObj);
+
+	P = oldObj->FP.x - xCenter;
+	Q = oldObj->FP.y - yCenter;
+	
+	newObj->FP.x = P*cs + Q*sn;
+	newObj->FP.y = Q*cs - P*sn;
+	
+	new->data[i] = newObj;
+    }
+    return (new);
+}
+
+pmAstromObj *pmAstromObjCopy (pmAstromObj *old) {
+
+  pmAstromObj *obj = pmAstromObjAlloc ();
+
+  obj[0] = old[0];
+
+  return (obj);
+}
+
+static void pmAstromObjFree (pmAstromObj *obj) {
+
+  if (obj == NULL) return;
+  return;
+}
+
+pmAstromObj *pmAstromObjAlloc (void) {
+
+  pmAstromObj *obj = psAlloc (sizeof(pmAstromObj));
+  psMemSetDeallocator(line, (psFreeFunc) pmAstromObjFree);
+
+  obj->pix.x = 0;
+  obj->pix.y = 0;
+
+  obj->FP.x = 0;
+  obj->FP.y = 0;
+
+  obj->TP.x = 0;
+  obj->TP.y = 0;
+
+  obj->sky.x = 0;
+  obj->sky.y = 0;
+
+  obj->mag = 0;
+
+  return (obj);
+}
+
