Scripted Encircled Energy for ARNs

This article demonstrates how to calculate the encircled energy in an ARN by scripting.  


Note that this is just an example provided to explore some concepts of scripting and reading data from ARN's. It is possible to calculate the encircled energy of an ARN in the GUI by opening it in a chart and then using the r-click option in the chart to find the encircled or ensquared energy


The FRED file contains a simple gaussian source and analysis surface as well as an embedded script.  The embedded script will calculate the irradiance on the analysis surface and store the result in an Analysis Result Node (ARN), after which it creates a library object from the attached script file “encircledEnergy.frs” and calls the encircled energy subroutine from it.  When the encircled energy subroutine is finished, the two array arguments that are passed to it will have been populated with the radii and fractional encircled energy values.


To run this example you will need both the .frd document and .frs script file. The embedded script in the .frd document will need to be updated on line 31 to point to the location the .frs file was saved to.


Download the FRED Script: encircledEnergy.frs

Download the FRED document: encircledEnergyExample.frd

Still need help? Contact Us Contact Us