  Data analysis methods have always been of critical importance for
quantitative sciences. In astronomy, the increasing scale of current and future
surveys is driving a trend towards a separation of the processes of low-level
data reduction and higher-level scientific analysis. Algorithms and software
responsible for the former are becoming increasingly complex, and at the same
time more general - measurements will be used for a wide variety of scientific
studies, and many of these cannot be anticipated in advance. On the other hand,
increased sample sizes and the corresponding decrease in stochastic uncertainty
puts greater importance on controlling systematic errors, which must happen for
the most part at the lowest levels of data analysis. Astronomical measurement
algorithms must improve in their handling of uncertainties as well, and hence
must be designed with detailed knowledge of the requirements of different
science goals. In this thesis, we advocate a Bayesian approach to survey data
reduction as a whole, and focus specifically on the problem of modeling
individual galaxies and stars. We present a Monte Carlo algorithm that can
efficiently sample from the posterior probability for a flexible class of
galaxy models, and propose a method for constructing and convolving these
models using Gauss-Hermite ("shapelet") functions. These methods are designed
to be efficient in a multi-epoch modeling ("multifit") sense, in which we
compare a generative model to each exposure rather than combining the data from
multiple exposures in advance. We also discuss how these methods are important
for specific higher-level analyses - particularly weak gravitational lensing -
as well as their interaction with the many other aspects of a survey reduction
pipeline.
