Skip to main content
Solved

[RAYY] command get which point on the image surface?


Yang.Yongtao
Fully Spectral
Forum|alt.badge.img

Hi there,

 

I am learning to design a spectrometer referring to this tutorials

https://www.zemax.com/blogs/free-tutorials/how-to-build-a-spectrometer

and there is one ZPL file to calculate the position of wavelength and resolution of the spectrometer.

I just wonder the [RAYY] command get which point on the image surface?

since there are chief ray, centroid , middle and  vertex ( I guess something similar to spot diagram)

(and I have searched the zemax help, only got this, hmm ,which ray intercept?

)

 

 

 

thank you !

 

 

 

Best answer by David.Nguyen

Hi Yang,

 

RAYY(x) will give you the Y-coordinate intercept of the ray previously defined by RAYTRACE. Which is why the help file says RAYY(x) is only valid after a RAYTRACE. The RAYTRACE syntax is:

RAYTRACE hx, hy, px, py, wavelength

 

As you can see in your code snippet, hxhypx, and py are all 0. Therefore, it is the Y-coordinate intercept of the chief ray of your system.

Let me know if this makes sense.

Take care,

 

David

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

5 replies

David.Nguyen
Luminary
Forum|alt.badge.img+2
  • Luminary
  • 1089 replies
  • Answer
  • June 28, 2022

Hi Yang,

 

RAYY(x) will give you the Y-coordinate intercept of the ray previously defined by RAYTRACE. Which is why the help file says RAYY(x) is only valid after a RAYTRACE. The RAYTRACE syntax is:

RAYTRACE hx, hy, px, py, wavelength

 

As you can see in your code snippet, hxhypx, and py are all 0. Therefore, it is the Y-coordinate intercept of the chief ray of your system.

Let me know if this makes sense.

Take care,

 

David


Yang.Yongtao
Fully Spectral
Forum|alt.badge.img
  • Author
  • Fully Spectral
  • 58 replies
  • June 29, 2022

hi David

 Thank  you! it is cleared.

 And about the spectrometer designing tutorial,  since the diffraction encircled energy is optimized with a DENC 3(y-centroid) operand, just in my opinion , it is also better to calculate the y location  referring to a y-centroid of wavelength correspondently?

 

and checked the zemax help again , I just cannot get a centroid position command similar to RAYY() …. and try to use below

 

Step1 set a CEHY (in this case) operand in the merit function editor

Step2 Set the wavelength parameter of the merit function editor by SETOPERAND

Step3 Get the value of the CEHY operand by OPER

Step4 Step2~Step3 Loop

 

or is there some command can directly get the position of centroid?

 

 

 

 


David.Nguyen
Luminary
Forum|alt.badge.img+2

Hi Yang,

 

I think you did the right thing, or I cannot think of a better solution. There’s also CENY that would give you the centroid X coordinate based on a grid of rays sent through the system. It might be worth comparing the execution time of CEHY and CENY, assuming the accuracy is similar.

Take care,

 

David


Chris Normanshire
Zemax Staff
Forum|alt.badge.img+2

Hi,

You can access the values of the centroid operands (CEHY, CENY, etc.) directly in you ZPL macro without needing to read them from the merit function. The technique is explained in this article How to obtain the value for any optimization operand in a ZPL macro using OPEV and OPEW – Knowledgebase (zemax.com).

Hope this helps.

Chris


Yang.Yongtao
Fully Spectral
Forum|alt.badge.img
  • Author
  • Fully Spectral
  • 58 replies
  • June 30, 2022
Chris Normanshire wrote:

Hi,

You can access the values of the centroid operands (CEHY, CENY, etc.) directly in you ZPL macro without needing to read them from the merit function. The technique is explained in this article How to obtain the value for any optimization operand in a ZPL macro using OPEV and OPEW – Knowledgebase (zemax.com).

Hope this helps.

Chris

 

Hi Chris,

 Thank you so much! That’ s really helpful! Actually, I was just wondering how to do interact between Merit Function Operand value between macro. Then your advice comes ! Thanks very much, I will try it out.

 

Best Regards

Yang


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