Skip to main content
Solved

GridDistorsion has no results

  • January 16, 2025
  • 3 replies
  • 101 views

mocquin

I am trying to run a GridDistorsion analysis using the ZOS API but it seems the analysis has no results whatsoever : 

Using : 

distorsion_grid_analysis = system.Analyses.New_GridDistortion()

distorsion_grid_settings = distorsion_grid_analysis.GetSettings()

distorsion_grid_settings = zosapi.Analysis.Settings.Aberrations.IAS_GridDistortion(distorsion_grid_settings)

# set the settings here ...

distorsion_grid_analysis.ApplyAndWaitForCompletion()

analysis_results = distorsion_grid_analysis.GetResults()

print(analysis_results.NumberOfDataGrids)

print(analysis_results.NumberOfDataGridsRgb)

print(analysis_results.NumberOfDataScatterPoints)

print(analysis_results.NumberOfDataScatterPointsRgb)

print(analysis_results.NumberOfDataSeries)

print(analysis_results.NumberOfDataSeriesRgb)

print(analysis_results.NumberOfMessages)

print(analysis_results.NumberOfRayData)

 

I get only zeros so it seems the results object exposes nothing, I would expect at least DataSeries to acces the data from the “Text” results interface window

Am I missing somehting ?

Best answer by David.Nguyen

@mocquin 

 

Unfortunately your expectation is not correct. When all the parameters you printed above are zeros, it means this analysis is not fully implemented in the ZOSAPI.

To get the data from the Text tab of the analysis, you need to call the following method from the analysis results interface (IAR_):

analysis_results = distorsion_grid_analysis.GetResults()
analysis_results.GetTextFile(String Filename)

I hope this helps, and take care,

 

David

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

3 replies

David.Nguyen
Luminary
Forum|alt.badge.img+2
  • Luminary
  • 1112 replies
  • Answer
  • January 27, 2025

@mocquin 

 

Unfortunately your expectation is not correct. When all the parameters you printed above are zeros, it means this analysis is not fully implemented in the ZOSAPI.

To get the data from the Text tab of the analysis, you need to call the following method from the analysis results interface (IAR_):

analysis_results = distorsion_grid_analysis.GetResults()
analysis_results.GetTextFile(String Filename)

I hope this helps, and take care,

 

David


mocquin
  • Author
  • Visible
  • 20 replies
  • January 30, 2025

Thanks for you reply

I’ll take it that if a completed analysis has 0 data results, I should just wirte, read and parse the text results - it was not that hard to do but it makes the process of retreving results from analysis analysis-dependent which is kinda ugly...


David.Nguyen
Luminary
Forum|alt.badge.img+2
  • Luminary
  • 1112 replies
  • January 30, 2025

@mocquin 

 

That is very true. And if it's a topic of interest for you. I highly suggest:

https://community.zemax.com/zos-api-12/zospy-v1-2-0-has-just-been-released-4927?tid=4927&fid=12

Which is an initiative led by
@jwbeenakker, ​@Luc.van Vught, and​@chaasjes (I hope I did not forget anyone). They've been working hard to provide an easier and unified interface to the ZOSAPI, to which we are all welcome to contribute to.

Take care,

 

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