xzos / PyZDDE

Zemax/ OpticStudio Extension using Python
MIT License
159 stars 67 forks source link

truncation of pupil/field coordinates in getTrace() and other related functions #81

Open robbarnsley opened 6 years ago

robbarnsley commented 6 years ago

Hi,

First off, thanks for the work you put into this.

I have an issue with:

https://github.com/indranilsinharoy/PyZDDE/blob/45dff7042b074574ef0ba5b6e8ee4155689f02bf/pyzdde/zdde.py#L3396

I am unsure why the float is truncated to 4 dp - it seems you're unnecessarily throwing away 32bit float precision. I have a ZPL macro utilitising a raytrace that is particularly sensitive to the pupil/field coordinates and the code above produces inconsistent results between ZPL/PyZDDE raytrace calls with the same input parameters.