How do I access 'Lost energy (thresholds)' and 'Lost energy (errors)' in the Python API? I didn't see anything in the syntax help.
Solved
Accessing lost energy in the Python API
Best answer by David.Nguyen
Hi Chris,
Those are properties of your INSCRayTrace:
double DeadRayErrors [get]
double DeadRayThreshold [get]
You find this in the Syntax Help file under: ZOSAPI > Tools > RayTrace > INSCRayTrace. But there isn't much documentation about it.
Here is a code snippet showing you how to call those properties:
# Setup and run the ray trace NSCRayTrace = TheSystem.Tools.OpenNSCRayTrace() NSCRayTrace.ClearDetectors(0) NSCRayTrace.SplitNSCRays = True NSCRayTrace.ScatterNSCRays = True NSCRayTrace.UsePolarization = True NSCRayTrace.IgnoreErrors = True NSCRayTrace.SaveRays = False NSCRayTrace.RunAndWaitForCompletion() print('Lost energy (errors): ', NSCRayTrace.DeadRayErrors) print('Lost energy (thresholds): ', NSCRayTrace.DeadRayThreshold) NSCRayTrace.Close() print('Finished ray trace')
Let me know if this helps.
Take care,
David
Reply
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.