Navigation: Scripting Reference Manual > Functions & Subroutines > SpatiallyResampleVectorField

 

SpatiallyResampleVectorField

 

Contact Us: fredsupport@photonengr.com

 

Description

This function generates a new set of coherent rays from the vector field components calculated on an analysis grid.  For a complete description of its intended usage and implementation, please see the Spatially Resample Field help topic.  It is recommended that you only set the X and Y component fitting flags if their corresponding component actually exists in the field, otherwise errors reported will be related to the lack of a field component rather than an actual failure to resample.  Depending on the number of rays traced, it may be necessary to dimension ray index and ray counter variables as data type Huge_ instead of Long.  Please see Multi-threaded Raytracing for more information.

 

Syntax

count = SpatiallyResampleVectorField( nAna, RefWfShp, RefWfPrms, NumGuess, ReplRays, dRelPowCut, nEnt, nMat, bInclX, bInclY, FldFil, ResXFldFil, RexYFldFil, NRaysDel, MeritVal )

 

Parameters

count (Long or Huge_)

Number of total rays created.

 

nAna As Long

Node number of Analysis Surface. This Analysis Surface must be "attached" to the surface on which the existing coherent rays to be resampled are currently located and can have as many Ray Specification filters as necessary.

 

RefWfShp As Long

Type of wavefront specification: 0 for tilt vector and curvature, 1 for sphere XYZ center. If the fitting algorithm is used (NumGuesses ¹0), this variable determines the dimension of the array RefWfPrms and the whether the array holds tilt vector & curvature, or sphere XYZ center.

 

RefWfPrms() As Double

Array containing wavefront parameters. This array can function as input or output. If used as input, the array must be properly dimensioned before use. The dimension of the array depends upon RefWfShp. For  RefWfShp=0, the array has four elements; elements 0 through 2 contain the X,Y,Z tilt vector and element 3 contains the wavefront curvature. For RefWfShp=1, the array has three elements; elements 0 through 2 contain the sphere X,Y,Z center coordinates. The tilt vector and the sphere center coordinates are given in the coordinate system of the Analysis Surface node nAna.  When used as output, the values represent the last field component that was resampled (i.e. if both X and Y components are created, this will report the parameters for the Y component).

 

NumGuess As Long

Number of guesses allowed during wavefront fitting. For NumGuess=0, fitting is disabled. In this case, RefWfPrms must be dimensioned correctly and supplied values consistent with RefWfShp.

 

ReplRays As Boolean

Flag enabling deletion of old rays after new rays are created. True=delete old rays, False=do not delete old rays. In most cases, old rays should be deleted.

 

dRelPowCut As Double

Rays are not created at pixel locations when the field magnitude falls below this cutoff value relative to the field power maximum.

 

nEnt As Long

Node number of entity rays are associated with after creation.

 

nMat As Long

Immersion material identifier for new rayset.

 

bInclX As Boolean

If True, the X field component will be resampled.

 

bInclY As Boolean

If True, the Y field component will be resampled.

 

FldFil As String

File name (*.fgd) where the vector field of the original rayset will be stored. If a null string is used, no file is written.

 

ResXFldFil As String

File name (*.fgd) where the residual X component of the vector field will be stored. This residual is the difference between the original field and the field after wavefront parameters have been removed. If a null string is used, no file is written.

 

ResYFldFil As String

File name (*.fgd) where the residual Y component of the vector field will be stored. This residual is the difference between the original field and the field after wavefront parameters have been removed. If a null string is used, no file is written.

 

NRaysDel As Long (or Huge_)

Number of rays deleted. Only rays used in the calculation will be deleted.

 

MeritVal As Double

Value of merit function when wavefront fitting option was last invoked.

 

 

See Also

Field Resampling

CreateRaysFromScalarField

CreateRaysFromScalarFieldFile

CreateRaysFromVectorField

CreateRaysFromVectorFieldFile

SpatiallyResampleScalarField

SpatiallyResampleScalarField2

SpatiallyResampleVectorField2

 

 

 

 

 

Copyright © Photon Engineering, LLC