Solved

Ghost Focus Generator in Zemax API

  • 9 August 2022
  • 1 reply
  • 289 views

I’m trying to write a script using the Zemax API to run the ghost focus generator, save the files, and then do analysis on the resultant files.

I don’t see anything in the documentation for the API about running the ghost focus generator and searches of the API documentation turn up no results. Is it possible to run the ghost focus generator from the API?  If so, where can I find the syntax?

Thanks!

icon

Best answer by MichaelH 10 August 2022, 01:39

View original

1 reply

Userlevel 6
Badge +2

Hi Ryan,

The ZOS-API Syntax Help is generated directly from the source code so if you don’t see anything in the help files, then it’s not hooked up.  You can also use the HasAnalysisSpecificSettings on the analysis window to check specifically if the analysis has been hooked up yet.  The Generating a list of output data types for each analysis in the ZOS-API article shows how to check if the results are hooked up.

The Ghost Focus Generator simply runs a modified version of TheSystem.LDE.RunTool_MakeDoublePass(), which is hooked up to the ZOS-API.  If you want a single bounce, then you’ll only have to modify the coating of the new system.  If you want to a double bounce, then you’ll have to create a copy of your system, run the MakeDoublePass on the second reflection, run the MakeDoublePass on the first reflection, then add this copy of the modify LDE to the original LDE while removing the unnecessary surfaces. 

As a side note, manually recreating the Ghost Focus Generator can give you greater flexibility of actually calculating the correct intensity of the reflected ray.  When running the built-in version, the Ghost Reflector Coating is applied to all surfaces, regardless of the material.  So if you use a I.04 coating to simulate N-BK7, this will be incorrect for another lens in the stack (say SK16 which needs a I.056 coating).  Granted, it would be a lot of effort but it would be cool if the Fresnel reflections/intensity could be captured for the Ghost Focus Generator.

Reply