Skip to main content

Hello everyone,

I'm trying to extract the combined Huygens Point Spread Function (PSF) of a multiconfiguration system using either ZPL or the ZOS-API. In OpticStudio, I can achieve this directly by selecting "All" in the configuration button under the Huygens PSF settings, which provides the result I need. However, I'm having trouble replicating this setting in ZPL or ZOS-API, as I haven't been able to find an equivalent command or setting to retrieve the combined PSF programmatically.

Has anyone here managed to access this setting through ZPL or ZOS-API, or is there an alternative approach to obtaining the combined Huygens PSF across configurations?

Thanks in advance for any guidance or examples you might be able to provide!

Cheers!

Hi Paula,

I don’t believe there is a way of changing between an individual config and using all the configurations.  However, this option appears to be saved in the CFG file for the analysis.  So you can setup your Huygens PSF window with the different CFG files (one for Current and one for All) and then use win.LoadFrom() to switch between a single configuration or all the configurations.   

@David.Nguyen has a really good writeup for a step-by-step guide in the following answer: 

How to change 3D layout properties via ZOSAPI | Zemax Community


Thank you Michael for your quick response. I’ll try it right away. Thanks!


However, this option appears to be saved in the CFG file for the analysis.  So you can setup your Huygens PSF window with the different CFG files (one for Current and one for All) and then use win.LoadFrom() to switch between a single configuration or all the configurations. 

 

Just out of interest, would it be possible to then do the following using the API:

  1. Create a new analysis
  2. Use GetSettings().LoadFrom(file.cfg) to switch to all configurations
  3. Adjust other settings using GetSettings() as one would normally do using the API
  4. Run the analysis

That way, this flow can be kind of implemented without having a different configuration file for every possible (or desired) combination of settings. 

 

Of course, this is only relevant if you want to run all the configurations at once, as requested in this post. Else, you could simply switch configurations and run the tests.


Reply