Skip to main content

How do I access 'Lost energy (thresholds)' and 'Lost energy (errors)' in the Python API? I didn't see anything in the syntax help.





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



 


That helps, thanks. I was looking for 'lost' in the documentation - choosing one name or the other would be helpful.


Hi Chris,



I completely agree with you. Perhaps someone from Zemax can raise this issue to the developers?



Cheers,



David



 


Hi Chris and David,



Thanks for noting this! I agree that it would be useful to align the terminology here. I will submit a feature request to our developers 🙂



Best,



Allie


Reply