Skip to main content

ZOS-API equivalents for ZPL numeric function SURC(A$) and MAXF()


Julia
Fully Spectral
Forum|alt.badge.img+2
  • Fully Spectral
  • 51 replies
The following code can be used as (MATLAB) ZOS-API equivalents for ZPL numeric function SURC and MAXF:

 

surf=0;
while(surf<TheSystem.LDE.NumberOfSurfaces)
if(TheSystem.LDE.GetSurfaceAt(surf).Comment=="TEST")
surc=surf;
break
end
surf=surf+1;
end




max_field = -1E9;
for i = 1:TheSystem.SystemData.Fields.NumberOfFields
X_field= TheSystem.SystemData.Fields.GetField(i).X;
Y_field= TheSystem.SystemData.Fields.GetField(i).Y;
radial_field= sqrt(X_field^2+Y_field^2);
if (radial_field> max_field)
max_field = radial_field; max_field_num=i;
end
end
fprintf('%d %f\n',max_field_num,max_field);





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

0 replies

Be the first to reply!

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