Skip to main content

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

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)


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


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.

 


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


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.  


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


Reply