Index: branches/eam_branches/ipp-20110710/psModules/src/objects/pmSourceIO_CMF_PS1_V1.c
===================================================================
--- branches/eam_branches/ipp-20110710/psModules/src/objects/pmSourceIO_CMF_PS1_V1.c	(revision 31852)
+++ branches/eam_branches/ipp-20110710/psModules/src/objects/pmSourceIO_CMF_PS1_V1.c	(revision 31924)
@@ -71,8 +71,8 @@
         pmSource *source = (pmSource *) sources->data[0];
         if (source->seq == -1) {
-          // let's write these out in S/N order
-          sources = psArraySort (sources, pmSourceSortByFlux);
+	    // let's write these out in S/N order
+	    sources = psArraySort (sources, pmSourceSortByFlux);
         } else {
-          sources = psArraySort (sources, pmSourceSortBySeq);
+	    sources = psArraySort (sources, pmSourceSortBySeq);
         }
     }
@@ -97,5 +97,5 @@
         // generated on Alloc, and would thus be wrong for read in sources.
         if (source->seq == -1) {
-          source->seq = i;
+	    source->seq = i;
         }
 
@@ -600,63 +600,4 @@
 }
 
-bool pmSourceLocalAstrometry (psSphere *ptSky, float *posAngle, float *pltScale, pmChip *chip, float xPos, float yPos) {
-
-    pmFPA *fpa = chip->parent;
-
-    if (!chip->toFPA) goto escape;
-    if (!fpa->toTPA) goto escape;
-    if (!fpa->toSky) goto escape;
-
-    // generate RA,DEC
-    psPlane ptCH, ptFP, ptTP_o, ptTP_x, ptTP_y;
-
-    // calculate the astrometry for the coordinate of interest
-    ptCH.x = xPos;
-    ptCH.y = yPos;
-    psPlaneTransformApply (&ptFP, chip->toFPA, &ptCH);
-    psPlaneTransformApply (&ptTP_o, fpa->toTPA, &ptFP);
-    psDeproject (ptSky, &ptTP_o, fpa->toSky);
-
-    // calculate the astrometry for the coordinate + 1pix in X
-    ptCH.x = xPos + 1.0;
-    ptCH.y = yPos;
-    psPlaneTransformApply (&ptFP, chip->toFPA, &ptCH);
-    psPlaneTransformApply (&ptTP_x, fpa->toTPA, &ptFP);
-
-    // calculate the astrometry for the coordinate + 1pix in Y
-    ptCH.x = xPos;
-    ptCH.y = yPos + 1.0;
-    psPlaneTransformApply (&ptFP, chip->toFPA, &ptCH);
-    psPlaneTransformApply (&ptTP_y, fpa->toTPA, &ptFP);
-
-    // the resulting Tangent Plane coordinates are in TP pixels; convert to local Tangent Plane
-    // degrees
-
-    float dTPx_dCHx = fpa->toSky->Xs * (ptTP_x.x - ptTP_o.x);
-    float dTPy_dCHx = fpa->toSky->Ys * (ptTP_x.y - ptTP_o.y);
-
-    float dTPx_dCHy = fpa->toSky->Xs * (ptTP_y.x - ptTP_o.x);
-    float dTPy_dCHy = fpa->toSky->Ys * (ptTP_y.y - ptTP_o.y);
-
-    float pltScale_x = hypot(dTPx_dCHx, dTPy_dCHx);
-    float pltScale_y = hypot(dTPx_dCHy, dTPy_dCHy);
-    *pltScale = 0.5*(pltScale_x + pltScale_y);
-
-    float posAngle_x = atan2 (+dTPy_dCHx, +dTPx_dCHx);
-    float posAngle_y = atan2 (-dTPy_dCHy, +dTPx_dCHy);
-    *posAngle = 0.5*(posAngle_x + posAngle_y);
-
-    return true;
-
-escape:
-    // no astrometry calibration, give up
-    ptSky->r = NAN;
-    ptSky->d = NAN;
-    *posAngle = NAN;
-    *pltScale = NAN;
-
-    return false;
-}
-
 bool pmSourcesWrite_CMF_PS1_V1_XRAD(psFits *fits, pmReadout *readout, psArray *sources, psMetadata *imageHeader, char *extname, psMetadata *recipe)
 {
