Skip to main content

Geometric image analysis ZPL API incomplete


liz_strong

Hello! A feature request -- could you please complete the ZPL API for geometric image analysis? It would be handy to be able to modify parameters available in the GUI that aren’t included in the API yet like the “use polarization” check box & the reference dropdown menu. 

Thanks!

Liz 

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

4 replies

David.Nguyen
Luminary
Forum|alt.badge.img+2

Hi Liz,

 

Just so people don’t get confused, I think you are refering to the ZPL macro langage. Because this setting is available in the ZOS-API. Here is a Python example that demonsrates how to set the polarization flag:

# Open a new Geometric Image Analysis
geo_imag_analysis = TheSystem.Analyses.New_GeometricImageAnalysis()

# Retrieve the settings of this analysis
geo_imag_settings = geo_imag_analysis.GetSettings()

# Toggle the polarization flag
geo_imag_settings.UsePolarization = True

# Apply settings and run the analysis
geo_imag_analysis.ApplyAndWaitForCompletion()

Take care,

 

David


liz_strong
  • Author
  • Infrared
  • 7 replies
  • September 18, 2023

Hi David, 

Is there a way to extract the percent efficiency using the zos api?

# get results
geo_imag_results = geo_imag_analysis.GetResults()

# extract percent efficiency

The output I’m looking for would be the same as what I can calculate with IMAE in the merit function. 

In this post, @MichaelH discusses saving and then parsing a .txt file with this information. Do you know if there is a quicker/more streamlined way to do this? 

Thanks!

Liz 


David.Nguyen
Luminary
Forum|alt.badge.img+2
  • Luminary
  • 1085 replies
  • September 20, 2023

Hi @liz_strong,

 

The results of geometric image analysis aren’t fully implemented as I can tell. So, parsing the text file seems the way to go as @MichaelH suggested.

I’m not sure if that’s what you want, but you can also evaluate a single Merit Function operand, such as IMAE, with the GetOperandValue method from the Merit Function Editor interface.

In Python, you’d do something like so:

from ZOSAPI.Editors.MFE import MeritOperandType

efficiency = TheSystem.MFE.GetOperandValue(MeritOperandType.IMAE, 0, 0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0)

print("Efficiency: " + str(efficiency * 100) + "%")

The ouptut looks like so:

Efficiency: 100.0%

Does that help?

Take care,


David


liz_strong
  • Author
  • Infrared
  • 7 replies
  • September 20, 2023

Yep, thanks David! 


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