WIP: Beam Phase Space Reconstruction - MENT Algorithm #287
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
This pull request adds a script to perform tomographic reconstructions of the transverse phase space of electron beam using the maximum entropy method (MENT) described in:
J. J. Scheins. Tomographic Reconstruction of Transverse and Longitudinal Phase Space Distributions using the Maximum Entropy Algorithm. DESY, May 10, 2004.
Objective
The goal is to reconstruct the beam's phase space at the end of the LINAC, using quadrupole scans and the emittance measurement screen.
Implementation
Script
ment_reconstruction.py
The script reconstructs two-dimensional distributions from their one-dimensional projections. It includes the following main classes:
ScreenProcess
Responsible for processing screen images. It provides functionalities such as scaling, cropping, and extracting projections from images.
ConvexPolygon
Defines a grid of convex polygons constructed from the intersection of lines derived from the projections bins and transformed by transformation matrices
DistribReconstruction
It performs the reconstruction of the beam distribution using the provided projections and applying MENT algorithm.
Additionally, the script includes auxiliary functions to facilitate visualization such as
plot_lines
,plot_convex
,paint_convex
.Script
trans_matrices.py
This script implements typical two-dimensional matrices used in
ConvexPolygon
to transform projection bins.Notebook
reconstruction_from_grid.ipynb
It demonstrates the method's implementation, using a simulated two-dimensional gaussian distribution
Testing, Validation and Next Steps
Initial tests were performed with simulated data in the notebook. The results indicate that the method successfully reconstructs gaussian distributions. The method are being used to reconstruct images from LINAC's screens.