  We examine the equations to obtain atomic pair distribution functions (PDFs)
from x-ray, neutron and electron powder diffraction data with a view to
obtaining reliable and accurate PDFs from the raw data using a largely \emph{ad
hoc} correction process. We find that this should be possible under certain
circumstances that hold, to a reasonably good approximation, in many modern
experiments. We describe a variational approach that could be applied to find
data correction parameters that is highly automatable and should require little
in the way of user inputs yet results in quantitatively reliable PDFs, modulo
unknown scale factors that are often not of scientific interest when profile
fitting models are applied to the data with scale-factor as a parameter. We
have worked on a particular implementation of these ideas and demonstrate that
it yields PDFs that are of comparable quality to those obtained with existing
x-ray data reduction program PDFgetX2. This opens the door to rapid and highly
automated processing of raw data to obtain PDFs.
