Navigation: Scripting Reference Manual > Functions & Subroutines > ARNCreate2DComplexFromDouble

 

ARNCreate2DComplexFromDouble

 

Contact Us: fredsupport@photonengr.com

 

Description

This function takes a 2D ARN and converts the data from a double array into a complex array.  This command is particularly useful when the user wants to perform a 2D FFT on a dataset which isn't complex by default (ex. Irradiance).  Converting the double array into a complex array allows the user to perform the FFT calculation using ARNFFT2D.

 

 

Syntax

compARN = ARNCreate2DComplexFromDouble( arnNode )

 

 

Parameters

compARN (Long)

Node number of the new ARN containing the complex dataset.

 

arnNode As Long

Node number of the ARN whose data is being converted from double to complex.

 

 

Example

The following example creates several Analysis Results Nodes and manipulates their data by either taking a Log or performing an FFT.

 

Sub Main

 

    ARNDeleteAllNodes()

    DeleteRays()

    TraceCreate()

 

    Dim anaNode As Long

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

 

    Dim rayCnt As Long

    Dim arnNode As Long

    rayCnt = IrradianceToARN( anaNode, "Detector Irradiance", arnNode )

 

    'Log10 relative

    Dim newARN As Long

    newARN = ARNCreateCopy( arnNode, "Detector Irradiance Rel." )

    ARNLog10WithRelativeFloor( newARN, 2, False, True )

    ARNDisplayInChart( newARN, "" )

 

    'Log10 absolute

    newARN = ARNCreateCopy( arnNode, "Detector Irradiance Abs." )

    ARNLog10WithAbsoluteFloor( newARN, 66000, True, True )

    ARNDisplayInChart( newARN, "" )

 

    'FFT

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

    IrradianceToARN( anaNode, "Detector Irradiance", arnNode )

    newARN = ARNCreate2DComplexFromDouble( arnNode )

    ARNFFT2D( newARN )

    ARNDisplayInChart( newARN, "" )

 

End Sub

 

See Also

ARN Script Commands

 

 

 

 

 

Copyright © Photon Engineering, LLC