We can first check if the certain analysis has setting interface by using the HasAnalysisSpecificSettings property:
my_analysis.HasAnalysisSpecificSettings
If settings are available, then settings can be configured directly.
Or we can search from OpticStudio helpfile to see if the analysis supported by ModifySettings methods, since the use of the method is similar to ZPL keywords, so we can check supported analysis and type code from the following chapter in helpfile: The Programming Tab > About the ZPL > KEYWORDS (about the zpl) > MODIFYSETTINGS (keywords)
If settings are supported by MODIFYSETTINGS, the settings can be configured by using ModifySettings method.
If none of the above situations apply for the application, a workaround is provided.
After compare the three analysis features, we found that:
HasAnalysisSpecificSettings
supported by ModifySettings?
type code for Modifysettings
Spot Diagram
True
Yes
SPT_RAYS
Extended Diffraction Image Analysis
False
Yes
EXD_FILESIZE
Partially Coherent Image Analysis
False
Yes
NA
The following code snippet is written with Python
For Spot Diagram :
newSpot = TheApplication.PrimarySystem.Analyses.New_StandardSpot()
print("Spot has analysis specific settings? ", newSpot.HasAnalysisSpecificSettings) # True; no ModifySettings
newSettings = newSpot.GetSettings()
spotSet = CastTo(newSettings, "IAS_Spot") # Cast to IAS_Spot interface; enables access to Spot Diagram properties
spotSet.RayDensity = 15
newSpot.ApplyAndWaitForCompletion()
The workaround for Partially Coherent Image Analysis would be:
Open a blank file- LENS.ZMX, open Partially coherent image analysis window and Merit function editor
Uncheck Auto apply
Configure the analysis window with settings you will use later
Add ZPLM(mac#21) into MFE. Click update button in merit function editor (ZPL file being attached, you may change the highlighted part to fit your situation )
It will ask you to input the filename, which will be the saved CFG filename
These steps can be repeated until setting combinations you are going to use are saved.
2.Once finished, these setting files can be used in other lens files
Please note that ZPLM is not commonly used as this way (Keywords INPUT is not friendly for optimization usage).
We use 3 different kinds of cookies. You can choose which cookies you want to accept. We need basic cookies to make this site work, therefore these are the minimum you can select. Learn more about our cookies.