Description Given an analysis surface and spatial extents, this function returns the number of raytrace paths, path ID numbers, path powers, and path ray counts for contributing ray paths within the specified region. The number of coherent rays that were ignored and the number of rays without associated ray paths is also returned. Specification of the window inside of which to find the contributing raytrace paths is done by providing minimum and maximum x and y values. Depending on the number of rays traced, it may be necessary to dimension ray index and ray counter variables as data type Huge_ instead of Long. Please see Multi-threaded Raytracing for more information.
Syntax cnt = FindPathsContributingToArea( anaNode, xMin, xMax, yMin, yMax, paths(), pathPowers(), rayCounts(), numCoherentIgnored, numRaysWOpaths )
Parameters cnt (Long) Number of contributing raytrace paths returned by the function.
anaNode As Long Analysis surface node id number used for supplying the ray filter and coordinate system information.
xMin As Double Minimum x value for the region of interest.
xMax As Double Maximum x value for the region of interest.
yMin As Double Minimum y value for the region of interest.
yMax As Double Maximum y value for the region of interest.
paths() As Long 1-D array of contributing raytrace path ID numbers. Returned by the function.
pathPowers() As Double 1-D array of powers for each corresponding value of paths(). Returned by the function.
rayCounts() As Long (or Huge_) 1-D array of ray counts for each corresponding value of paths(). Returned by the function.
numCoherentIgnored As Long Number of coherent rays that were ignored in the analysis. Returned by the function.
numRaysWOpaths As Long Number of rays without associated ray path information within the region of the analysis. Returned by the function.
Remarks The analysis surface node number provides information regarding the ray filter and the reference coordinate system. Note that this does not require that the xMin, xMax, yMin or yMax values lie within the dimensions of the analysis surface. If the specified area lies outside of the analysis surface dimensions and contributing rays meet the ray filter criterion, they will be included in the analysis results.
Example The following example code performs an advanced raytrace with the ray paths option on (required), sets up and performs the contributing ray paths analysis, and then writes out the results to the output window.
Dim adv As T_ADVANCEDRAYTRACE Dim nAna As Long, numCoherentIgnored As Long, numRaysWOpaths As Long, cnt As Long, ii As Long Dim xMin As Double,xMax As Double, yMin As Double, yMax As Double Dim paths() As Long, pPowers() As Double, rCounts() As Long
ClearOutputWindow
'get the node id for the analysis surface being used nAna = FindFullName( "Analysis Surface(s).Detector" )
'specify the spatial extents of the region of interest xMin = -4 : xMax = 4 yMin = -15.2 : yMax = -9.5
'perform an advanced raytrace WITH RAYPATHS ON InitAdvancedRaytrace adv adv.rayPaths = True adv.draw = False cnt = AdvancedRaytrace( adv )
'call the analysis function cnt = FindPathsContributingToArea( nAna, xMin, xMax, yMin, yMax, paths(), pPowers(), rCounts(), numCoherentIgnored, numRaysWOpaths )
'print results to FRED's output window Print "Image Diagnostic Output" Print "-----------------------" Print "Total contributing ray paths: " & cnt Print "Total coherent rays ignored: " & numCoherentIgnored Print "Number of rays without paths: " & numRaysWOpaths Print "" If cnt > 0 Then Print "Path ID" & Chr(9) & "Power" & Chr(9) & "Ray Count" For ii = 0 To UBound(paths,1) Print paths( ii ) & Chr(9) & pPowers( ii ) & Chr(9) & rCounts( ii ) Next ii End If
Related Topics FindPathsContributingToPolarAngularRegion
|