Index: /trunk/psphot/src/psphotLensing.c
===================================================================
--- /trunk/psphot/src/psphotLensing.c	(revision 37928)
+++ /trunk/psphot/src/psphotLensing.c	(revision 37929)
@@ -138,4 +138,6 @@
     psVector *psf_e1sh = psVectorAllocEmpty (300, PS_TYPE_F32);
     psVector *psf_e2sh = psVectorAllocEmpty (300, PS_TYPE_F32);
+    psVector *psf_e1   = psVectorAllocEmpty (300, PS_TYPE_F32);
+    psVector *psf_e2   = psVectorAllocEmpty (300, PS_TYPE_F32);
     psVector *xPos     = psVectorAllocEmpty (300, PS_TYPE_F32);
     psVector *yPos     = psVectorAllocEmpty (300, PS_TYPE_F32);
@@ -178,4 +180,8 @@
 
 	pmModel *model = source->modelPSF;
+
+	float R  = source->moments->Mxx + source->moments->Myy;
+	source->lensingOBJ->e1 = (source->moments->Mxx - source->moments->Myy) / R;
+	source->lensingOBJ->e2 = 2*source->moments->Mxy / R;
 
         psVectorAppend (xPos, model->params->data.F32[PM_PAR_XPOS]);
@@ -191,4 +197,6 @@
         psVectorAppend (psf_e1sh, source->lensingOBJ->shear->e1);
         psVectorAppend (psf_e2sh, source->lensingOBJ->shear->e2);
+        psVectorAppend (psf_e1,   source->lensingOBJ->e1);
+        psVectorAppend (psf_e2,   source->lensingOBJ->e2);
 	Npsf ++;
     }
@@ -247,4 +255,7 @@
     pmTrend2D *trend_e2sh = pmTrend2DAlloc (PM_TREND_MAP, readout->image, Nx, Ny, stats);
 
+    pmTrend2D *trend_e1   = pmTrend2DAlloc (PM_TREND_MAP, readout->image, Nx, Ny, stats);
+    pmTrend2D *trend_e2   = pmTrend2DAlloc (PM_TREND_MAP, readout->image, Nx, Ny, stats);
+
     bool goodFit = false;
     if (!pmTrend2DFit (&goodFit, trendX11sm, NULL, 0xff, xPos, yPos, psfX11sm, NULL)) { psWarning ("failed to measure X11 smear trend"); }
@@ -259,4 +270,7 @@
     if (!pmTrend2DFit (&goodFit, trend_e1sh, NULL, 0xff, xPos, yPos, psf_e1sh, NULL)) { psWarning ("failed to measure  e1 shear trend"); }
     if (!pmTrend2DFit (&goodFit, trend_e2sh, NULL, 0xff, xPos, yPos, psf_e2sh, NULL)) { psWarning ("failed to measure  e2 shear trend"); }
+
+    if (!pmTrend2DFit (&goodFit, trend_e1,   NULL, 0xff, xPos, yPos, psf_e1,   NULL)) { psWarning ("failed to measure  e1 trend"); }
+    if (!pmTrend2DFit (&goodFit, trend_e2,   NULL, 0xff, xPos, yPos, psf_e2,   NULL)) { psWarning ("failed to measure  e2 trend"); }
 
     // evaluate the PSF trend maps at the location of all sources
@@ -295,4 +309,7 @@
 	smear->e1  = pmTrend2DEval (trend_e1sm, xPos, yPos);
 	smear->e2  = pmTrend2DEval (trend_e2sm, xPos, yPos);
+
+	lensing->e1  = pmTrend2DEval (trend_e1, xPos, yPos);
+	lensing->e2  = pmTrend2DEval (trend_e2, xPos, yPos);
     }
 
@@ -309,4 +326,7 @@
     psFree (trend_e2sh);
 
+    psFree (trend_e1);
+    psFree (trend_e2);
+
     psFree (psfX11sm);
     psFree (psfX12sm);
@@ -314,4 +334,5 @@
     psFree (psf_e1sm);
     psFree (psf_e2sm);
+
     psFree (psfX11sh);
     psFree (psfX12sh);
@@ -319,4 +340,8 @@
     psFree (psf_e1sh);
     psFree (psf_e2sh);
+
+    psFree (psf_e1);
+    psFree (psf_e2);
+
     psFree (xPos    );
     psFree (yPos    );
