Navigation: Scripting Reference Manual > Functions & Subroutines > StrayLightReport

 

StrayLightReport

 

Contact Us: fredsupport@photonengr.com

 

Description

This script command prints the stray light report for all paths ending on the specified entity node to either the FRED output window or a tab delimited text file.  An advanced raytrace must have been issued with the Determine Raypaths option enabled.  The stray light report always includes a list of the contributing sources, a summary of the raytrace control settings, and a high level summary of the raytrace paths.  Specular and scatter paths will be reported depending on the subroutine arguments.

 

 

Syntax

StrayLightReport( entNode, normMethod, normRef, specAncestry, scatAncestry, threshold, saveFile )

 

 

Parameters

entNode As Long

Node number of the entity on which stray light paths "end".

 

normMethod As Long

Stray light paths are listed by percentage of power in descending order.  The percentage is calculated using one of the following options:

0 = use total power on the surface specified by the entNode argument

1 = use total specular power on the surface specified by the entNode argument

2 = use total scatter power on the surface specified by the entNode argument

3 = use accumulated power of the specular level specified by the normRef argument

4 = use accumulated power of the scatter level specified by the normRef argument

 

Specified values outside of this range are reset to 0.  Note that if the reference normalization power is zero, percentages are not computed and the stray light paths are listed by total power in descending order.

 

normRef As Long

The scatter/specular ancestry level used for calculation of the power normalization (normMethod = 3 or 4).  Specified values less than zero are reset to 0.

 

specAncestry As Long

Report paths ending on entNode having specular ancestry level specAncestry.  Other valid values are:

-2 = suppress the specular path list (i.e. display scatter paths only)

-1 = show all specular ancestry levels

 

scatAncestry As Long

Report paths ending on entNode having scatter ancestry level scatAncestry.  Other valid values are:

-2 = suppress the scatter path list (i.e. display specular paths only)

-1 = show all scatter ancestry levels

 

threshold As Double

Power percentage cutoff threshold for reported paths.  Paths with power percentages below this threshold will not be reported.  Possible values are:

< 0 = only a high level summary is printed and no paths are listed

   0 = all specified paths are listed

> 0 = paths with power percentages above the threshold are listed.  Note that if the reference normalization power is zero and threshold > 0, no paths will be listed.

 

saveFile As String

Output file the report should be written to.  If saveFile = "", the report will be written to the FRED output window.

 

 

Examples

The following example code sets up an advanced raytrace to use the rayPaths option, performs the advanced raytrace, and then writes the stray light report to the output window.  The reference power is the total power on the entity specified by entNode (therefore normRef does not apply), specular paths with ancestry level 2 will be displayed, scatter paths will be suppressed, only paths whose power% is greater than 0.2 will be displayed, and the file name is an empty string to direct the report to the output window.

 

Sub Main

 

          Dim entNode As Long, cnt As Long

          Dim normMethod As Long, normRef As Long, specAncestry As Long, scatAncestry As Long

          Dim threshold As Double

          Dim saveFile As String

          Dim adv As T_ADVANCEDRAYTRACE

          

          ClearOutputWindow

          

          'get the entity node number for reference power

          entNode = FindFullName( "Geometry.dbgausscodev.Surface 12.Surf 12" )

          

          'setup the advanced raytrace WITH rayPaths ON          

          InitAdvancedRaytrace adv

          adv.rayPaths = True

          adv.draw = False

          adv.suppressSummary = True

 

          'perform the advanced raytrace

          cnt = AdvancedRaytrace (adv)

          

          'setup options for the stray light report output

          normMethod = 0 'use total power on the entNode entity

          normRef = 0 'not using normMethod 3 or 4, so this does not apply

          specAncestry = 2 'report paths having specular ancestry level 2

          scatAncestry = -2 'suppress all scatter paths

          threshold = 0.02 'report paths whose percentage power is above this value

          saveFile = "" 'print to the FRED output window, not to file

          StrayLightReport( entNode, normMethod, normRef, specAncestry, scatAncestry, threshold, saveFile )

 

End Sub

 

 

See Also

StrayLightReportByEntity

Analyses - Stray Light Report

Reports - Raytrace Paths

Raytrace Path Scripting Commands

 

 

 

 

 

Copyright © Photon Engineering, LLC