Solved

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

  • 28 June 2022
  • 5 replies
  • 242 views

Userlevel 1

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 !

 

 

 

icon

Best answer by David.Nguyen 28 June 2022, 11:15

View original

5 replies

Userlevel 7
Badge +2

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

Userlevel 1

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?

 

 

 

 

Userlevel 7
Badge +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

Userlevel 3
Badge +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

Userlevel 1

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