\section{Source\_pt: A mathematical point emitting photons with a spectrum either uniform, gaussian or generated from a datafile}
\label{s:source-pt}
\index{Sources!Point source}
\mcdoccomp{sources/Source_pt.parms}

The simplest source model, where a mathematical point source at $(0,0,0)$ emits photons. The wavevector of the emitted photons
is picked randomly in a defining aperture \emph{focus\_xw} by \emph{focus\_yh} m at $(0,0,\mathit{dist})$. 
Please note that this aperture is merely a
virtual aperture used to reduce the sampling space. This has a few
implications: Other components may be placed without reference to the aperture,
but if the aperture does not fill the full acceptance window of subsequent
components your simulations will be biased. The aperture is simply there to provide efficient sampling.

If a \textit{spectrum\_file} is not supplied, the xray
is given a weight which is the total wavelength-integrated intensity downscaled
by the solid angle subtended by the defining aperture.
The Energy/wavelength spectrum of the emitted photons is centered around \textit{E0} or  $\lambda 0$ with a width of \textit{dE} or $d\lambda$ respectively. 
\textit{E0} takes precedence over $\lambda0$. Thus if $E0\neq0$ the the combination \textit{E0, dE} is used, $\lambda0,d\lambda$ otherwise.
If \textit{gauss} (the default) is set to be non-zero the spectrum is Gaussian with mean \textit{E0} ($\lambda 0$) and standard deviation \textit{dE} ($d\lambda$), otherwise the
spectrum is uniform in \textit{E0}$\pm$\textit{dE} ($\lambda 0\pm d\lambda$).

If a \textit{spectrum\_file} \emph{is} supplied, a slightly different strategy is adopted. In this case the
wavelength/energy range implied by the datafile is sampled unformly and each ray is assigned
a weight corresponding to the intensity indicated by linear interpolation between datapoints
at that wavelength. This implies an oversampling of weak parts of the intensity spectrum.

Currently only completely coherent or fully incoherent beams are supported. If
\textit{randomphase} is specified emitted photons will be assigned a random phase, otherwise it is
set to the value of \textit {phase}.

