Skip to main content
Solved

ZOS-API can not set analysis window correctly

  • October 15, 2022
  • 1 reply
  • 184 views

pumpkin
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.

 

Best answer by pumpkin

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.

View original
Did this topic help you find an answer to your question?

1 reply

pumpkin
  • Author
  • Infrared
  • 6 replies
  • Answer
  • October 18, 2022

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


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings