AVS Modules scat 3d Lawrence Berkeley Laboratory NAME scat 3d - resample scattered data over three variables SUMMARY Name scat 3d Type filter Inputs field 1D irregular 3-coordinate scalar float Outputs field 3D irregular 3-coordinate scalar float Parameters _N_a_m_e _T_y_p_e _D_e_f_a_u_l_t _M_i_n _M_a_x Xmin float -1.0 Unbounded Xmax float 1.0 Unbounded Ymin float -1.0 Unbounded Ymax float 1.0 Unbounded Zmin float -1.0 Unbounded Zmax float 1.0 Unbounded Xsamples integer 20 > 0 Ysamples integer 20 > 0 Zsamples integer 20 > 0 Least Squares Points integer 20 9 1.0e5 DESCRIPTION The scat3d module will resample scatter data in 3 variables. A typical use for this module is to take a field of 3-coordinate, scalar values, and resample over a "regular" grid. INPUTS Data Field (required; field 1D irregular 3-coordinate scalar) The input field consists of a 1D field (scatter data) which has scalar floating point data, and associated x,y,z coordinate information. PARAMETERS Xmin,Xmax,Ymin,Ymax,Zmin,Zmax The values of these variables define the coordinate range of the grid over which the input data will be resampled. These values may be adjusted, for example, to form a bounding box around all the input data, or to look at a box enclosing some volume within the input data. Xsamples, Ysamples, Zsamples These values define the resolution of the resampling grid. Increasing these values will result in a "finer" grid, decreasing these values will result in a "coarser" grid (over the same coordinate range defined by Xmin,Xmax, etc.). Least Squares Points This integer value indicates the number of data points to be used in the least squares fit for coefficients defining the nodal function(s). Intuitively, increasing this value will result in a possibly better interpolant, but at the expense of CPU time. A recommended value for this value is 17. The valid range for this value is: 9 < LSP < MIN(4000,number of input points - 1) OUTPUTS Field 3D irregular 3-coordinate scalar float The output field is an "irregular" field consisting of three data dimensions and three coordinate dimensions. The data is a scalar floating point value. EXAMPLE 1 The first example illustrates the use of the scat3d module to resample a scatter field, then extract a 2-d slice from the resulting 3-d field, then display that 2-d slice. READ IRREGULAR - where input data consists of 1D scattered data | SCAT 3D | ORTHOGONAL SLICER | FIELD TO MESH | RENDER GEOMETRY | DISPLAY PIXMAP EXAMPLE 2 The second example illustrates the use of the scat3d module to resample a scatter field, then the isosurface module is used to compute an surface of constant value within the 3-d field, then the surface is displayed. READ IRREGULAR - where input data consists of 1D scattered data | SCAT 3D | ISOSURFACE | RENDER GEOMETRY | DISPLAY PIXMAP LIMITATIONS/NOTES The runtime of this module is proportional to the number of input points, not the number of grid points (for output). The numerical portion of this module was obtained from netlib@ornl.gov, and was written by R. Renka at North Texas State University. The following comments were extracted directly from the code: THIS SUBROUTINE COMPUTES A SET OF PARAMETERS A AND RSQ DEFINING A SMOOTH (ONCE CONTINUOUSLY DIFFERENTIABLE) TRI- VARIATE FUNCTION Q(X,Y,Z) WHICH INTERPOLATES DATA VALUES F AT SCATTERED NODES (X,Y,Z). THE INTERPOLANT Q MAY BE EVALUATED AT AN ARBITRARY POINT BY FUNCTION QS3VAL, AND ITS FIRST DERIVATIVES ARE COMPUTED BY SUBROUTINE QS3GRD. THE INTERPOLATION SCHEME IS A MODIFIED QUADRATIC SHEPARD METHOD -- Q = (W(1)*Q(1)+W(2)*Q(2)+..+W(N)*Q(N))/(W(1)+W(2)+..+W(N)) FOR TRIVARIATE FUNCTIONS W(K) AND Q(K). THE NODAL FUNC- TIONS ARE GIVEN BY Q(K)(X,Y,Z) = A(1,K)*DX**2 + A(2,K)*DX*DY + A(3,K)*DY**2 + A(4,K)*DX*DZ + A(5,K)*DY*DZ + A(6,K)*DZ**2 + A(7,K)*DX + A(8,K)*DY + A(9,K)*DZ + F(K) WHERE DX = (X-X(K)), DY = (Y-Y(K)), AND DZ = (Z-Z(K)). THUS, Q(K) IS A QUADRATIC FUNCTION WHICH INTERPOLATES THE DATA VALUE AT NODE K. ITS COEFFICIENTS A(,K) ARE OBTAINED BY A WEIGHTED LEAST SQUARES FIT TO THE CLOSEST NQ DATA POINTS WITH WEIGHTS SIMILAR TO W(K). NOTE THAT THE RADIUS OF INFLUENCE FOR THE LEAST SQUARES FIT IS FIXED FOR EACH K, BUT VARIES WITH K. THE WEIGHTS ARE TAKEN TO BE W(K)(X,Y,Z) = ( (R(K)-D(K))+ / R(K)*D(K) )**2 WHERE (R(K)-D(K))+ = 0 IF R(K) .LE. D(K), AND D(K)(X,Y,Z) IS THE EUCLIDEAN DISTANCE BETWEEN (X,Y,Z) AND NODE K. THE RADIUS OF INFLUENCE R(K) VARIES WITH K AND IS CHOSEN SO THAT NW NODES ARE WITHIN THE RADIUS. NOTE THAT W(K) IS NOT DEFINED AT NODE (X(K),Y(K),Z(K)), BUT Q(X,Y,Z) HAS LIMIT F(K) AS (X,Y,Z) APPROACHES (X(K),Y(K),Z(K)). AVS Modules scat 3d Lawrence Berkeley Laboratory