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

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




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
#
gmt begin area_composit
    gmt makecpt -Chaxby -T$climit -Z
    gmt grdimage $compgrdfile -R$region -J$proj
    gmt grdcontour $maskedfile -C$cint -A$aint -L$limit -Wthinner
    gmt basemap -B$ticks -B$frame
gmt end show
#




Tips