In the Footprint Diagram Analysis Feature, the maximum and minimum ray X and Y dimensions are provided on the plot. Is there a way to access these same values from the merit function? I would like to know the maximum ray X and Y coordinates for each applied tolerance and monte carlo file, without having to refresh the Footprint Diagram window for every change. Thank you
Footprint Diagram Ray min and max values
Best answer by David.Nguyen
Dear Taylor,
My pleasure.
It is possible to specify different settings, but it is not straightforward as this analysis window is not fully implemented in the ZOS-API yet. I think the developers at Zemax are constantly working on implementing all the existing features, but it takes time.
Let me show you how I would do it for the Surface, and I'll let you adapt the code for the other settings.
First, here is how the final result look like:
The idea is to use the Hx parameter of the UDOC operand to specify the Surface where you want your Footprint diagram.
The code needs to create a *.CFG file, which contains the settings of the Footprint Diagram, update the file with the correct surface number, and apply the changes before reading the values.
You can find the code here on my GitHub. The new part is in lines 85-97. As you can see, I made it such that any values of Hx below zero would use the default settings. Once again, there's no error trapping, and if you put a floating point value in Hx, it will probably truncate it. Also, in making the modification, I noticed my code wasn't reading scientific notation correctly. I've updated the REGEX expression in line 119 to correct it.
You can use Hy, Px, and Py to define other settings of the Footprint Diagram. The string codes for the Footprint Diagram can be found in the Help File under: The Programming Tab > About the ZPL > KEYWORDS (about the zpl) > MODIFYSETTINGS (keywords). I'm also copying it here for your reference:
FOO_RAYDENSITY: The ray density. Use 0 for ring, 1 for 10, 2 for 15, 3 for 20 etc.
FOO_SURFACE: The surface number.
FOO_FIELD: The field number.
FOO_WAVELENGTH: The wavelength number.
FOO_DELETEVIGNETTED: Delete vignetted, use 0 for no, 1 for yes.
As you can see, there are 5 settings, which can be changed, but only four parameters in the UDOC (Hx, Hy, Px, Py). However, this is not a problem. What you can do is encode the information in the number you pass to the UDOC. For example, you could use Hx for the Surface, and Field number. You could send a value 20006, and you could read the value 2 as the surface number, and the value 6 as the field number, for example.
Let me know if this makes sense.
Take care,
David
Reply
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.