Skip to main content

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 ?

@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


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


@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