ZOS-API loop through .ZRD file branch by branch

  • 23 June 2021
  • 1 reply
  • 83 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?


1 reply

Userlevel 7
Badge +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