-
Notifications
You must be signed in to change notification settings - Fork 67
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
problem for setting system aperture #61
Comments
Some more information : |
Hi @je-ro-me, Honestly I don't know what's going on. It seems very strange because there is NO reason AFAIK why the system aperture would change automatically by calling |
Hi @indranilsinharoy In any case, using the old (problematic) file:
|
Hi @je-ro-me, I really don't have any idea why this is happening. This is not an expected behavior, and in my few years of using PyZDDE, I have never faced such an issue. Also, this type of cases are hard to debug without the lens file. However, I am almost certain that the problem is not due to PyZDDE. As far as ensuring that you have created the new design without missing any parameters, I would start with the following:
|
Hi @indranilsinharoy
The end of the new Zemax file:
The end of the old Zemax file (for which link.zSetSystemAper() doesn't work):
If I delete the two lines that start with "STPS" (for stop system? seems to indicate that the system stop is at surface 1) and "APER" (seems to set the system aperture size), then the call to link.zSetSystemAper() works well! |
That's interesting. However, I don't know exactly what settings in lens design (adds the two lines in the end) and prevents modification of the aperture settings via an external interface. I will keep your findings in mind in future. Thanks. I'm glad that you were able to resolve the problem. Also, since it is not really a PyZDDE issue, I am going to close it. |
I work with a Zemax file provided by a customer (so unfortunately, I cannot share it). It's a simple refractive telescope with 6 lenses.
My problem is: I cannot change the position of the system aperture STOP with PyZDDE.
I can do it manually in Zemax, it works well and there's nothing special.
If I use the following code:
`import pyzdde.zdde as pyz
filename = "C:\Zemax Model\Instrument_telescope.zmx"
link = pyz.createLink()
link.zLoadFile(filename)
link.zPushLens()
number of surfaces
print link.zGetNumSurf()
changing STOP position
print link.zGetSystemAper()
link.zSetSystemAper(aType=3,stopSurf=3,aperVal=20.)
print link.zGetSystemAper()
link.zPushLens()
print link.zGetSystemAper()
link.close()`
I get the following results:
Did I forget something ? Or could it be a bug ?
I checked with two other files (the Zemax sample Double Gauss 5 degrees, and another telescope from a different customer) and did not get this problem. This is an issue for me as I am writing a code that must be used with any optical system.
Thanks for the help
Jerome
The text was updated successfully, but these errors were encountered: