# REGRID a grid containing a set of three Gaussians
# SET up the grid information array for base grid.
set gInfo(0) -6.0
set gInfo(1) 6.0
set gInfo(2) -6.0
set gInfo(3) 6.0
set gInfo(4) 100
set gInfo(5) 100
set gInfo(6) POINT
set gInfo(7) POINT
set gInfo(8) COLUMN
set gInfo(9) IGNORE
set gInfo(10) NEW:ADD:END
set gInfo(11) -1
set gInfo(12) -5
set gInfo(13) -1.0e30
set gInfo(14) 1.0e30
set gInfo(15) NO
set gInfo(16) NO
# GRID information for a CUT. Only need the cut coordinates
set cgInfo(0) -6.0
set cgInfo(1) 0.0
set cgInfo(2) -3.0
set cgInfo(3) 3.0
# GRID information for a REGRID. Change the initialization value for the
# grid to -50.0
set rgInfo(0) -5.0
set rgInfo(1) 5.0
set rgInfo(2) -5.0
set rgInfo(3) 5.0
set rgInfo(4) 100
set rgInfo(5) 100
set rgInfo(6) POINT
set rgInfo(7) POINT
set rgInfo(8) COLUMN
set rgInfo(9) IGNORE
set rgInfo(10) NEW:ADD:END
set rgInfo(11) -50.0
set rgInfo(12) -5
set rgInfo(13) -1.0e30
set rgInfo(14) 1.0e30
set rgInfo(15) NO
set rgInfo(16) NO
# SET up a data set consisting of three Gaussians centered at (-3,-3),
# (-3, 3) and at (3, 0). Each has a different intensity.
set nP 0
set nG [expr $gInfo(4) * $gInfo(5)]
for { set I 0 } { $I < $nG } { incr I } {
TUgridInfo 20 gInfo rV $I
set X($nP) $rV(2)
set Y($nP) $rV(3)
set R [expr ($X($nP)-3.0) * ($X($nP)-3.0) + ($Y($nP)-3.0) * ($Y($nP)-3.0)]
set A [expr exp(-$R / 6.0)]
set R [expr ($X($nP)-3.0) * ($X($nP)-3.0) + ($Y($nP)+3.0) * ($Y($nP)+3.0)]
set B [expr 3.0 * exp(-$R / 6.0)]
set R [expr ($X($nP)+3.0) * ($X($nP)+3.0) + $Y($nP)*$Y($nP)]
set C [expr 4.0 * exp(-$R / 6.0)]
set V($nP) [expr $A + $B - $C ]
incr nP
}
# GRID the base data set
TUdataGrid $nP 1 X X 1 Y Y V gV Norm gInfo
# CUT the data set from (-6, -3) to (0, 3)
TUgridReGrid CUT gV gInfo gCG cgInfo rNorM
# REGRID the data set from to run from (-5, -5) to (5, 5) keeping the
# same number of cells
TUgridReGrid REGRID gV gInfo gRG rgInfo rNorM
# SET up the plot basics. There are a total of 3 plots defined here.
set GphInfo(xScrL) 580
set GphInfo(yScrL) 600
GraphicsOn TK ETones SWAP
GenWindow 1 0.0 0.0 0.0 1.0 1.0 0.0 0. 0. 0. 1. 1. 0. XY
set WinInfo(2,corFmt) 1
RelWindow 2 1 217.0 350.0 0. 417. 550. 0. -6. -6. 0. 6. 6. 0.
DefinePlot 2 2 $gInfo(4) $gInfo(5)
set WinInfo(6,corFmt) 1
RelWindow 6 1 75.0 65.0 0. 275. 265. 0. -6. -3. 0. 0. 3. 0.
DefinePlot 6 6 $cgInfo(4) $cgInfo(5)
set WinInfo(7,corFmt) 1
RelWindow 7 1 350.0 65.0 0. 550. 265. 0. -5. -5. 0. 5. 5. 0.
DefinePlot 7 7 $rgInfo(4) $rgInfo(5)
# SET up the color map to run from -4.5 to 4.5
PLTcolorMap -4.1 4.1 LINEAR 0 cA
# PLOT the base grid on top
Plot3D 2 Xb Yb Dummy Dummy gV AUTO Dummy cA
# PLOT the grid cut in the lower left-hand plot
Plot3D 6 Xb Yb Dummy Dummy gCG AUTO Dummy cA
# PLOT the regrid in the lower right-hand plot
Plot3D 7 Xb Yb Dummy Dummy gRG AUTO Dummy cA
# THROW up the axis. Annotate all plots since they have different ranges
PlotOutlines 2 [list "" 1.0 "" 1.0] [list BOT BOT BOTH BOTH]
PlotOutlines 6 [list "X" 1.0 "Y" 1.0] [list BOT BOT BOTH BOTH]
PlotOutlines 7 [list "" 1.0 "" 1.0] [list BOT BOT BOTH BOTH]
# LABEL the plots
TextProp 12 HOLD HOLD
WinClip 2 0
TexT 2 0.0 6.50 0.0 center "ORIGINAL" $GphInfo(White)
WinClip 6 0
TexT 6 -3.0 3.40 0.0 center "CUT" $GphInfo(White)
WinClip 7 0
TexT 7 0.0 5.50 0.0 center "REGRID" $GphInfo(White)
update