\section{Source\_flat: A flat surface emitting photons with a spectrum either uniform, gaussian or generated from a datafile}
\label{source-flat}
\index{Sources!Flat surface source}
\mcdoccomp{sources/Source_flat.parms}

A simple source model, with a flat surface emitting photons. The surface in the
$xy$-plane is specified as a rectangle with dimensions
$\mathit{xwidth}\times \mathit{yheight}$ \si{m \squared}, or as a circle with \textit{radius} \si{m}. 
The initial x-ray position is chosen randomly in the source surface --- its
wavevector is chosen randomly (exactly as in the case of \textbf{Source\_pt})
(section \ref{s:source-pt}) in the defining aperture with height \textit{focus\_yh} and
width \textit{focus\_xw} placed at $(0,0,\mathit{dist})$. 

Just as for \textbf{Source\_pt} the aperture is for efficiency purposes and, if misused, may cause biasing.

With the exception of source size related parameters, all other parameters are
identical to \textbf{Source\_pt} Note that this also applies to coherence and
photon phase. If \textit{randomphase}$=0$ then a photon emitted from
$(x_0,y_0,0)$ will in phase with a photon emitted from $(x_1,y_1,0)$. I.e. full
transversal coherence.
