Correspondence from Paul Wessel about plotting phase 2-D

Subject:
             Re: phase data
       Date:
             Tue, 2 Mar 1999 23:12:32 -1000
      From:
             Paul Wessel <pal.wessel@geologi.uio.no>
         To:
             Hans-Georg Scherneck <hgs>
 References:
             1 , 2
 
 
 

>(1) I'd like to get complex data into preferably one grd file.

That will require a full redefinition of what grdfiles may contain
and won't happen anytiome soon (it may be addressed in the future when
we consider expanding the format to allow for 3-D data cubes).

In the mean time you will have to use 2 grids.  In separate mails
I am sending you tide.ps, a color amplitude plot with phase contours,
and the GMT 3.2 script that made it.  Pls comment if the plot looks
as expected; of course you cannot run the script but notice the -Zp
option to grdcontour.

-p

Paul Wessel, Professor
Dept. of Geology & Geophysics
School of Ocean & Earth Science & Technology
University of Hawaii at Manoa
1680 East-West Road,
Honolulu, HI 96822
(808) 956-4778/5154 (voice/fax)
[http://www.soest.hawaii.edu/wessel/wessel.html]


#!/bin/csh
#
# Amplitude/phase plot of M2 ocean tide
gmtset TICK_LENGTH 0.05i HEADER_FONT_SIZE 24p
# Make real and imag grids
awk '{print $1, $2, $5}' M2v53.xyz | xyz2grd -R-560/660/-560/600 -I20 -Greal.grd -V
awk '{print $1, $2, $6}' M2v53.xyz | xyz2grd -R -I20 -Gimag.grd -V
#Get amp and phase grids
grdmath imag.grd real.grd HYPOT = amp.grd
grdmath imag.grd real.grd ATAN2 180 MUL PI DIV = phase.grd
grd2cpt amp.grd > amp.cpt
echo 'N 255' >> amp.cpt
grdimage amp.grd -Jx0.0055 -Camp.cpt -P -B100WSne:."M@-2@- ocean tide (amp + phase)": -K > tide.ps
grdcontour phase.grd -C10 -A30 -G0.5 -Zp -Jx0.0055 -O -N\\312 -V >> tide.ps
gv tide.ps &

\rm -f imag.grd real.grd amp.grd phase.grd amp.cpt



Look at the beautiful result