GMT and Gridded Data Sets
GMT and Gridded Data Sets
& %
' $
• This file contains the world topography and bathymetry with a grid step
of 5 minutes (about 10 km)
& %
' $
& %
' $
• Skip small features with -Q100 (skip if contour defined by less than
100 points)
& %
' $
& %
' $
& %
' $
Color image of gridded data sets
• Before you can display your gridded data set as a color image, you
need to creat a color map = a table that links your data range (e.g.,
elevation) with colors
& %
' $
& %
' $
Add illumination
• Illumination (= shading) can be added to the color image
• But a grd file that contains the illumination data must be created first
& %
' $
Add illumination
Add illumination with -I:
grdimage etopo5.grd -Ietopo5.norm -R0/360/-70/70 \
-JM7i -Cetopo5.cpt -P -B30 > etopo5_map.ps
& %
' $
& %
' $
& %
' $
Global Digital Elevation Models
• ETOPO5: global bathymetry and topography, grid spacing = 5 minutes
(about 10 km)
– http://edcdaac.usgs.gov/gtopo30/gtopo30.html
– http://www2.jpl.nasa.gov/srtm/
– http://edc.usgs.gov/products/elevation.html
– http://edcsgs9.cr.usgs.gov/pub/data/srtm/
& %
' $
& %
' $
Converting a DEM into GMT grd format
• Most DEMs do not come in GMT format: they need to be converted
into netCDF format before they can be used and displayed with GMT
& %
' $
• Then plot:
grdimage ne_africa_sub.grd -Ine_africa_sub.norm -R40/44/10/13
-JM7i -Cmyglobe.cpt -P -B1 > ne_africa_sub.ps
& %
' $
& %
' $
More on displaying gridded files
Let’s resample the grd files every 0.1 minutes:
grdsample ne_africa_sub.grd -Gne_africa_sub_resampled.grd -I0.1m
grdsample ne_africa_sub.norm -Gne_africa_sub_resampled.norm -I0.1m
grdimage ne_africa_sub_resampled.grd -Ine_africa_sub_resampled.norm \
-R40/44/10/13 -JM7i -Cmyglobe.cpt -P -B1 > ne_africa_sub.ps
& %
' $
• Plot coastlines:
pscoast -R -JM -B5 -Di -W2/0 -A100 -O -K >> all.ps
• Note that your could grdcut etopo5.grd and resample the resulting
file at a higher resolution with grdsample
• Add a color scale:
psscale -D3.5/-0.5/7/0.15h -Ba1000:Elevation:/:m: -Cmyglobe.cpt -O >> all.ps
& %
' $
& %
' $
Grid files in 3D
• First, let’s cut the large etopo grid into a smaller subset:
grdcut etopo5.grd -R-76/-55/9/23 -Gnecar.grd
grdcut etopo5.norm -R-76/-55/9/23 -Gnecar.norm
& %
' $
& %