(WIP) Far-field calculation using Fraunhofer diffraction #398
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.
This code adds the go_to_farfield method to the laser class to allow cheap calculation of the far field from beam defined in the near field. A focal length is supplied to the code which is used to definte the steps size in angle for the wave components and changes the axis size after the fourier transform.
In order to make this work i also modified the apply_optics method which can now build a list of the applied optics. This is used to rebuild the near-field pulse on a warped grid so that regular axes can be used for the farfield.
Note - the parabolic phase term for the focusing is implicit in the method and so should not be added to the near field pulse.
The fraunhofer.py file was added to laser.utils to contain the required functions.
A test file was also added to compare the calculations for gaussian beam to the analytical predictions.
I've used this for calculating the focus of more realistic near field profiles (high order supergaussians). And initialised the pulses in fbpic to run simulations. It is likely that development of lasy propagators will be able to perform similar calculations in future in a less hacky way.
Happy for anyone to suggest changes or fixes if anything is not working as expected!