Navigation: Scripting Reference Manual > Functions & Subroutines > GetDiffractAddPhasePerLine

 

GetDiffractAddPhasePerLine

 

Contact Us: fredsupport@photonengr.com

 

Description

Retrieves the flag determining whether phase is added modulo 2p or continuously across grating lines.  By default, a grating adds phase modulo 2p.

 

 

Syntax

phaseFlag = GetDiffractAddPhasePerLine( surfNode )

 

 

Parameters

phaseFlag (Boolean)

If True, phase is added continuously across grating lines.  If False, phase is added modulo 2p across grating lines.

 

surfNode As Long

Surface node being queried on which the grating is applied.

 

 

Example

The following script example queries a surface with a grating for its phaseFlag.  If phase is being added continuously across grating lines (phaseFlag = True), the phase offset per line is printed to the output window.  If phase is being added modulo 2p across grating lines (phaseFlag = False), the phase flag status is changed and the offset is specified.

 

Dim surfNode As Long

Dim phaseFlag As Boolean

 

'surface with the grating applied

surfNode = FindFullName( "Geometry.Grating.Surface" )

 

'check phase addition flag, modify and print information

phaseFlag = GetDiffractAddPhasePerLine( surfNode )

If phaseFlag Then

          Print "Grating uses continuous phase addition method.  Offset is: " & GetDiffractPhaseOffsetPerLine( surfNode )

Else

          Print "Grating uses modulo 2pi phase addition method."

          Print "Modifying phase method and offset."

          SetDiffractAddPhasePerLine surfNode, True

          SetDiffractPhaseOffsetPerLine surfNode, 5

End If

 

 

See Also

Diffraction Grating Script Commands

Diffraction Gratings

 

 

 

 

 

Copyright © Photon Engineering, LLC