Solved

ZOS-API can not set analysis window correctly

  • 15 October 2022
  • 1 reply
  • 145 views

Hello Everyone,I want to use python standardalone to open a analyse window of huuygens PSF ,but i find that doesn’t work. althought the windows is opened, but settings has not been set correctly. the code like this, I want to set SampleSize as 64 ,but when I open the file, that still the default setting of 128:TheAnalyses = TheSystem.AnalysesnewWin = TheAnalyses.New_HuygensPsf()print("HuygensPsf has analysis specific settings? ", newWin.HasAnalysisSpecificSettings)  newWin_setting = newWin.GetSettings()newWin_setting.PupilSampleSize = ZOSAPI.Analysis.SampleSizes.S_64x64  print(ZOSAPI.Analysis.SampleSizes.S_64x64)newWin_setting.ImageSampleSize = ZOSAPI.Analysis.SampleSizes.S_64x64  print(ZOSAPI.Analysis.SampleSizes.S_128x128)newWin_setting.HuygensPsfTypes = ZOSAPI.Analysis.Settings.HuygensPsfTypes.Phase  newWin.ApplyAndWaitForCompletion()

 

And i also get a problem about the warning of this, for I have already pip install pythonnet, and uninstall clr. it is still not worked.

 

icon

Best answer by pumpkin 18 October 2022, 04:50

View original

1 reply

Pythonnet is a package that gives Python programmers an integration with the .NET Common Language Runtime (CLR).

Our ZOS-API is a .NET 4.8-based library. So the Pythonnet version should support .NET 4.8 to be used with ZOS-API.

We had some reports that pythonnet 3.0 didn’t work with ZOS-API. I also did a couple of tests last week and encountered issues. So the recommendation for now is not to use pythonnet 3.0 with ZOS-API.

I personally use pythonnet 2.5.2.

 

  • Sandrine Auriol  Auriol’s share solve my problem, pythonnet 3.0 didn’t work with ZOS-API. when I use the pythonnet 2.5.2. I successfully set the Analyse Window.

Reply