Solved

Get the maximum ray angle impinging onto the image plane in sequential mode

  • 23 January 2024
  • 2 replies
  • 78 views

Hello,

Is there an operand to get the maximum ray angle impinging onto the image plane (relative to surface normal) in sequential mode ?

I know about the operands listed in help section Constraints on Real Ray Data, but they require setting normalized pupil coordinates Px/Py first.

 

Marko

icon

Best answer by Sean Turner 23 January 2024, 15:04

View original

2 replies

Userlevel 3
Badge +1

The merit function operand MXAI uses field number, not Px and Py.

From help file:
Maximum angle of incidence. This boundary operand traces the marginal and chief rays from defined Field and reports the maximum angle at the surface defined by Surf. See MNAI for more details about the input parameters.

However, if there is a ray somewhere else in the pupil with AOI larger than one of the marginal or chief rays available with this operand, you may need an alternate approach. For instance, you could use a ZPL macro to loop through a grid of Px and Py values and calculate the RAID operand. Here is a simple bit of code that would do it. This uses a 101 x 101 grid of pupil coordinates, but you can adjust accordingly. Also, the normalized field coordinates Hx, Hy are both set to 0 so this only evaluates a single field. You can add another 2 layers of FOR loops to iterate through Hx and Hy values as well, but this should get you started.

C = OCOD("RAID")
FOR i, 1, 101, 1
    PX = (i-1)/50-1
    FOR j, 1, 101, 1
        PY = (j-1)/50-1
        AOI = OPEV(C, 0, 1, 0, 0, PX, PY)
        PRINT PX, $TAB(), PY, $TAB(), AOI
    NEXT
NEXT

 

Edited to add: normalized pupil and field coordinates should really be accessible as independent variables in universal plots. 

Hello Sean,

Yes, in my case I do not know for which pupil coordinates the angle on the image surface will have maximum value, and was thinking maybe there is an operand for thath. I have used Matlab ZOS API, since I am more familiar with it than ZPL. I have only looped over Px, Py/Hx/Hy are all set to zero.

 

TheSystem = TheApplication.PrimarySystem;
TheMFE = TheSystem.MFE;
Operand = ZOSAPI.Editors.MFE.MeritOperandType.RAID;

n = 101; srf = 4;
px = linspace(0,1,n);
val = zeros(1,n);

for i=1:n
val(i)=TheMFE.GetOperandValue(Operand,srf,1,0.0,0.0,px(i),0.0,0.0,0.0);
end

plot(px,val);xlabel('Px');ylabel('Value');grid

 

 

The plot looks good to me for estimating the maximum RAID operand value. Thank you for the idea.

 

 

Marko

Reply