Navigation: Scripting Reference Manual > Functions & Subroutines > ARNLinearCombination

 

ARNLinearCombination

 

Contact Us: fredsupport@photonengr.com

 

Description

Linearly combines two ARN datasets together according to C = a*A + b*B, where C represents the resulting dataset after combining A and B.  The linear combination is applied on a cell by cell basis and the resulting dataset is stored in the aNode parameter.

 

Syntax

ARNLinearCombination aScalar, aNode, bScalar, bNode

 

Parameters

aScalar As Double

Scale factor for the data contained in aNode.

 

aNode As Long

Node number for the first ARN.  Results of the linear combination are written to this ARN.

 

bScalar As Long

Scale factor for the data contained in bNode.

 

bNode As Long

Node number for the second ARN.

 

 

Remarks

The following example creates an ARN from an Illuminance calculation, copies the ARN and performs a linear combination.

 

Dim arn1node As Long

Dim arn2node As Long

Dim anaNode As Long

Dim data() As Double

 

'Get the node number of the analysis surface

anaNode = FindFullName( "Analysis Surface(s).Analysis 1" )

 

'Delete existing ARN nodes

ARNDeleteAllNodes()

 

'Calculate irradiance using Lumens/mm2 and then copy to a new ARN

numRays = IlluminanceToARN( anaNode, 0, -1, 1, "arn1Test", arn1node )

arn2node = ARNCreateCopy( arn1node, "arn2Test" )

 

'Perform a linear combination, results placed in arn1node

ARNLinearCombination 1, arn1node, 3, arn2node

 

 

See Also

All ARN Scripting Commands

 

 

 

 

 

Copyright © Photon Engineering, LLC