  We develop and test a method for measuring the gravitational lensing induced
distortion of faint background galaxies. We first describe how we locate the
galaxies and measure a 2-component `polarisation' or ellipticity statistic
$e_\alpha$ whose expectation value should be proportional to the gravitational
shear $\gamma_\alpha$. We then show that an anisotropic instrumental psf
perturbs the polarisation by $\delta e_\alpha = P^s_{\alpha\beta} p_\beta$,
where $p_\alpha$ is a measure of the psf anisotropy and $P^s_{\alpha\beta}$ is
the `linearised smear polarisability tensor'. By estimating $P^s_{\alpha\beta}$
for each object we can determine $p_\alpha$ from the foreground stars and apply
a correction $-P^s_{\alpha\beta}p_\beta$ to the galaxies. We test this
procedure using deep high-resolution images from HST which are smeared with an
anisotropic psf and then have noise added to simulate ground-based
observations. We find that the procedure works very well. A similar analysis
yields a linear shear polarisability tensor $P^\gamma_{\alpha\beta}$ which
describes the response to a gravitational shear. This calibrates the
polarisation-shear relation, but only for galaxies which are well resolved. To
empirically calibrate the effect of seeing on the smaller galaxies we
artificially stretch HST images to simulate lensing and then degrade them as
before. These experiments provide a rigorous and exacting test of the method
under realistic conditions. They show that it is possible to remove the effect
of instrumental psf anisotropy, and that the method provides an efficient and
quantitative measurement of the gravitational shear.
