Skip to main content

Please do me a favor. Zemax has the function "Image Simulation". I can do this interactively. Now, I want to use "Image Simulation" to simulate 2000 frame images. Therefore, I want to use SampZOS-API Matlab programming to automatically do it. 

 

I have learned the code ZOS-API\Sample Code\MATLAB\MATLABStandalone_04_pull_data_from_FFTMTF.m" to acquire MTF curves. Would you please tell me how to program codes. The codes can realize to load, simulate and save 2000 frame images based on "Image Simulation" moduale.

 

It would be appreciated if you could reply me as soon as possible.

Hi Buddy,

 

Similar to the FFT MTF, you can call the Image Simulation analysis with the line:

TheImageSimulation = TheSystem.Analyses.New_ImageSimulation()

The issue is, for that particular analysis, the settings and data grids aren’t available. It means, you can only run it, and it’ll execute based on the settings you’ve saved, and for the image to be created, you’d have had to set a filename before saving the settings manually. Also, because of that, the ZOS-API will save to the same image file, so you probably need to rename it in-between iterations of the loop. Finally, it might be tricky if you want to modify the settings of Image Simulation during the execution of your loop.

Let me know if this is clear, or if you have additional questions.

Take care,

 

David


Hi!

To follow on David’s answer, you can modify the settings but using the “old” method called MODIFYSETTINGS. The Image Simulation is not fully implemented, so in that case the settings can be changed via the MODIFYSETTINGS method. The details can be found in the help file:

Have a look at this post

I have listed there some examples:

 


Reply