Skip to main content
Solved

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


David.Nguyen
Luminary
Forum|alt.badge.img+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

Best answer by MichaelH

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.

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

2 replies

MichaelH
Ansys Staff
Forum|alt.badge.img+2
  • Ansys Staff
  • 366 replies
  • Answer
  • August 2, 2023

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.


David.Nguyen
Luminary
Forum|alt.badge.img+2
  • Author
  • Luminary
  • 1122 replies
  • August 3, 2023

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


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