Solved

ZOS-API raytracing with a source color/spectrum that isn't the system wavelengths

  • 31 July 2023
  • 2 replies
  • 51 views

Userlevel 7
Badge +2

Hi everyone,

 

In the ZOS-API, as far as I tested, after a raytrace, I can’t read the actual wavelength (in um for example) of a non-sequential source object if the properties: Sources..Color/Spectrum of that source object are different from System Wavelengths.

For example, if my source object has a Color/Spectrm: Black Body Spectrum of say 2500K. The

ReadNextResult(..., out int wave, ...)

methods usually only have an integer wave output, which is the wavenumber as specified in the system explorer.

My workaround so far is to save a ray database (*.ZRD), and then parse it (it contains the actual wavelength!), but it would really be more convenient if we could access it right away.

Has anyone else experienced this issue as well?

Take care,

 

David

icon

Best answer by MichaelH 2 August 2023, 18:05

View original

2 replies

Userlevel 6
Badge +2

Hey David,

Yes, you are correct in your understanding that you have to use the IZRDReader (the only mention of wlUM is for this interface).  The in-memory NSC Ray Tracing lacks several features including:

  • HitFace
  • RayStatus
  • XYBin
  • LMBin
  • Normal X
  • Normal Y
  • Normal Z
  • Refractive Index
  • Starting Phase
  • Phase Of
  • Phase At
  • wlUM (from ReadNextResult)

There is also an ErrorCode for the NSC ray, which I’m not really sure if it makes sense.

The ZOS-API was just a “copy & paste” from the DDE; the DDE was originally designed for Sequential mode and once all the data structures were in place, the NSC ray trace was shoe-horned into the existing Sequential data structures.  This limited the number of results that could be passed to the ReadNextSegment in the IRayTraceNSCSourceData.  This issue has been known to Zemax for at least 5 years now.  It should be an extremely easy fix (Zemax did it for the IZRDReader with ReadNextSegmentFull) so hopefully we can have full in-memory access to all NSC ray data soon.

Userlevel 7
Badge +2

Thanks @MichaelH à, it makes sense. Hopefully this gets updated in the future. I accepted your answer by mistake and can't remove it but it's not the end of the world.

 

David

 

Reply