Navigation: Scripting Reference Manual > Functions & Subroutines > SetAnalysisParameters

 

SetAnalysisParameters

 

Contact Us: fredsupport@photonengr.com

 

Description

Sets the parameters of a given T_ANALYSIS structure, which defines a sample plane used in several analysis commands such as Irradiance, Intensity, etc.

 

Syntax

SetAnalysisParameters semiWidthX, semiWidthY, numX, numY, samplePointAtEdge, ana

 

Parameters

semiWidthX As Double

Sets the new semi width in the X direction.

 

semiWidthY As Double

Sets the new semi width in the Y direction.

 

numX As Long

Sets the new number of cells across the full X aperture.

 

numY As Long

Sets the new number of cells across the full Y aperture.

 

samplePointAtEdge As Boolean

True - Outermost analysis cell's sample point is located at the analysis area semiaperture.

False - Outermost analysis cell's edge is located at the analysis area semiaperture.

(See Remarks section)

 

ByRef ana As T_ANALYSIS

The analysis structure.

 

Remarks

This subroutine sets the parameters of a given analysis structure. If there is a problem the subroutine sets an error and returns without modifying ana.

 

The SetAnalysisParameters subroutine a simple and useful way to properly set the parameters of a sampling plane without knowing in detail the meaning of the individual members of the T_ANALYSIS structure.  See also LoadAnalysis for another convenient way to set the parameters.

 

Consideration should be made with regard to source type when using the samplePointAtEdge parameter. Setting the value to TRUE will be most useful for coherent rays, which are sampled at a single point (analysis cell center). Setting the value to FALSE will be most useful for incoherent rays, which are counted over the analysis cell area (bucket counted).

 

See Also

T_ANALYSIS 

LoadAnalysis 

 

Example

This example uses SetAnalysisParameters to resize and change the resolution for existing Analysis Surface 5 before performing an Irradiance calculation on the object "Detector Plane".

 

1.  Declare a T_ANALYSIS structure and an array to hold results of an Irradiance calculation.

2.  Load the parameters of Analysis Surface 5 into the ana structure.

3.  SetAnalysisParameters sets the window semi-heights and the resolution to 2 units and 51 pixels, respectively.

4.  Find the node number of object named "Detector Plane".

5.  Calculate irradiance on "Detector Plane" and place results in array irrad.

 


Dim ana As T_ANALYSIS:Dim irrad() As Double     'step 1

LoadAnalysis 5, ana                             'step 2
SetAnalysisParameters 2,2, 51,51, False, ana    'step 3
sid=FindName("Detector Plane")                  'step 4
count = Irradiance ( sid, -1, ana, irrad )      'step 5
 

 

 

 

 

 

Copyright © Photon Engineering, LLC