Navigation: Scripting Reference Manual > Functions & Subroutines > Wavefront

 

Wavefront

 

Contact Us: fredsupport@photonengr.com

 

Description

Computes the wavefront from a complex scalar field by using phase unwrapping.

 

Syntax

Wavefront scalarReal, scalarImag, wf

 

Parameters

scalarReal() As Double

Array containing the real components of the complex scalar field

 

scalarImag() As Double Array

Array containing the imaginary components of the complex scalar field

 

wf() As Double

Return array containing the wavefront from the calculation

 

Remarks

This subroutine computes the wavefront from a complex scalar field by using phase unwrapping. If there is a problem the subroutine sets an error and returns without modifying the parameters.

 

See Also

ScalarField

CoherentRaySize

 

Example

This example computes the scalar field of a coherent source from which the wavefront and its statistics are then calculated.

 

1.  Declare a T_ANALYSIS structure, arrays to hold the real & imaginary parts of the field, an array to hold the wavefront values, arrays to hold pixel locations, and variable to hold the minimum and maximum wavefront values.

2.  Use LoadAnalysis to populate the T_ANALYSIS structure based upon a predefined Analysis surface.

3.  Find the node number of the source using the FindFullName command. Optionally, the FindName command could be used to determine the node number.

4.  Calculate the Scalar Complex Field and place results in arrays reals and imags.

5.  Use the real and imaginary field components to calculate the wavefront.

6.  Calculate the wavefront statistics.

7.  Print minimum and maximum wavefront values and their pixel locations to the output window.


'step 1

Dim ana As T_ANALYSIS
Dim reals() As Double
Dim imags() As Double
Dim wf() As Double
Dim wfMaxLoc() As Long
Dim wfMinLoc() As Long
Dim wfMin#,wfMax#

LoadAnalysis 5, ana                                  'step 2
sid=FindName("Source 1")                             'step 3
count = ScalarField ( sid, -1, ana, reals, imags )   'step 4
Wavefront reals, imags, wf                           'step 5
ArrayStats wf, wfMin, wfMax, junk,junk, wfMinLoc, wfMaxLoc      'step 6
Print "wavefront max value is ",wfMax, " at pixel position ",wfMaxLoc(0),wfMaxLoc(1)   'step 7
Print "wavefront min value is ",wfMin, " at pixel position ",wfMinLoc(0),wfMinLoc(1)
 

 

 

 

 

 

Copyright © Photon Engineering, LLC