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
Originally opened by Eskil Vik in the gitlab repo: https://gitlab.cern.ch/IRIS/pywit/-/merge_requests/25
I upload this now as I am going on vacation for some weeks, and the work in progress might be of interest before I return. Anyone can feel free to take over the MR and finish the feature.
This is a draft of how conversion from impedances to wakes can be implemented in pywit, using the neffint package. Note that at this depends on Pull Request 4 in the neffint repository, which at the time of writing is not merged yet.
The neffint package provides functions to perform fourier integration on of a function over an array of non-equidistantly spaced frequencies. The package works best when supplied with a frequency array which catches all important features of the function to integrate (in this case the impedance). The existing procedure for discretizing the frequency array found in wake_to_array and impedance_to_array is therefore reused here, as they have the possibility to define regions of interest. To this end, those functions were slightly refactored as well.
There is also an upcoming feature in neffint to implement the adaptive procedure for finding frequencies used in IW2D. Rudimentary testing with this method shows however that it works best when it given an already decent frequency grid as a starting point. I therefore expect that if we implement that in pywit, it will be very similar to what is done here for the fixed grid, only that there will be an extra step to refine the frequency grid with the adaptive method.
I should mention that I have done very little testing of the suggested changes, and before merge pytests, docstring, etc. would have to be added.
Checklist
Mandatory:
Optional: