-
Notifications
You must be signed in to change notification settings - Fork 64
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
zGetPSF #66
Comments
Hi Ben, Thanks very much for spreading the word. I have seen these type of problems a few times before (that's the reason why I decided to put the "assert ret == 0" in order to localize the error. Although I don't have an exact solution, but I have noted a few things that could potentially result in this type of problem:
I wish Zemax would have returned a more useful error code. I hope that helps. Best regards, |
Hello Indranil, Thanks much for the help! We already checked your first point and made sure the text encoding is correct. I think that you second point may be spot on because the path he's using is quite long, I'll suggest him to put the Zemax files somewhere else and see if it works well. By the way, I tested a script using zGetPSF on yet another colleague's computer (did I tell you about spreading the word ;-) ), and found a small issue while trying to read the 2D psf_data. Indeed, the zdde regex is looking for number where the exponent contains 3 digits while for some reasons, the text file returned by zemax/OS on my other colleague's computer has only two digits. To prevent this I would suggest transforming the current pattern: pat = (r'(-?\d.\d{4,6}[Ee][-+]\d{3}\s*)' + r'{{{num}}}' into: pat = (r'(-?\d.\d{4,6}[Ee][-+]\d{2,3}\s*)' + r'{{{num}}}' Cheers, Ben |
Hi Ben, Thanks very much for the suggestion on the regex pattern. I will update the code based on your suggestion. Till then I will keep this issue open. Best regards, |
Hello,
I recently gave a piece of code using PyZDDE (trying to preach the good news around) to a colleague and it looks like he's not able to make it work.
From the logs I see that the problem occurs in zGetPSF where the "assert ret == 0" is false (ret gets a value of -1 instead of 0). This value is returned by zGetTextFile. From the documentation I understand that such a value of -1 is associated with the fact that a text file could not be saved (Zemax may not have received a full path name or extention). The log seems quite self-explaining, the problem being that I can't test my colleague's issue further since he's currently not in the country.
So I was wondering whether you already experienced such an issue using zGetPSF, I'm sure it's most likely coming from something we forgot to do at setup but without the possibility to make printouts etc, its tough to solve.
Thanks much for your help,
Best regards,
Ben
The text was updated successfully, but these errors were encountered: