Navigation: Scripting Reference Manual > Functions & Subroutines > SpatiallyResampleScalarField2

 

SpatiallyResampleScalarField2

 

Contact Us: fredsupport@photonengr.com

 

Description

This function generates a new set of coherent rays from the scalar field calculated on an analysis grid.  For a complete description of its intended usage and implementation, please see the Spatially Resample Field help topic.  This is an alternate form of the SpatiallyResampleScalarField function, except that this implementation allows the user to control the beamlet overlap factors.

 

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 = SpatiallyResampleScalarField2( nAna, RefWfShp, RefWfPrms, NumGuess, ReplRays, dRelPowCut, dXOverlap, dYOverlap, nEnt, nMat, FldFil, ResFldFil, NRaysDel, MeritVal )

 

Parameters

count (Long or Huge_)

Number of 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.

 

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.

 

dXOverlap As Double

Beamlet overlap factor in the X direction.  When set to 1.0, beamlet widths are the same as the pixel width of the analysis grid.  Recommended value is 1.5.  Increasing the size of the overlap factor will result in larger beamlet widths and reduce any field amplitude modulation resulting from localized beamlets.  Decreasing the size of the overlap factor will result in narrower beamlets with steeper slopes, but will increase the amplitude modulation effect due to local beamlets.

 

dYOverlap As Double

 Beamlet overlap factor in the Y direction.  When set to 1.0, beamlet widths are the same as the pixel width of the analysis grid.  Recommended value is 1.5.  Increasing the size of the overlap factor will result in larger beamlet widths and reduce any field amplitude modulation resulting from localized beamlets.  Decreasing the size of the overlap factor will result in narrower beamlets with steeper slopes, but will increase the amplitude modulation effect due to local beamlets.

 

nEnt As Long

Node number of entity rays are associated with after creation.

 

nMat As Long

Immersion material identifier for new rayset.

 

FldFil As String

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

 

ResFldFil As String

File name (*.fgd) where the residual scalar field will be stored. This residual is the difference between the original scalar 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 is invoked.

 

 

See Also

Field Resampling

CreateRaysFromScalarField

CreateRaysFromScalarFieldFile

CreateRaysFromVectorField

CreateRaysFromVectorFieldFile

SpatiallyResampleVectorField

SpatiallyResampleScalarField

 

 

 

 

 

Copyright © Photon Engineering, LLC