GMT: The Generic Mapping Tools



Similar documents
A Crash Course on UNIX

Thirty Useful Unix Commands

Unix Sampler. PEOPLE whoami id who

ICS 351: Today's plan

Basic C Shell. helpdesk@stat.rice.edu. 11th August 2003

Unix Shell Scripts. Contents. 1 Introduction. Norman Matloff. July 30, Introduction 1. 2 Invoking Shell Scripts 2

AN INTRODUCTION TO UNIX

Command Line Crash Course For Unix

WinSCP PuTTY as an alternative to F-Secure July 11, 2006

Tutorial Guide to the IS Unix Service

Introduction to the UNIX Operating System and Open Windows Desktop Environment

Linux Overview. Local facilities. Linux commands. The vi (gvim) editor

User Guide Version 3.0

Fundamentals of UNIX Lab Networking Commands (Estimated time: 45 min.)

Unix the Bare Minimum

L01 Introduction to the Unix OS

Fred Hantelmann LINUX. Start-up Guide. A self-contained introduction. With 57 Figures. Springer

Lab 1 Beginning C Program

Basic Linux and Unix commands, editing and transfering files

Downloading Files using FTP

University of Toronto

Cisco Networking Academy Program Curriculum Scope & Sequence. Fundamentals of UNIX version 2.0 (July, 2002)

Command Line - Part 1

UNIX, Shell Scripting and Perl Introduction

1 Basic commands. 2 Terminology. CS61B, Fall 2009 Simple UNIX Commands P. N. Hilfinger

Introduction to Linux and Cluster Basics for the CCR General Computing Cluster

Linux command line. An introduction to the Linux command line for genomics. Susan Fairley

Introduction to Mac OS X

USEFUL UNIX COMMANDS

Hadoop Hands-On Exercises

Beginners Shell Scripting for Batch Jobs

Hands-On UNIX Exercise:

LECTURE-7. Introduction to DOS. Introduction to UNIX/LINUX OS. Introduction to Windows. Topics:

UNIX / Linux commands Basic level. Magali COTTEVIEILLE - September 2009

Using SSH Secure Shell Client for FTP

HP-UX Essentials and Shell Programming Course Summary

Unix Guide. Logo Reproduction. School of Computing & Information Systems. Colours red and black on white backgroun

INASP: Effective Network Management Workshops

Introduction to Running Hadoop on the High Performance Clusters at the Center for Computational Research

STEP 4 : GETTING LIGHTTPD TO WORK ON YOUR SEAGATE GOFLEX SATELLITE

Syntax: cd <Path> Or cd $<Custom/Standard Top Name>_TOP (In CAPS)

The Linux Operating System and Linux-Related Issues

List of FTP commands for the Microsoft command-line FTP client

FTP Manager. User Guide. July Welcome to AT&T Website Solutions SM

LSN 10 Linux Overview

Tutorial 0A Programming on the command line

BioSense 2.0. User Community Extension Project. Getting Started With The Data Lockers. Information Contributed by:

Table of Contents Introduction Supporting Arguments of Sysaxftp File Transfer Commands File System Commands PGP Commands Other Using Commands

Introduction to Shell Programming

Open Source Computational Fluid Dynamics

Birmingham Environment for Academic Research. Introduction to Linux Quick Reference Guide. Research Computing Team V1.0

Lab 1: Introduction to the network lab

Linux Shell Script To Monitor Ftp Server Connection

Unix Scripts and Job Scheduling

Lecture 18 Regular Expressions

A UNIX/Linux in a nutshell

Lab 1: Introduction to C, ASCII ART and the Linux Command Line Environment

Introduction to Unix Tutorial

1 Intro 1. 2 man - Accessing On-Line Manual Pages 1. 3 pwd - Print the Working Directory 2. 4 cd - Changing Directory 2

SFTP SHELL SCRIPT USER GUIDE

An Introduction to the Linux Command Shell For Beginners

Exercises: FreeBSD: Apache and SSL: pre SANOG VI Workshop

1 The Gigalog S board send regularly its data by ftp to the database. The board may also send information about the board, like the GPS position.

Agenda. Using HPC Wales 2

SSH Connections MACs the MAC XTerm application can be used to create an ssh connection, no utility is needed.

USER S MANUAL. ArboWebForest

WWA FTP/SFTP CONNECTION GUIDE KNOW HOW TO CONNECT TO WWA USING FTP/SFTP

Secure File Transfer Installation. Sender Recipient Attached FIles Pages Date. Development Internal/External None 11 6/23/08

Programming for GCSE Topic H: Operating Systems

Automating admin tasks using shell scripts and cron Vijay Kumar Adhikari.

Automating FTP with the CP IT

Week Overview. Running Live Linux Sending from command line scp and sftp utilities

Cygwin command line windows. Get that Linux feeling - on Windows

Guide to the Configuration and Use of SFTP Clients for Uploading Digital Treatment Planning Data to IROC RI

ESP -- SURF Center : ESP GUI Users Guide

Higher National Unit Specification. General information for centres. Multi User Operating Systems. Unit code: DH3A 34

New Lab Intro to KDE Terminal Konsole

Unix Tools. Overview. Editors. Editors nedit vi Browsers/HTML Editors Mail Tools Utilities xv xman ftp

Operating System Structure

Human Resources Installation Guide

Kernel. What is an Operating System? Systems Software and Application Software. The core of an OS is called kernel, which. Module 9: Operating Systems

UNIX Tutorial for Beginners

Introduction to UNIX and SFTP

Secure Shell. The Protocol

Shell Scripts (1) For example: #!/bin/sh If they do not, the user's current shell will be used. Any Unix command can go in a shell script

Introduction to. UNIX Bob Booth December 2004 AP-UNIX2. University of Sheffield

Using SVN to Manage Source RTL

Introduction to Laboratory Works

Navigating the Rescue Mode for Linux

Beyond Windows: Using the Linux Servers and the Grid

HPCC - Hrothgar Getting Started User Guide

The Basics of FTP. Basic Order of Operations: Commands: FTP (File Transfer Protocol) allows a user to transfer files to/from a remote network site.

LOCKSS on LINUX. Installation Manual and the OpenBSD Transition 02/17/2011

13. Configuring FTP Services in Knoppix

Guide to the Configuration and Use of SFTP Clients for Uploading Digital Treatment Planning Data to ITC

CGS 1550 File Transfer Project Revised 3/10/2005

File Transfer Protocol (FTP) Chuan-Ming Liu Computer Science and Information Engineering National Taipei University of Technology Fall 2007, TAIWAN

Basic Linux & Package Management. Original slides from GTFO Security

Installing the SSH Client v3.2.2 For Microsoft Windows

UNIX Basics. Ian Darwin TCP Informatics January, Presented from a Mac using Apple s Keynote presentation software

Transcription:

GMT: The Generic Mapping Tools GMT = a software package to create high-quality postscript maps and graphs in various projections. Output includes standard x-y-plots as well as complicated maps combined with other geographical referenced data. Around 6000 scientists and engineers worldwide are using GMT in their work GMT is a highly effective way for creating customized, professional looking maps or graphs. More information and on-line manual: http://gmt.soest.hawaii.edu/

Example output

GMT: The Generic Mapping Tools GMT comes as a set of more than 50 programs and tools, each of them performing a specific task. Most of the time, only 5-6 of these programs are used to plot maps or simple graphs. GMT programs are either called from the command-line or from shell-scripts. GMT commands can be called from you code (C, Fortran, etc.) or from shell-scripts

Your first GMT map At the command prompt, type: pscoast -R0/360/-70/70 -Jm1.2e-2i -Ba60f30/a30f15 -Dc -G240 -W1/0 -P > GMT_mercator.ps To display the resulting map, type: gv GMT mercator.ps Figure 1: My first GMT map!

What did we just type? A GMT command to plot coastlines: pscoast Followed by a series of arguments in the form -...: -R0/360/-70/70 = select frame between longitudes 0/360 and latitudes -70/70 -Jm1.2e-2i = use Mercator projection (m) and a scale of 0.012 degree per inch -Ba60f30/a30f15 = annotate longitude borders every 60 degrees, latitude border every 30 degrees, fill longitude borders every 30 degrees, latitude border every 15 degree. -Dc = use a crude resolution for plotting coastlines -G240 = color landmasses in light grey (0=black, 255=white) -W1/0 = draw coastlines with a 1 point-wide line (i.e. extra thin) in black -P = plot in portrait mode (GMT default is landscape)

Displaying postscript There are several standard tools to display postscript, usually available on most unix systems: ghostview: gs ghostscript: gv ImageMagick: display Note that GMT commands can be directly piped into gv for instance: pscoast -R0/360/-70/70 -Jm1.2e-2i -Ba60f30/a30f15 -Dc -G240 -W1/0 -P gv - (vertical bar) means that the output of GMT is directly fed into (= piped into) gv.

Unix UNIX is an operating system, i.e. it manages the way the computer work by driving the processor, the on-board memory, the disk drives, keyboards, video monitors, etc. and by performing useful tasks for the users UNIX was created in the late 1960s as a multiuser, multitasking system for use by programmers. The philosophy behind the design of UNIX was to provide simple, yet powerful utilities that could be pieced together in a flexible manner to perform a wide variety of tasks.

Unix: basic commands login, logout, work environment Current directory? pwd Creating a new directory: mkdir directory Changing directory: Go to home directory: cd or cd user name Go to directory /home/users/ecalais/work: cd /home/users/ecalais/work Go to directory one level below: cd.. List the content of a directory: ls List all files (includind those starting with a.): ls -a Show details (ownership, date, etc): ls -l

Unix: basic commands Create empty file: touch file1 Copying a file: cp file1 file2 Moving (= renamimg) a file: mv file2 file3 Removing a file: rm file3 Viewing files: cat file name more file name Editing files: vi file name, emacs file name edit file name (opens a new window) Manual pages: man unix command

Unix: basic commands Connect to remote computer: ssh username@remote.domain Transfer files between computers by ftp: Establish connection with: ftp computername.domain For secure connection use: sftp computername.domain Anonymous ftp: ftp computername.domain, username = anonymous, password your email address Change directory on the server: cd directory Change directory on the host: lcd directory Transfer in binary mode: binary Download a file: get file Upload a file: put file

Unix: variables set day = 1 echo $day echo $day > junk echo $day > /dev/null @ day = $day + 1 echo $day >> junk cat junk Note that: > redirects the output of a command to a file. If the file did not exist, it is created. If the file already existed, it is overwritten! >> appends the output of a command to a file. If the file did not exist, it is created. If the file already existed, the output is appended.

Unix: if set day = 2 if ($day == 2) then echo you win else echo you loose endif Try with day = 1...

Unix: while / foreach set day = 1 while ($day < 10) echo This is file $day > file.$day @ day ++ end foreach f (*) end echo This is file: $f

Unix: awk echo 3 2 awk {print $1,$2} echo 3 2 awk {print $1/$2} echo 3 2 awk {print int($1/$2}} echo 4 awk {print sqrt($1)} echo 1234567 awk {print substr($1,1,4))} echo 1234567 awk {print substr($1,5,3))} set a = echo 1234567 awk {print substr($1,1,4))} set b = echo 1234567 awk {print substr($1,5,3))} set c = $a$b echo $c

Unix: grep echo TOTO > junk echo TATA >> junk echo TITI >> junk cat junk grep TATA junk grep TATA junk awk {print substr($1,1,2)} set TA = grep TATA junk awk {print substr($1,1,2)} echo $TA

Unix: background/foreground processes, kill gv ˆC (control-c) gv ˆZ (control-z) bg jobs -l kill job_number gv & jobs -l kill job_number

Unix: background/foreground processes, kill gv & ps -elf ps -elf more ps -elf grep ecalais ps -elf grep gv kill job_number

CSH scripts Scripts are programs written in Unix, with different possible flavors: sh, csh, bash, ksh, etc... We will be using csh. Write a file with the following content, save it as my script.csh: #!/bin/csh -f echo n What is your name? set name = $< if ($name == eric) then echo Hello $name else echo I dont know you, bye. endif

Running CSH scripts Run your script: csh my script.csh Make your script executable and run it: ls -al my_script.csh chmod +x my_script.csh ls -al my_script.csh my_script.csh

Your first GMT script Create a script file gmt1.csh with the following content: pscoast -R0/360/-70/70 -Jm1.2e-2i -Ba60f30/a30f15 -Dc -G240 -W1/0 -P > GMT_mercator.ps gv GMT_mercator.ps & Run it using: csh gmt1.csh Or make it executable first: chmod +x gmt1.csh And then run it: gmt1.csh

Your second GMT script Let s plot the same map as before twice on the same page, shifted vertically by 4 inches. You GMT script gmt2.csh looks like: pscoast -R0/360/-70/70 -Jm1.2e-2i -Ba60f30/a30f15 -Dc -G240 -W1/0 -P -K > GMT_mercator.ps pscoast -R -Jm -Ba60f30/a30f15 -Dc -G240 -W1/0 -O >> GMT_mercator.ps gv GMT_mercator.ps & Run your script using: csh gmt2.csh Or make it executable first: chmod +x gmt2.csh And then run it: gmt2.csh

Your second GMT script Note that: The contents of -R and -J do not need to be repeated The first line creates file GMT mercator.ps (with >), the second line appends to that file (with >>) -K means that more code will be added later: therefore, every GMT command, except the last one, must have -K -O means overlay on top of previous command: therefore, every GMT command, except the first one, must have -O -P (for portrait mode) does not need to be repeated

Assignment Using a csh script, create on the same page 4 maps of North America (20<lat<65 and -140<lon<-50) using: A Mercator projection, grey land masses, white oceans, black coastline with crude resolution, lat/lon borders annotated every 20 degrees and filled every 5 degrees Same as above, but light brown land masses, light blue oceans, intermediate resolution coastlines, a 1500 km long map scale located in the bottom right corner of the map Same as above, with all major rivers in blue pen, state boundaries in dashed solid black, country borders in solid red, coastline in dark blue. Same as above, using a Lambert projection, without the map scale, with a title, and the lat/lon annotations along the S and E sides only.

Assignment Figure 2: Your output should look like this...