|
Note - this section describes the ray filter dialog and opCodes used in FRED v23.10 and prior releases. The description of the new dialog and opCodes used after FRED v23.10 is available here. FRED scripts created with these older opCode's will continue to work but we do not recommend referencing them in new scripts.
Description
This data structure defines a single ray selection filter operation (ex. "Rays on the specified surface") that gets applied during ray-based analyses (ex. Irradiance) or a ray-manipulation operation (ex. Redraw ray history). Consider the GUI dialog below for defining a single ray selection filter operation. Each of the entries in the dialog corresponds to a single member of the T_RAYFILTEROP data structure, as annotated below, though not all ray selection filter criteria require a datum and/or stringDatum entry. In the example GUI below, note that there is a "<= n" condition within the criteria definition. The T_RAYFILTEROP data structure includes a wantOppositeOperation member which, when set to True, has the effect of changing the criteria from "<= n" to "> n".
.png)
Definition
Type T_RAYFILTEROP
datum As Double combineCode As Long opCode As Long stringDatum As String
text As String wantOppositeOperation As Boolean
Members
datum
This member contains the numeric value associated with the ray selection criteria being defined and whose meaning is determined by the opCode member. Note that not all ray selection criteria definitions require a numeric datum value. The table below indicates which criteria require a datum entry.
combineCode
This member specifies how the criteria is combined with the results of any previous ray selection criteria. This entry is superfluous for the first ray selection criterion, as there are no previous criteria to be combined with. Possible values are:
opCode
This member specifies the type of ray selection criterion being defined. Refer to the table below for a complete list of opCode values and their associated filter criteria.
stringDatum
This member is used to specify entity names that are associated with some criteria. For example, definition of a "Rays on a specified surface" ray selection criterion requires that a node be provided (the "surface" in the criteria definition). The full name of the corresponding node of interest is specified using the stringDatum member. Refer to the table below, which indicates whether a stringDatum entry is required for any given ray selection criterion.
text
This member is not used with Legacy OpCodes and can be ignored.
wantOppositeOperation
When True, this member will negate the conditional logic in the ray selection criteria. When the conditional logic of the ray selection criteria is intended to be applied as-is, this member should be set to False. The behavior change of the conditional logic as it pertains to wantOppositeOperation is listed in the table below.
|
Conditional Logic
|
When wantOppositeOperation = True
|
|
<= (less than or equal to)
|
> (greater than)
|
|
== (equal to)
|
!= (not equal to)
|
For example, a common ray selection criteria is "Rays on the specified surface". In order to specify a ray selection criteria of the type, "Rays NOT on the specified surface", the T_RAYFILTEROP data structure configuration would be the following, where the wantOppositeOperation is used to flip the conditional logic:
|
Member
|
Value
|
|
opCode
|
3
|
|
stringDatum
|
"Geometry.Example.Surface"
|
|
wantOppositeOperation
|
True
|
Refer to the table below for a full listing of the available ray selection filter criteria.
Remarks
The table below lists the correspondence between the opCode values and their associated ray selection filter criteria meanings
|
Filter Criteria
|
|
|
All rays
|
Op code
|
0
|
|
Datum
|
Not applicable
|
|
String Datum
|
Not applicable
|
|
Coherent rays
|
Op code
|
1
|
|
Datum
|
Not applicable
|
|
String Datum
|
Not applicable
|
|
Polarized rays
|
Op code
|
2
|
|
Datum
|
Not applicable
|
|
String Datum
|
Not applicable
|
|
Rays on the specified surface
|
Op code
|
3
|
|
Datum
|
Not applicable
|
|
String Datum
|
Full name of the surface
ex. "Geometry.Example.Surface"
ex. GetFullName( surfNode )
|
|
Rays from the specified source
|
Op code
|
4
|
|
Datum
|
Not applicable
|
|
String Datum
|
Full name of the source
ex. "Optical Sources.Source 1"
ex. GetFullName( sourceNode )
|
|
Rays in the specified material
|
Op code
|
5
|
|
Datum
|
Not applicable
|
|
String Datum
|
Name of the material
ex. "Air"
ex. GetMaterialName( matNode )
|
|
Every N'th ray
|
Op code
|
6
|
|
Datum
|
N'th ray
|
|
String Datum
|
Not applicable
|
|
Incoherent power <= value
|
Op code
|
7
|
|
Datum
|
Power value
|
|
String Datum
|
Not applicable
|
|
Optical path length <= value
|
Op code
|
8
|
|
Datum
|
Path length value
|
|
String Datum
|
Not applicable
|
|
Wavelength (um) <= value
|
Op code
|
9
|
|
Datum
|
Wavelength value
|
|
String Datum
|
Not applicable
|
|
X <= value in specified coordinate system
|
Op code
|
10
|
|
Datum
|
X value
|
|
String Datum
|
Full name of the coordinate system node
ex. "Geometry.Example.Surface"
ex. GetFullName( surfNode )
|
|
Y <= value in specified coordinate system
|
Op code
|
11
|
|
Datum
|
Y value
|
|
String Datum
|
Full name of the coordinate system node
ex. "Geometry.Example.Surface"
ex. GetFullName( surfNode )
|
|
Z <= value in specified coordinate system
|
Op code
|
12
|
|
Datum
|
Z value
|
|
String Datum
|
Full name of the coordinate system node
ex. "Geometry.Example.Surface"
ex. GetFullName( surfNode )
|
|
X direction component <= value in specified coordinate system
|
Op code
|
13
|
|
Datum
|
X direction value
|
|
String Datum
|
Full name of the coordinate system node
ex. "Geometry.Example.Surface"
ex. GetFullName( surfNode )
|
|
Y direction component <= value in specified coordinate system
|
Op code
|
14
|
|
Datum
|
Y direction value
|
|
String Datum
|
Full name of the coordinate system node
ex. "Geometry.Example.Surface"
ex. GetFullName( surfNode )
|
|
Z direction component <= value in specified coordinate system
|
Op code
|
15
|
|
Datum
|
Z direction value
|
|
String Datum
|
Full name of the coordinate system node
ex. "Geometry.Example.Surface"
ex. GetFullName( surfNode )
|
|
Radial distance from X axis <= value in specified coordinate system
|
Op code
|
16
|
|
Datum
|
Radial distance
|
|
String Datum
|
Full name of the coordinate system node
ex. "Geometry.Example.Surface"
ex. GetFullName( surfNode )
|
|
Radial distance from Y axis <= value in specified coordinate system
|
Op code
|
17
|
|
Datum
|
Radial distance
|
|
String Datum
|
Full name of the coordinate system node
ex. "Geometry.Example.Surface"
ex. GetFullName( surfNode )
|
|
Radial distance from Z axis <= value in specified coordinate system
|
Op code
|
18
|
|
Datum
|
Radial distance
|
|
String Datum
|
Full name of the coordinate system node
ex. "Geometry.Example.Surface"
ex. GetFullName( surfNode )
|
|
Radial distance from X direction <= value in specified coordinate system
|
Op code
|
19
|
|
Datum
|
Radial direction distance
|
|
String Datum
|
Full name of the coordinate system node
ex. "Geometry.Example.Surface"
ex. GetFullName( surfNode )
|
|
Radial distance from Y direction <= value in specified coordinate system
|
Op code
|
20
|
|
Datum
|
Radial direction distance
|
|
String Datum
|
Full name of the coordinate system node
ex. "Geometry.Example.Surface"
ex. GetFullName( surfNode )
|
|
Radial distance from Z direction <= value in specified coordinate system
|
Op code
|
21
|
|
Datum
|
Radial direction distance
|
|
String Datum
|
Full name of the coordinate system node
ex. "Geometry.Example.Surface"
ex. GetFullName( surfNode )
|
|
Rays on the specified ray path
|
Op code
|
22
|
|
Datum
|
Ray path number
|
|
String Datum
|
Not applicable
|
|
Scattered rays
|
Op code
|
23
|
|
Datum
|
Not applicable
|
|
String Datum
|
Not applicable
|
|
Scattered ancestry equal to value
|
Op code
|
24
|
|
Datum
|
Scatter ancestry value
|
|
String Datum
|
Not applicable
|
|
Scattered ancestry <= value
|
Op code
|
25
|
|
Datum
|
Scatter ancestry value
|
|
String Datum
|
Not applicable
|
|
Specular rays
|
Op code
|
26
|
|
Datum
|
Not applicable
|
|
String Datum
|
Not applicable
|
|
Specular ancestry equal to value
|
Op code
|
27
|
|
Datum
|
Specular ancestry value
|
|
String Datum
|
Not applicable
|
|
Specular ancestry <= value
|
Op code
|
28
|
|
Datum
|
Specular ancestry value
|
|
String Datum
|
Not applicable
|
|
Total ray intersection count == value
|
Op code
|
29
|
|
Datum
|
Total intersection count value
|
|
String Datum
|
Not applicable
|
|
Total ray intersection count <= value
|
Op code
|
30
|
|
Datum
|
Total intersection count value
|
|
String Datum
|
Not applicable
|
|
Consecutive ray intersection count == value
|
Op code
|
31
|
|
Datum
|
Consecutive intersection count value
|
|
String Datum
|
Not applicable
|
|
Consecutive ray intersection count <= value
|
Op code
|
32
|
|
Datum
|
Consecutive intersection count value
|
|
String Datum
|
Not applicable
|
|
Rays with ray errors
|
Op code
|
33
|
|
Datum
|
Not applicable
|
|
String Datum
|
Not applicable
|
|
Ray number N
|
Op code
|
34
|
|
Datum
|
Ray number
|
|
String Datum
|
Not applicable
|
|
Ray numbers <= N
|
Op code
|
35
|
|
Datum
|
Ray number
|
|
String Datum
|
Not applicable
|
|
Absorbed rays
|
Op code
|
36
|
|
Datum
|
Not applicable
|
|
String Datum
|
Not applicable
|
|
Diffract ancestry equal to value
|
Op code
|
37
|
|
Datum
|
Diffraction ancestry value
|
|
String Datum
|
Not applicable
|
|
Diffract ancestry <= value
|
Op code
|
38
|
|
Datum
|
Diffraction ancestry value
|
|
String Datum
|
Not applicable
|
|
Total ancestry == value
|
Op code
|
39
|
|
Datum
|
Total ancestry value
|
|
String Datum
|
Not applicable
|
|
Total ancestry <= value
|
Op code
|
40
|
|
Datum
|
Total ancestry value
|
|
String Datum
|
Not applicable
|
|
Rays assigned to a ray path
|
Op code
|
41
|
|
Datum
|
Not applicable
|
|
String Datum
|
Not applicable
|
|
On a path including a specified surface
|
Op code
|
42
|
|
Datum
|
Not applicable
|
|
String Datum
|
Full name of the surface
ex. "Geometry.Example.Surface"
ex. GetFullName( surfNode )
|
|
On a path with event count == value
|
Op code
|
43
|
|
Datum
|
Event count value
|
|
String Datum
|
Not applicable
|
|
On a path with event count <= value
|
Op code
|
44
|
|
Datum
|
Event count value
|
|
String Datum
|
Not applicable
|
|
On a path with scatter event on surface
|
Op code
|
45
|
|
Datum
|
Not applicable
|
|
String Datum
|
Full name of the surface
ex. "Geometry.Example.Surface"
ex. GetFullName( surfNode )
|
|
On a path with scatter refl on a surface
|
Op code
|
46
|
|
Datum
|
Not applicable
|
|
String Datum
|
Full name of the surface
ex. "Geometry.Example.Surface"
ex. GetFullName( surfNode )
|
|
On a path with scatter tran on a surface
|
Op code
|
47
|
|
Datum
|
Not applicable
|
|
String Datum
|
Full name of the surface
ex. "Geometry.Example.Surface"
ex. GetFullName( surfNode )
|
|
On a path with specular event on surface
|
Op code
|
48
|
|
Datum
|
Not applicable
|
|
String Datum
|
Full name of the surface
ex. "Geometry.Example.Surface"
ex. GetFullName( surfNode )
|
|
On a path with specular refl on surface
|
Op code
|
49
|
|
Datum
|
Not applicable
|
|
String Datum
|
Full name of the surface
ex. "Geometry.Example.Surface"
ex. GetFullName( surfNode )
|
|
On a path with specular tran on surface
|
Op code
|
50
|
|
Datum
|
Not applicable
|
|
String Datum
|
Full name of the surface
ex. "Geometry.Example.Surface"
ex. GetFullName( surfNode )
|
|
On a path with diffract event on surface
|
Op code
|
51
|
|
Datum
|
Not applicable
|
|
String Datum
|
Full name of the surface
ex. "Geometry.Example.Surface"
ex. GetFullName( surfNode )
|
|
On a path with diffract refl on surface
|
Op code
|
52
|
|
Datum
|
Not applicable
|
|
String Datum
|
Full name of the surface
ex. "Geometry.Example.Surface"
ex. GetFullName( surfNode )
|
|
On a path with diffract tran on surface
|
Op code
|
53
|
|
Datum
|
Not applicable
|
|
String Datum
|
Full name of the surface
ex. "Geometry.Example.Surface"
ex. GetFullName( surfNode )
|
|
On a path with diffract order == Value on surface
|
Op code
|
54
|
|
Datum
|
Diffraction order
|
|
String Datum
|
Full name of the surface
ex. "Geometry.Example.Surface"
ex. GetFullName( surfNode )
|
|
On a path with diffract order <= Value on surface
|
Op code
|
55
|
|
Datum
|
Diffraction order
|
|
String Datum
|
Full name of the surface
ex. "Geometry.Example.Surface"
ex. GetFullName( surfNode )
|
|
On a path with diffract refl order == Value on surface
|
Op code
|
56
|
|
Datum
|
Diffraction order
|
|
String Datum
|
Full name of the surface
ex. "Geometry.Example.Surface"
ex. GetFullName( surfNode )
|
|
On a path with diffract refl order <= Value on surface
|
Op code
|
57
|
|
Datum
|
Diffraction order
|
|
String Datum
|
Full name of the surface
ex. "Geometry.Example.Surface"
ex. GetFullName( surfNode )
|
|
On a path with diffract tran order == Value on surface
|
Op code
|
58
|
|
Datum
|
Diffraction order
|
|
String Datum
|
Full name of the surface
ex. "Geometry.Example.Surface"
ex. GetFullName( surfNode )
|
|
On a path with diffract tran order <= Value on surface
|
Op code
|
59
|
|
Datum
|
Diffraction order
|
|
String Datum
|
Full name of the surface
ex. "Geometry.Example.Surface"
ex. GetFullName( surfNode )
|
|
On a path with specular tran event count ==
|
Op code
|
60
|
|
Datum
|
Event count
|
|
String Datum
|
Not applicable
|
|
On a path with specular tran event count <=
|
Op code
|
61
|
|
Datum
|
Event count
|
|
String Datum
|
Not applicable
|
|
On a path with specular refl event count ==
|
Op code
|
62
|
|
Datum
|
Event count
|
|
String Datum
|
Not applicable
|
|
On a path with specular refl event count <=
|
Op code
|
63
|
|
Datum
|
Event count
|
|
String Datum
|
Not applicable
|
|
On a path with scatter tran event count ==
|
Op code
|
64
|
|
Datum
|
Event count
|
|
String Datum
|
Not applicable
|
|
On a path with scatter tran event count <=
|
Op code
|
65
|
|
Datum
|
Event count
|
|
String Datum
|
Not applicable
|
|
On a path with scatter refl event count ==
|
Op code
|
66
|
|
Datum
|
Event count
|
|
String Datum
|
Not applicable
|
|
On a path with scatter refl event count <=
|
Op code
|
67
|
|
Datum
|
Event count
|
|
String Datum
|
Not applicable
|
|
On a path with diffract tran event count ==
|
Op code
|
68
|
|
Datum
|
Event count
|
|
String Datum
|
Not applicable
|
|
On a path with diffract tran event count <=
|
Op code
|
69
|
|
Datum
|
Event count
|
|
String Datum
|
Not applicable
|
|
On a path with diffract refl event count ==
|
Op code
|
70
|
|
Datum
|
Event count
|
|
String Datum
|
Not applicable
|
|
On a path with diffract refl event count <=
|
Op code
|
71
|
|
Datum
|
Event count
|
|
String Datum
|
Not applicable
|
|
Rays that have volume scattered
|
Op code
|
72
|
|
Datum
|
Not applicable
|
|
String Datum
|
Not applicable
|
|
On a path with ray count ==
|
Op code
|
73
|
|
Datum
|
Ray count
|
|
String Datum
|
Not applicable
|
|
On a path with ray count <=
|
Op code
|
74
|
|
Datum
|
Ray count
|
|
String Datum
|
Not applicable
|
|
On a path with ray power ==
|
Op code
|
75
|
|
Datum
|
Ray power
|
|
String Datum
|
Not applicable
|
|
On a path with ray power <=
|
Op code
|
76
|
|
Datum
|
Ray power
|
|
String Datum
|
Not applicable
|
|
On a path with specular TIR on surface
|
Op code
|
77
|
|
Datum
|
Not applicable
|
|
String Datum
|
Full name of the surface
ex. "Geometry.Example.Surface"
ex. GetFullName( surfNode )
|
|
On a path with specular TIR event count ==
|
Op code
|
78
|
|
Datum
|
Event count
|
|
String Datum
|
Not applicable
|
|
On a path with specular TIR event count <=
|
Op code
|
79
|
|
Datum
|
Event count
|
|
String Datum
|
Not applicable
|
Example - Scattered Rays
The following example demonstrates the use of the ray filter operation commands as they relate to detector entities. In this example the operation count for a detector entity is retrieved and the operation at index 0 is retrieved and modified before the analysis is performed.
Sub Main
Dim rfOp As T_RAYFILTEROP
Dim deNode As Long, opCount As Long, cnt As Long, arnNode As Long
Dim success As Boolean
deNode = FindFullName( "Analysis Surface(s).Cylinder Detector Entity" )
opCount = DEGetOpCount( deNode )
Print "Detector entity " & deNode & " has " & opCount & " ray filter operations."
'Get, modify, and set the 0'th operation in the list
success = DEGetIthOp( deNode, 0, rfOp )
rfOp.opCode = 23 'scattered rays
DESetIthOp deNode, 0, rfOp
'Perform analysis with modified ray filter
cnt = DEPerformAnalysis( deNode )
Print "Detector entity analysis results stored in ARN " & DEGetMostRecentARNNum( deNode )
End Sub
Example - Array of T_RAYFILTEROP
Some functions in FRED require an array of T_RAYFILTEROP structures be used as an argument . The example below shows a custom function that accepts a surface node number as an argument and then constructs a T_RAYFILTEROP array that would filter for specular rays on the surface of interest. This custom function then returns the T_RAYFILTEROP array back to the Main subroutine, where the return value is placed in the local tFilter() array variable, and then used in the RedrawRayHistory() function.
Sub Main
Dim surfNode As Long
surfNode = FindFullName( "Geometry.Detectors.Plane.Surface" )
'Construct the ray filter operation list
Dim tFilter() As T_RAYFILTEROP
tFilter() = ConstructFilter( surfNode )
'Redraw ray history
RedrawRayHistory( tFilter() )
End Sub
Function ConstructFilter( ByVal in_surf As Long ) As Variant
'This is a helper function that constructs a ray selection filter
Dim tFilt(1) As T_RAYFILTEROP
'First filter array element
tFilt(0).opCode = 26 'specular rays
'Second filter array element
tFilt(1).opCode = 3 'rays on a specific surface
tFilt(1).stringDatum = GetFullName( in_surf )
Return tFilt()
End Function
See Also
AddAnalysisSurfOp
GetAnalysisSurfIthOp
SetAnalysisSurfIthOp
DEDeleteIthOp
DEGetIthOp
DESetIthOp
|
Copyright © Photon Engineering, LLC
|
|