100 likes | 279 Views
Computer Applications on Geosciences Surface gridding,bicubic trend and 1D tracking. Teacher : Dr.T.K.Wang Student : 楊本中. 1. 2. 3. 4. 5. Gridding of data and trend surfaces
E N D
Computer Applications on Geosciences Surface gridding,bicubic trend and 1D tracking Teacher : Dr.T.K.Wang Student : 楊本中
1. 2. 3. 4. 5.
Gridding of data and trend surfaces • This example shows how one goes from randomly spaced data points to an evenly sampled surface. First we plot the distribution and values of our raw data set (table 5.11 from example 12). We choose an equidistant grid and run blockmean which preprocesses the data to avoid aliasing. The dashed lines indicate the logical blocks used by blockmean; all points inside a given bin will be averaged. The logical blocks are drawn from a temporary file we make on the fly within the shell script. The processed data is then gridded with the surface program and contoured every 25 units. A most important point here is that blockmean, blockmedian, or blockmode should always be run prior to running surface, and both of these steps must use the same grid interval. We use grdtrend to fit a bicubic trend surface to the gridded data, contour it as well, and sample both gridded files along a diagonal transect using grdtrack. The bottom panel compares the gridded (solid line) and bicubic trend (dashed line) along the transect using psxy (Figure 7.14):
Example 14. GMT supports several gridding algorithms. Perhaps the most used is the continuous curvature splines in tension algorithm which was used in this example to grid the data shown in example 12. Also shown is a comparison of the gridded surface and a low order polynomial trend surface. Several GMT modules were used to make this figure: blockmean and surface prepared the grid from non-uniformly spaced data, psxy and pstext drew points, lines, and text, grdcontour did the contouring, grdtrend determined a bicubic trend surface, and grdtrack sampled both the grid and trend surface along an arbitrary track.
資料取得 • http://www.seismology.harvard.edu 哈佛網站的地震資料同第一週做地震球的方式取得
Surface gridding,bicubic trend and 1D tracking • #! /bin/csh • ###### File:ray:/d23/guykiko/GMT3.4ex/GMT3.4examples/ex14/job14.gmt • ###### Author: Ming-Kai Chen, 9 Oct 2002 • ###### GMT EXAMPLE 14 • ###### $Id: job14.csh,v 1.1.1.1 2000/12/28 01:23:45 gmt Exp $ • ###### Purpose: Showing simple gridding, contouring, and resampling along tracks • ###### GMT progs: blockmean, grdcontour, grdtrack, grdtrend, minmax, project, pstext • ###### psbasemap, psxy, surface • set input1 = table_5.11 • set inxyz1 = mean.xyz • set outgrd1 = data.grd • set outgrd2 = trend.grd
set output1 = track • set output2 = data.d • set output3 = trend.d • set outps1 = example_14.ps • set range1 = 0/7/0/7 • set range2 = 0.5/7.5/0.5/7.5 • set proj1 = X3.06i/3.15i • set proj2 = H0/6i • set proj3 = H180/6i • set frame1 = 2f1WSNe • set frame2 = 0g1 • set frame3 = 2f1ESNw • set frame4 = 2f1WSne • set frame5 = 2f1wSnE • set frame6 = 1/50WSnE
1. # First draw network and label the nodes • gmtset GRID_PEN 0.25pta • psxy $input1 -R$range1 -J$proj1 -B$frame1 -Sc0.05i -G0 -P -K -Y6.45i -V > $outps1 • awk '{printf "%g %s 6 0 0 5 %g\n", $1+0.08, $2, $3}' $input1 | \ • pstext -R -JX -N -O -K -V >> $outps1 • blockmean $input1 -R$range1 -I1 -V > $inxyz1 2. # Then draw blocmean cells • psbasemap -R$range2 -JX -B$frame2 -X3.25i -O -K -V >> $outps1 • psxy -R$range1 -JX -B$frame3 $inxyz1 -Ss0.05i -G0 -O -K -V >> $outps1 • awk '{printf "%g %s 6 0 0 5 %g\n", $1+0.1, $2, $3}' $inxyz1 | \ pstext -R -JX -W255o -C0.01i/0.01i -N -O -K -V >> $outps1
3. # Then surface and contour the data • surface $inxyz1 -R -I1 -T0.35b -G$outgrd1 -V • grdcontour $outgrd1 -JX -B$frame4 -C25 -A50 -G3i/10 -S4 \ • -X-3.25i -Y-3.55i -O -K -V >> $outps1 • # other option: -S4 • psxy -R -JX $inxyz1 -Ss0.05i -G0 -O -K -V >> $outps1 4. # Fit bicubic trend to data and compare to gridded surface • grdtrend $outgrd1 -N10 -T$outgrd2 -V • grdcontour $outgrd2 -JX -B$frame5 -C25 -A50 -G3i/10 -S4 -X3.25i -O -K -V >> $outps1 • project-C0/0 -E7/7-G0.1 -Fxy -V > $output1 • psxy -R -JX $output1 -W1pto -O -K -V >> $outps1
# Sample along diagonal • grdtrack $output1 -G$outgrd1 -V | cut -f3,4 > $output2 • grdtrack $output1 -G$outgrd2 -V | cut -f3,4 > $output3 • psxy $output2 `minmax $output2 $output3 -I0.5/25` -JX6.3i/1.4i -B$frame6 -W1p \ • -X-3.25i -Y-1.9i -O -K -V >> $outps1 • psxy $output3 -R -JX -W0.5pta -O -U"Example 14 in Cookbook" -V >> $outps1 ######################################################################################## • #\rm mean.xyz track *.grd *.d .gmt* • #imagetool $outps1 & • gv $outps1 &