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:
[ ] I have added tests to cover my changes
[ ] All the tests are passing, including my new ones
[ ] I described my changes in this PR description
Optional:
[ ] The code I wrote follows good style practices (see PEP 8 and PEP 20).
[ ] I have updated the docs in relation to my changes, if applicable
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: