Navigation: Scripting Reference Manual > Functions & Subroutines > SetDiffractPhaseOffsetPerLine

 

SetDiffractPhaseOffsetPerLine

 

Contact Us: fredsupport@photonengr.com

 

Description

Sets the grating line offset when using the continuous phase addition method with diffraction gratings.

 

 

Syntax

SetDiffractPhaseOffsetPerLine surfNode, phaseOffset

 

 

Parameters

surfNode As Long

Surface node ID on which the grating is applied.

 

phaseOffset As Double

Value, in grating line pairs, of the offset between the surface center and the zero phase point in the grating.  Can be non-integer values.

 

 

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