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

Pass omega0 when applying optical element #261

Merged
merged 4 commits into from
Jul 17, 2024

Conversation

soerenjalas
Copy link
Contributor

@soerenjalas soerenjalas commented Jul 16, 2024

For many optical elements the central laser frequency needs to be known. With this PR it is passed when calling apply_optics

Edit: I turned OpticalElement into an abstract class to ensure that all child implementations of amplitude_multiplier use x,y,omega,omega0 as arguments. I'm also fine with reverting this if you don't like it.

@soerenjalas soerenjalas requested a review from RemiLehe July 16, 2024 12:42
@@ -184,7 +184,7 @@
# The line below assumes that amplitude_multiplier
# is cylindrically symmetric, hence we pass
# `r` as `x` and 0 as `y`
multiplier = optical_element.amplitude_multiplier(r, 0, omega)
multiplier = optical_element.amplitude_multiplier(r, 0, omega, omega0)

Check failure

Code scanning / CodeQL

Wrong number of arguments in a call Error

Call to method ParabolicMirror.amplitude_multiplier with too many arguments; should be no more than 3.
@@ -196,7 +196,7 @@
x, y, omega = np.meshgrid(
self.grid.axes[0], self.grid.axes[1], omega_1d, indexing="ij"
)
spectral_field *= optical_element.amplitude_multiplier(x, y, omega)
spectral_field *= optical_element.amplitude_multiplier(x, y, omega, omega0)

Check failure

Code scanning / CodeQL

Wrong number of arguments in a call Error

Call to method ParabolicMirror.amplitude_multiplier with too many arguments; should be no more than 3.
@MaxThevenet MaxThevenet changed the title Pass omega0 when applying optical element [WIP] Pass omega0 when applying optical element Jul 16, 2024
@soerenjalas soerenjalas changed the title [WIP] Pass omega0 when applying optical element Pass omega0 when applying optical element Jul 16, 2024
@RemiLehe RemiLehe merged commit 19cd6ee into LASY-org:development Jul 17, 2024
6 checks passed
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants