Skip to main content
Solved

How to separate ghost rays


yuan.chen
Zemax Staff
Forum|alt.badge.img+3

What shall I do to get ghost rays separated from transmitted rays that hit certain objects?

Best answer by yuan.chen

We can use filter strings to select rays.
?name=image.png
?name=image.png
They are mentioned here: The Setup Tab > Editors Group (Setup Tab) > Non-sequential Component Editor > Non-sequential Overview > The Filter String
A general introduction can be found here:
Identifying specific rays using filter strings – Knowledgebase (zemax.com)
This article shows the specific application of Gn and Hn in ghost image analysis.
Introduction to stray light analysis - Part 2 – Knowledgebase (zemax.com)
?name=image.png
They belong to the stray light analysis path.
Stray Light Analysis – Knowledgebase (zemax.com)
Besides, we have an advanced stray light analysis example made by our excellent engineer Michael. 
Stray light analysis for Head-up-Display - Part 3 – Knowledgebase (zemax.com)

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

6 replies

yuan.chen
Zemax Staff
Forum|alt.badge.img+3
  • Author
  • Zemax Staff
  • 275 replies
  • Answer
  • August 30, 2022

We can use filter strings to select rays.
?name=image.png
?name=image.png
They are mentioned here: The Setup Tab > Editors Group (Setup Tab) > Non-sequential Component Editor > Non-sequential Overview > The Filter String
A general introduction can be found here:
Identifying specific rays using filter strings – Knowledgebase (zemax.com)
This article shows the specific application of Gn and Hn in ghost image analysis.
Introduction to stray light analysis - Part 2 – Knowledgebase (zemax.com)
?name=image.png
They belong to the stray light analysis path.
Stray Light Analysis – Knowledgebase (zemax.com)
Besides, we have an advanced stray light analysis example made by our excellent engineer Michael. 
Stray light analysis for Head-up-Display - Part 3 – Knowledgebase (zemax.com)


yuan.chen
Zemax Staff
Forum|alt.badge.img+3
  • Author
  • Zemax Staff
  • 275 replies
  • August 30, 2022

Another way to sort: X_HIT

Sample file attached for your reference.

This is the normal path with X_HIT(n,2).
?name=image.png
This is the ghost path with X_HIT(n,3). It means the ray reflects from the front surface.
?name=image.png
This is the case with X_HIT(n,4). This means the ray refracts from the back surface.
?name=image.png


yuan.chen
Zemax Staff
Forum|alt.badge.img+3
  • Author
  • Zemax Staff
  • 275 replies
  • August 30, 2022

By the way, the filter string may not work if the keyword input is not set to English. Below is the difference between English and Chinese input.

 


Mark.Nicholson
Luminary
Forum|alt.badge.img+3

In the second screenshot you have sone extra spaces in the filter string. Does that affect it?


MichaelH
Ansys Staff
Forum|alt.badge.img+2
  • Ansys Staff
  • 342 replies
  • August 31, 2022

Hey Mark, 

In the second screenshot, the “extra space” is actually a Unicode space in non-English keyboard.  So this non-English space would cause issues since OpticStudio doesn’t know how to parse it.  With a “normal” ASCII space, it doesn’t matter how many you use between & or | as long a Xn values are in contact and any values between parenthesis are valid.

I do want to note the beauty of the Jn filter string (similar to Gn).  This will show the ghost images off of a certain lens (it doesn't really matter which face the ghost occurs because you need at least 2 Fresnel reflections from a lens to get ghost rays to the detector plane) while zeroing out all previous energy in the segment (all “direct” transmission of the original ray is ignored).  It is quite useful to analyze just the ghost energy from a specific lens.  


Mark.Nicholson
Luminary
Forum|alt.badge.img+3

Oh brother! Some poor developer will lose hair trying to accommodate that one!


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