Plots with different axes #125
-
Hi all: First of all, thanks for making this amazing project. I have been looking for a long time for an open source optical design software such as this one. I'm trying to understand how to use optiland to design non-rotationally symmetric systems. The tutorial is a very good start, but I'm struggling to plot the 2d view and in particular the spots diagrams for a pair of axes other than the default. For example, if in the tutorial system I remove the last mirror and plot the spot pattern in a shifted surface in the x-z plane , I get a
I tried looking into spot.data, but only x,y coordinates are available. I also tried, unsuccesfully, to get the fields to propagate down from y=+np.inf to rotate the whole system. Is there a way to tell Optiland to change the default axes for its diagrams? (I'm thinking something like plotting the diagrams in the local coordinate system of the surface). A similar issue would appear when trying to use the draw() method for a system with elements rotated in an axis other than x. Thanks in advace! |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 6 replies
-
Hi @nsotom, Thanks for the kind words. There are a few things to point out here. Optiland assumes the optical axis is along z, with light propagating in the +z direction. This currently cannot be configured otherwise. Second, as you pointed out, the spot = SpotDiagram(lens, fields=[(0, 1)], axes="xz")
spot.view() This would not be too difficult to implement for the If you'd like a workaround, you can manually retrieve, then plot ray intersection points using As for plotting on other axes, this is also not supported, but in theory is also possible. I will consider adding this to the roadmap, but it will not have high priority. If needed, plotting in 3D may be a suitable alternative. Regards, |
Beta Was this translation helpful? Give feedback.
-
Hi @nsotom :) As I mentioned in my other message, I believe you had a different version of Optiland where this bug was still not fixed. Like you and @HarrisonKramer suggested, I also like the idea of passing |
Beta Was this translation helpful? Give feedback.
Hi @nsotom,
Thanks for the kind words.
There are a few things to point out here. Optiland assumes the optical axis is along z, with light propagating in the +z direction. This currently cannot be configured otherwise. Second, as you pointed out, the
SpotDiagram
data does not includez
points. There is not currently a way to tell Optiland to change the axes for diagrams, but this is certainly something that could be added. How would you like to see that implemented? I can imagine something like the following:This would not be too difficult to implement for the
SpotDiagram
. It may be more difficult for other analyses, but I w…