Index: trunk/psastro/src/psastroLoadGhosts.c
===================================================================
--- trunk/psastro/src/psastroLoadGhosts.c	(revision 41290)
+++ trunk/psastro/src/psastroLoadGhosts.c	(revision 41338)
@@ -110,5 +110,14 @@
     psPolynomial1D *innerMinor = NULL;
 
+
     pmFPAview *view = pmFPAviewAlloc (0);
+
+    GET_2D_POLY ("GHOST.CENTER.X", centerX);
+    GET_2D_POLY ("GHOST.CENTER.Y", centerY);
+
+    GET_1D_POLY ("GHOST.OUTER.MAJOR", outerMajor);
+    GET_1D_POLY ("GHOST.OUTER.MINOR", outerMinor);
+    GET_1D_POLY ("GHOST.INNER.MAJOR", innerMajor);
+    GET_1D_POLY ("GHOST.INNER.MINOR", innerMinor);
 
     // select the input astrometry data (also carries the refstars)
@@ -119,12 +128,4 @@
     }
     pmFPA *fpa = astrom->fpa;
-
-    GET_2D_POLY ("GHOST.CENTER.X", centerX);
-    GET_2D_POLY ("GHOST.CENTER.Y", centerY);
-
-    GET_1D_POLY ("GHOST.OUTER.MAJOR", outerMajor);
-    GET_1D_POLY ("GHOST.OUTER.MINOR", outerMinor);
-    GET_1D_POLY ("GHOST.INNER.MAJOR", innerMajor);
-    GET_1D_POLY ("GHOST.INNER.MINOR", innerMinor);
 
     // raise an error if the config is broken
@@ -202,4 +203,28 @@
 		    ghostChip = psastroFindChip (&ghost->chip->x, &ghost->chip->y, fpa, ghost->FP->x, ghost->FP->y);
 		    // fprintf (stderr, "-> model chip position: %f, %f\n", ghost->chip->x, ghost->chip->y);
+
+	            psPlane coordFPA,ptCH2;
+    	            psPlane coordCell,ptFP2;
+	            coordCell.x = ghost->chip->x;
+	            coordCell.y = ghost->chip->y;
+                    psPlaneTransformApply(&coordFPA,ghostChip->toFPA,&coordCell);
+	            ptCH2.x = ghost->chip->x;
+               	    ptCH2.y = ghost->chip->y;
+                    psPlaneTransformApply(&ptFP2,ghostChip->toFPA,&ptCH2);
+
+	            psPlane ptCH, ptFP;
+	            ptFP.x = ghost->FP->x;
+               	    ptFP.y = ghost->FP->y;
+                    psPlaneTransformApply (&ptCH, ghostChip->fromFPA, &ptFP);
+
+                    psastroUpdateChipToFPA (fpa, ghostChip);
+	            psPlane ptCH3, ptFP3;
+	            ptCH3.x = ghost->chip->x;
+               	    ptCH3.y = ghost->chip->y;
+                    psPlaneTransformApply(&ptFP3,ghostChip->toFPA,&ptCH3);
+
+
+
+                    psLogMsg ("psastro", 3, "Ghost refpos: %f %f %s pos: %f %f %f %f %f %f %f %f %f %f %f %f mag: %f inshape: %f %f %f outshape: %f %f %f \n", ref->FP->x,ref->FP->y,psMetadataLookupStr(NULL,chip->concepts,"CHIP.NAME"), ghost->FP->x,ghost->FP->y,coordFPA.x,coordFPA.y,ghost->chip->x, ghost->chip->y,ptCH.x,ptCH.y,ptFP2.x,ptFP2.y,ptFP3.x,ptFP3.y, ghost->Mag,ghost->inner.major,ghost->inner.minor,ghost->inner.theta/PM_RAD_DEG,ghost->outer.major,ghost->outer.minor,ghost->outer.theta/PM_RAD_DEG);
 
 		    if (ghostChip) {
