# Imaging a diffraction grating as it passes through a lens' focal point

I am trying to understand the image created when a coherent light source is incident on a diffraction grating as it is swept through the focal point of a lens. The situation is illustrated in the figure below,

where $$P_1$$ is the object (diffraction grating) plane, located at the lens focal point. $$P_2$$ is the image plane. $$s$$ and $$s'$$ are the distances between $$P_1$$ and the (convex) lens, and $$P_2$$ and the lens, respectively. $$F$$ is the back focal plane of the lens at distance $$f$$ from the lens. $$\theta$$ is the angle of diffraction due to the grating. $$D$$ is the distance between diffraction orders, which have been focused to form bright spots in the back focal plane $$F$$.

In the case where $$P_1$$ is located at the focal point of the lens, and the lens' numerical aperture is large enough to capture sufficient diffraction orders, the image at $$P_2$$ will be a real, magnified, inverted copy of the grating. This is explained nicely at the following link: https://users.physics.ox.ac.uk/~lvovsky/471/labs/abbe.pdf

My question is, assuming that everything else remains the constant, how will the image change as $$s$$ is increased or decreased such that $$P_1$$ no longer lays at the focal point?

I understand that as $$s$$ is increased, higher diffraction orders that lay outside of the lens' numerical aperture will be filtered out, resulting in interference fringes appearing in the grating image. I also believe that there is the effect of point-spread function (PSF) blur to consider? Although I am slightly confused as to how this differs from the aforementioned filtering. Finally, what about the case where $$s$$ is decreased?

Ultimately I am trying to understand whether or not the image at $$P_2$$ can be used to determine how far $$P_1$$ is from the lens focal point.

The general result can be found in Chapter 5.2.2 of Goodman: Introduction to Fourier Optics. Goodman derives Eq.5-19 according to which, aside from a quadratic phase modulation, the focal plane distribution is still the Fourier transform of the input transparency (grating) for any position preceding the lens (In Goodman's notation $$d$$ is what you write for $$s$$). This result is modified in Eq.5-20 to include the vignetting effect of the aperture. (Goodman's book is excellent and it deserves a careful reading.) He makes the point that if you just want to measure the Fourier Transform in the back focal plane then you might as well place the transparency (gratint) right against the lens to minimize vignetting.