(WIP) Far-field calculation using Fraunhofer diffraction - #398
Open
mjvstreeter wants to merge 13 commits into
Open
(WIP) Far-field calculation using Fraunhofer diffraction#398mjvstreeter wants to merge 13 commits into
mjvstreeter wants to merge 13 commits into
Conversation
Added file to utils folder which uses np.fft to propagate field to farfield. Currently in testing only - not fully implemented Added method to Laser class to propagate to focus for a given focal length.
Added ability for apply_optics method to remember optics. Include application of optics in far field calculation. The focusing phase terms should be relative to the nominal focus - i.e. for the inclusion of small focal shifts or for chromatic focusing.
Added delay term to polynomial spectral phase term
Added hack of axiprop stepper and propagatorFF2 classes to allow for building of x,z,omega or y,z,omega slices. This is like export_to_z but without summing over frequencies. This allows for subsequent changes to spectral phase when summing.
This reverts commit f978554.
This reverts commit 1d1f737.
This reverts commit b2b56f5.
Re-ordered functions so that main functions are first
Fixed use of laser profile for building pulse in warped coordinates
Created test of farfield calculation comparing gaussian beam to analytical predication.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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!