Skip to main content

ZOS-API loop through .ZRD file branch by branch

  • June 23, 2021
  • 1 reply
  • 96 views

Currently I use a Macro in optic studio where I read through a Ray Database Viewer window, where I tick 'Expand Into Branches'. I want now to achieve the same funtionality using the ZOS-API with Python. I started by looking at example 5 'PythonStandalone_05_Read_ZRD_File.py' where we loop over the segments of each ray. How can I instead turn on  'Expand Into Branches'  and easily loop over each branch per ray individually?

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

1 reply

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

Hi Christa,

I don't think there's a programmatic way of 'ticking' the Expand Into Branches in ZOS-API. However, I believe you should be able to reproduce it using the information contained in the Prnt, Levl columns of the Ray Database. These values can also be read directly from a Batch Raytrace, as opposed to using the NSC Ray Trace tool.

I hope this helps.

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