making composit grid  - 複数のデータを優先度をつけて重ねたグリッドをつくる 

  使うコマンド  grdsample, grdmath 図化スクリプト付き(makecpt,grdimage,grdcontour,psbasemap)




bash スクリプト例 (図化まで)

#  make composit grid file
#      foreground: multibeam bathymetry
#      background: altimetry

# parameter setting
region=137:40/137:55/16:40/17           # grid region east/west/south/north
interval=0.04m                          # grid interval
tension=0.65                             # tension factor
radius=1k                               # search radius
xyzfile=area.xyz                        # input xyz file
blkfile=area.blk                        # block file
grdfile=area.grd                    # output grid file
maskfile=area.mask.grd              # mask file
maskedfile=area_masked.grd          # final masked grid
backgrd=altibathy.grd          # background grid file (low resolution)
backgrdsamp=altibathy_resamp.grd    # resampled backgorund grid file
compgrdfile=area_composit.grd       # composit grid file
#
gmt blockmedian $xyzfile -R$region -I$interval -V > $blkfile
gmt surface $blkfile -R$region -I$interval -T$tension -G$grdfile -fg -V
gmt grdmask $blkfile -R$region -I$interval -NNaN/1/1 -S$radius -G$maskfile -V
grdmath $grdfile $maskfile OR = $maskedfile
gmt grdsample $backgrd -I$interval -R$region -G$backgrdsamp -V
gmt grdmath $maskedfile $backgrdsamp AND = $compgrdfile

# plot
proj=M10                                # map projection and scale
ticks=f1ma10m                            # boundary tick info
frame=WSne+tsoundings_on_altimetry                     # boundary frame info
climit=-6000/-3500/500                  # color table min/max/interval
cint=200                                # contour interval
cptfile=haxby_area.cpt                  # color table
psfile=area_composit.ps                  # output postscript file name
gmt makecpt -Chaxby -T$climit -Z > $cptfile
gmt grdimage $compgrdfile -R$region -J$proj -C$cptfile -K -V > $psfile
gmt grdcontour $maskedfile -R$region -J$proj -C$cint -A$aint -L$limit -Wthinner -K -V -O >> $psfile
gmt psbasemap -R$region -J$proj -B$ticks -B$frame -O  -V >> $psfile
#




Tips