Hi,
I am using the ZOS-API interface with Python (pythonnet 2.5.2.) to set the coefficients for a Zernike Standard Sag surface, one at a time. It takes several seconds!! Is there any faster way, or a way to set all parameters at once?
I’d like to run a Monte Carlo analysis with thousands of istances of zernike surfaces, so a faster way would be really beneficial.
%timeit M1_surf.GetCellAt(30).DoubleValue = 6.46449601150208e-06
386 ms ± 28.1 ms per loop (mean ± std. dev. of 7 runs, 1 loop each)%timeit M1_surf.SurfaceData.SetNthZernikeCoefficient(4, 6.46449601150208e-06)
354 ms ± 27.5 ms per loop (mean ± std. dev. of 7 runs, 1 loop each)
As a comparison, reading a value is three orders of magnitude faster:
%timeit M1_surf.GetCellAt(30).DoubleValue
513 µs ± 78.3 µs per loop (mean ± std. dev. of 7 runs, 1000 loops each)
The LDE is the only open window, so there are no analyses being updated.
Any help would be very much appreciated!
Paolo
Best answer by MichaelH
View original