Hello I am trying to use the CODA operand in a MeritFunction to evaluate changes in phase between Ex and Ey (i.e., Pxy) due to tolerance errors. During the tolerance application there are situations where vignetting occurs but the CODA operand (Data 110) ignores the vignetting and returns values as if there is no vignetting. Is there a way to get CODA to not report values from vignetted portions of the Pupil? These unwanted "Vignetted" values affect the value that the Merit Function returns.
Hi Fran,
The Merit Function itself is designed with 2 main purposes:
- Drive the Merit Function to 0 to create a “perfect” system
- Speed, speed, and more speed
Since a “perfect” system will have all rays trace to the same point and adding a vignetting/aperture check per optimization cycle will slow down calculation, the concept OpticStudio uses is more rays through the system (even if they are slightly outside the defined aperture), the better. Therefore, OpticStudio does not perform an aperture check for a traced ray for almost all operands (I don’t know of an operand which actually checks if the ray is vignetted or not).
So although there are operands which might be useful primarily for reporting purposes in specific cases like tolerancing where vignetting might change, all operands behave the same and ignore apertures/vignetting checks. For specific operands which use normalized pupil coordinates, there is SVIG
/CVIG
which will run the “Set Vignetting” method in the Field Data Editor, namely compressing and decentering the Entrance Pupil footprint to try to ensure all 4 marginal rays pass to the image plane.
Since it appears you just need to report the changes with CODA
and you don’t need to optimize after a Monte Carlo perturbation, your best bet is to save the individual ZMX/ZOS files from a tolerance run, loop through each ZMX/ZOS file with a script (either ZPL or the ZOS-API), determine the correct vignetting (if any) you need to apply to the given file, and then save the output. This is simple enough that you can do it with a short ZPL script so I don’t think you need to use the ZOS-API. The following Knowledgebase Article talks about how to loop through saved Monte Carlo files; if you use Method 1, then you can add your custom vignetting check to line 47 before calling the OCOD(OPEV(“CODA”), xxx)
function.
How to open consecutively-named lens files using a ZPL macro – Knowledgebase (zemax.com)
Thank you Michael, for your quick and clear response
I will look into processing the individual ZMX/ZOS files generated by the Monte Carlo run
Reply
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.