Hello Cesar,
Thanks for your question here!
As discussed in this knowledge base article Basic method of performing system analysis in ZOS-API, there are in general 2 ways that analysis settings can be adjusted. Firstly, some commonly-used analyses have analysis-specific settings interfaces available. An example is IAS_FftMtf. In these cases, all the analysis settings interfaces are located in the ZOSAPI.Analysis.Settings Namespace. You can check if your analysis has a settings interface using the HasAnalysisSpecificSettings property:
my_analysis.HasAnalysisSpecificSettings
Unfortunately, for POP the command returns “0”, which means that the analysis does not have a fully-implemented settings interface available. Therefore the analysis settings cannot be edited via the API but have to be changed through the second option, which is via the IAS_ModifySettings command, which modifies the settings file for the analysis (.cfg file) directly:
The ModifySettings command works very similarly to the ZPL MODIFYSETTINGS keyword, you may find more info in the Help file under:
The Programming Tab > About the ZPL > KEYWORDS (about the zpl) > MODIFYSETTINGS (keywords)
The ModifySettings function and keyword need string inputs, even the new value has to be a string. The problem with your code is that the entered new value is not a string variable. If you change the last line of your code as one of the followings, it will work fine:
pop_setting.ModifySettings(cfg, 'POP_PARAM1', num2str(0.010)) %Beam Waist in X.
or
pop_setting.ModifySettings(cfg, 'POP_PARAM1', '0.010') %Beam Waist in X.
If you have further questions, please let us know and we will be happy to help!
Best,
Csilla
Hello Csilla,
Thank you for your help, this worked perfectly! I must have missed the that the newValue was a string input in the documentation. I was also looking at the 'ZOS-API using Python' knowledgebase ('# 2.5 Modify Settings Method' section) and the post did not rely on string input for the newValue.
Thanks again!