GMT is a set of tools (command line programs) to manipulating geographic data sets, and in particular to create maps. This set of tools are a great example of the philosofy that should follow all the Unix programs: very light, fast and each tools does just one thing, but does it well. Here there are some examples of the kind of things that you can get with these tools. Maybe the bigger problem with GMT is the complexity when using it, the thousand of options and its dark syntax. In this blog I'll try to post some tips & tricks I have found out up to now... I still learn new things every day.
The general way of plotting a map with GMT is to use several tools sequentially. Each tool adds a new detail in the final result. For example, the coastlines are added with pscoast, shadings are added with grdimage, some symbols are included later with psxy and so on. When a command is called, the output of GMT is EPS code through the standard output of the terminal. Thus, you have to redirect the output after each call to GMT to the same EPF file (which is, by the way, an ASCII file). As you can understand, in order to work sucessfully with GMT, bash scripting is mandatory. Otherwise, you will become mad after just 10 minutes using it.
The syntax is nevertheless quite complex. In the next posts I'll explain some details about it. Anyway, the best place to learn about GMT is, as could be expected in a Unix program, the man pages. Just as a general comment, the syntax is something like:
command -Flag1Options -Flag2Options > file.eps
where command is one of the many GMT tools. Flag1 and Flag2 can be -D, -O, -B,... there are tens of flags which deppend on the exact tool. Finally, Options are the many options you can use for each flag. It's important to note that there is no space between the flag and the option. For example you have to use -Aa0tf10 instead of -A a0 t f10.
Well, I know, it's very complicated. I'll put some examples in the next posts...
0 Comments:
Post a Comment