Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Fix complex interpolation in FromArrayProfile method #230

Merged

Conversation

hightower8083
Copy link
Member

This PR fixes the issue with using scipy's RegularGridInterpolator with complex numbers used in FromArrayProfile. While the amplitude and phase of the complex field normally vary smoothly in space and time, the real and imaginary parts typically strongly oscillate, which results in erroneous results.

See here an example of the field read from measurement file: on the original grid (left) and with time axis refined by 4
image

This PR replaces the single interpolation operation with real-valued amplitude and phase (unwrapped along t) interpolations. This fixes the issue with refined grid:
image

@hightower8083 hightower8083 added the bug Something isn't working label Feb 15, 2024
Copy link
Contributor

@MaxThevenet MaxThevenet left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, thanks!

@MaxThevenet MaxThevenet merged commit 962b5a2 into LASY-org:development Mar 4, 2024
6 checks passed
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants