Navigation: Scripting Reference Manual > Functions & Subroutines > SourcePrimGetParmLEDff

 

SourcePrimGetParmLEDff

 

Contact Us: fredsupport@photonengr.com

 

Description

This function retrieves the configuration parameters from an LED (far-field) type Source Primitive.  A boolean is returned indicating whether the parameters were successfully retrieved.

 

 

Syntax

success = SourcePrimGetParmLEDff( spNode, tLED, angles(), apods() )

 

 

Parameters

success (Boolean)

Returned boolean indicating whether the parameters were successfully retrieved from the source node.

 

spNode As Long

Node number of the LED (far-field) type Source Primitive being queried.

 

tLED as T_SOURCEPRIMLED

Data structure containing the configuration parameters of the LED model.

 

angles() As Double

Array of values defining the angles, in degrees, at which the corresponding intensity data is sampled.  The relative intensity data is stored in the apods() array.

 

apods() As Double

Array of values defining the relative intensity values of the source emission at the angular sample points given in the angles() array.

 

Example

The example below demonstrates how to retrieve the configuration data from an LED (far-field) type Source Primitive node and report the information to the output window.  A custom function, PrintApodization, is included that prints the angles() and apods() data array values.

 

Sub Main

 

    'LED (far-field) node being queried

    Dim spNode As Long

    spNode = FindFullName( "Optical Sources.LED (far-field)" )

 

    'Retrieve configuration parameters

    Dim success As Boolean

    Dim tLED As T_SOURCEPRIMLEDFF

    Dim angs() As Double, apods() As Double

    success = SourcePrimGetParmLEDff( spNode, tLED, angs(), apods() )

 

    'Print report

    If success Then

        Print ""

        Print "LED (far-field) configuration parameters for source " & GetName( spNode )

        Print "Parameter" & Chr(9) & "Value"

        Print "Aperture Shape " & Chr(9) & tLED.ApeType

        Print "Ray Directions" & Chr(9) & tLED.NumDirPerRay

        Print "Ray Positions" & Chr(9) & tLED.numRays

        Print "Power" & Chr(9) & tLED.power

        Print "Power Units" & Chr(9) & tLED.PowerUnits

        Print "X semi-ape" & Chr(9) & tLED.semiX

        Print "Y semi-ape" & Chr(9) & tLED.semiY

        Print ""

        Print "Apodization Data"

        Print "Angle" & Chr(9) & "Rel. Intensity"

        PrintApodization( angs(), apods() )

    Else

        Print "Unable to retrieve configuration parameters from source."

    End If

 

End Sub

 

Function PrintApodization( ByVal in_angles() As Double, _

                           ByVal in_apods() As Double ) As Long

 

    'Helper function to report intensity apodization data

 

    'Number of sample data points

    Dim nSamps As Long

    nSamps = UBound(in_angles)+1

 

    'Loop over samples and print

    Dim curSamp As Long

    For curSamp = 0 To nSamps-1

        Print in_angles(curSamp) & Chr(9) & in_apods(curSamp)

    Next

 

    'Return number of samples

    Return nSamps

 

End Function

 

See Also

Source Primitive Script Commands

LED (far-field)

SourcePrimSetParmLEDff

T_SOURCEPRIMLEDFF

 

 

 

 

 

Copyright © Photon Engineering, LLC