Skip to content

Commit

Permalink
move stuff around
Browse files Browse the repository at this point in the history
  • Loading branch information
fzimmermann89 committed Mar 16, 2021
1 parent aa890f7 commit 5dc1d12
Show file tree
Hide file tree
Showing 5 changed files with 32 additions and 32 deletions.
1 change: 1 addition & 0 deletions Tex/app_code.tex
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
\chapter{Implementation Details}
All source code is made available under \url{https;//github.com/fzimmermann89/msc}.
\section{Simulation}
In \fref{algo:td} the procedure for time dependent simulations is show.
\begin{algorithm}
Expand Down
2 changes: 1 addition & 1 deletion Tex/experiment.tex
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ \subsection{Preprocessing}
\begin{subfigure}{0.45\textwidth}
\includegraphics[width=\linewidth]{images/mask.png}
\end{subfigure}
\caption{Usable detector area (yellow) of the dual (a) and octal (b) detector after signal correction and statistical filtering. Only the intersection of good areas for each run will be used. This way the same mask and number of correlation pairs will be used for samples that will be compared to each other.}
\caption[Usable detector area]{Usable detector area (yellow) of the dual (a) and octal (b) detector after signal correction and statistical filtering. Only the intersection of good areas for each run will be used. This way the same mask and number of correlation pairs will be used for samples that will be compared to each other.}
\end{figure}

\paragraph{Shot filtering}
Expand Down
Binary file added Tex/images/sharing.pdf
Binary file not shown.
3 changes: 2 additions & 1 deletion Tex/main.tex
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
%\usepackage{refcheck}

\usepackage{tocvsec2}
\settocdepth{section}
\settocdepth{subsection}


%Appendices -> Anhang
Expand Down Expand Up @@ -285,6 +285,7 @@ \chapter*{List of abbreviations and Symbols}
\acro{PS}{Polystyrene}
\acro{MMA}{Methylmethacrylate}
\acro{EHMA}{Etyhlhexymethacrylate}
\acro{PSF}{Point Spread Function}
\end{acronym}

\endgroup
Expand Down
58 changes: 28 additions & 30 deletions Tex/simulation.tex
Original file line number Diff line number Diff line change
Expand Up @@ -14,28 +14,11 @@ \chapter{Simulations}



\paragraph{Detector effects}
To simulate the influence of detector charecteristics charge-sharing and readout noise, an image degradation is performed: After Poisson sampling the simulated speckle image, for each photon an uniform random position within its pixel is chosen as the center of Gaussian distribution with FWHM of 0.15 pixel (similar to the size of the PSF for MPCCD detectors XXX).
The intensity within one pixel is given by the integral over the Gaussian,
\begin{equation}
I(\Delta x,\Delta y)=\frac{1}{4} \left(\text{erf}\left(\frac{\sfrac{1}{2}-\Delta x}{\sqrt{2}
\sigma}\right)+\text{erf}\left(\frac{\sfrac{1}{2}+\Delta x}{\sqrt{2} \sigma}\right)\right) \left(\text{erf}\left(\frac{\sfrac{1}{2}-\Delta y}{\sqrt{2}
\sigma}\right)+\text{erf}\left(\frac{\sfrac{1}{2}+\Delta y}{\sqrt{2} \sigma}\right)\right)
\end{equation}
with $\sigma$ the standard deviation of the Gaussian in pixels and $\Delta x$, $\Delta y$ the distance of the pixel to the chosen photon center, and evaluated for the neighboring pixels. Afterwards a Gaussian readout noise is added. The effect of this degradation on the spectrum is illustrated in \fref{fig:degrad}.


\begin{figure}
\centering
\includegraphics[width=0.6\linewidth]{images/sharing.png}
\caption[Effect of charge sharing and detector noise]{Effect of charge sharing and detector noise on the spectrum of the simulated speckle pattern.}
\label{fig:degrad}
\end{figure}



\section{Time independent Simulations}
In an infinite coherence time, stationary sources approximation, the simulation of the speckle pattern can be performed time independently the superposition of scaler electrical fields emitted with random phases. The simulation of the intensity at multiple discrete points can be performed in parallel using GPU acceleration, resulting in a simple and fast to evaluate model.
In an infinite coherence time, stationary sources approximation, the simulation of the speckle pattern can be performed time independently the superposition of scalar electrical fields emitted with random phases. The simulation of the intensity at multiple discrete points can be performed in parallel using GPU acceleration, resulting in a simple and fast to evaluate model.



Expand All @@ -46,7 +29,17 @@ \section{Time independent Simulations}



\subsection{Reconstruction}
\subsection{Detector effects}
To simulate the influence of detector characteristics charge-sharing and readout noise, an image degradation is performed: After Poisson sampling the simulated speckle image, for each photon an uniform random position within its pixel is chosen as the center of Gaussian distribution with FWHM of 0.15 pixel (similar to the size of the PSF for MPCCD detectors XXX).
The intensity within one pixel is given by the integral over the Gaussian,
\begin{equation}
I(\Delta x,\Delta y)=\frac{1}{4} \left(\text{erf}\left(\frac{\sfrac{1}{2}-\Delta x}{\sqrt{2}
\sigma}\right)+\text{erf}\left(\frac{\sfrac{1}{2}+\Delta x}{\sqrt{2} \sigma}\right)\right) \left(\text{erf}\left(\frac{\sfrac{1}{2}-\Delta y}{\sqrt{2}
\sigma}\right)+\text{erf}\left(\frac{\sfrac{1}{2}+\Delta y}{\sqrt{2} \sigma}\right)\right)
\end{equation}
with $\sigma$ the standard deviation of the Gaussian in pixels and $\Delta x$, $\Delta y$ the distance of the pixel to the chosen photon center, and evaluated for the neighboring pixels. Afterwards a Gaussian readout noise is added. The effect of this degradation on the spectrum is illustrated in \fref{fig:degrad}.



\paragraph{Photon counting}
As the relevant signal for the correlation analysis is the presence of fluorescence photons, but charge sharing and readout noise of the detector as well as the presence of photons caused by air scattering degrades this signal, different approaches of preprocessing will be compared:
Expand All @@ -66,15 +59,17 @@ \subsection{Reconstruction}
\begin{figure}
\centering
\begin{subfigure}[b]{0.45\textwidth}
\includegraphics[width=\linewidth]{images/hist.pdf}
\caption{Histogram}
\includegraphics[width=\linewidth]{images/sharing.pdf}
\fref{fig:degrad}
\caption{True Histogram and Degradation}
\end{subfigure}
\begin{subfigure}[b]{0.45\textwidth}
\includegraphics[width=\linewidth]{images/probs.pdf}
\label{fig:probs}
\caption{Probabilities and Decision Boundaries}
\end{subfigure}
\label{fig:probs}
\caption[Histogram, probabilities and decision boundaries for the photon number]{For a Poisson distributed signal with mean 0.01 photons/pixel, a Poisson distributed scattering with mean 0.001 photons/pixel and an photon energy of 1.3 times the energy of a signal photon, a charge sharing PSF with $\sigma$ 0.1 pixel and a Gaussian noise with $\sigma$ 0.05 photons, the simulated histogram is shown on the left. The probabilities of an observed energy being caused by a certain number of signal photons is shown on the right, the dashed lines mark the decision boundaries for an Bayesian classifier.}

\caption[Histogram, probabilities and decision boundaries for the photon number]{For a Poisson distributed signal with mean 0.01 photons/pixel, a Poisson distributed scattering with mean 0.001 photons/pixel and an photon energy of 1.3 times the energy of a signal photon, a charge sharing PSF with $\sigma$ 0.1 pixel and a Gaussian noise with $\sigma$ 0.05 photons, the simulated histogram is shown on the left. Detector noise, charge sharing scattering photons degrade the histogram. The probabilities of an observed energy being caused by a certain number of signal photons is shown on the right, the dashed lines mark the decision boundaries for an Bayesian classifier.}
\end{figure}
For comparison, the PSANA Photon algorithm, a droplet algorithm considering only the signal photons is used \ref{psana}.

Expand All @@ -83,23 +78,27 @@ \subsection{Reconstruction}



\paragraph{Normalisation}
\subsection{Normalisation}
Mean of all pixels
Mean of all pixels inside the overlap

If only a single image is taken, the expectation value for each pixel has to be approximated.

If multiple images are taken, under the assumption of ergodicity, the expectation value for each pixel can be approximated by its mean over many images. To account for fluctuations in the exciting FEL pulse and resulting fluctations of the fluorescence intensity, it can be assumed that the distribution over pixel intensities and FEL intensities are uncorrelated, and the detection probability of each pixel in each shot can be factorized into the product of the probability to detect a photon in a pixel and to detect a photon in a shot. Therefor, the effect of the FEL intensity fluctuations can be suppressed by normalizing each image by the total intensity of the image.
\subsection{Single Sphere}
radial symmetrie

\subsection{Multiple Spheres}


\subsection{Crystal}
\subsection{Autocorrelation}

\subsection{Accessible Reciprocal Space}
\paragraph{Crystal}
\paragraph{Spherical Samples}

\subsection{Multiple Samples}




\subsection{Superlattice}

\section{Time dependent Simulations}

Expand Down Expand Up @@ -164,6 +163,5 @@ \section{Time dependent Simulations}
\end{figure}



\section{Implications for an experimental design}

0 comments on commit 5dc1d12

Please sign in to comment.