Skip to content

Instantly share code, notes, and snippets.

@Omnistic
Created May 10, 2021 14:25
Show Gist options
  • Save Omnistic/eed68902207eed664f807a266c5750a0 to your computer and use it in GitHub Desktop.
Save Omnistic/eed68902207eed664f807a266c5750a0 to your computer and use it in GitHub Desktop.
ZOS-API: Batch raytrace template
from System import Enum, Int32, Double
# Open the BatchRayTrace tool
MyBatchRT = TheSystem.Tools.OpenBatchRayTrace()
# Add an unpolarized-raytrace
ToImageSurface = 3
MaxRays = 1
MyUnpolRT = MyBatchRT.CreateNormUnpol(MaxRays, ZOSAPI.Tools.RayTrace.RaysType.Real, ToImageSurface)
WaveNumber = Int32(0)
Hx = Double(0)
Hy = Double(0)
Px = Double(0)
Py = Double(0)
MyUnpolRT.AddRay(WaveNumber, Hx, Hy, Px, Py, Enum.Parse(ZOSAPI.Tools.RayTrace.OPDMode, "None"))
# Run the raytrace
MyBatchRT.RunAndWaitForCompletion()
# Close the BatchRayTrace tool
MyBatchRT.Close()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment