convert .srtm to xyz ord grd I need to plot bathymetry map of my study region and need to convert the .srtm to .xyz or .grd format to use GMT. I tried to do this with grdraster and xyz2grd, but got wrong results. I found that there is srtm2grd command in Linux but I do not have it in my commands. the data are in the following address: ftp://topex.ucsd.edu/pub/srtm30_plus/srtm30/data/
NOTE: This is not the solution to the question in the title but it solves the problem described in the question's text.

Alternative solution

I would download the netCDF files from the grd directory instead of the srtm files from the data directory on the FTP server. The netCDF files can directly be plotted by GMT.

Example

Based on this file: e020n40.nc

#!/bin/bash

outfile=pic.ps
infile=e020n40.nc
invar=z
colorfile=colors.cpt

gmt makecpt -Cviridis -D -T-5200/2400/400 &gt; ${colorfile}

gmt psbasemap -R20/60/-10/40 -JM18 -B4/4"NSEW" -X+1.5c -P -K &gt; ${outfile}
gmt grdimage ${infile}?${invar} -R -J -C${colorfile} -O -K &gt;&gt; ${outfile}
gmt pscoast -J -R -Di -W1,black -O &gt;&gt; ${outfile}


output (pic.ps imported into GIMP v2.8.22 in 60 dpi resolution and with strong antialiasing):