help plot vector

View: New views
2 Messages — Rating Filter:   Alert me  

help plot vector

by Johnson Smith :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi evryone
    I have a file contasns five column as follows:

Missing values >=      255
COLUMN 1: Longitude
COLUMN 2: Latitude
COLUMN 3: Zonal component of Ocean Wind Vector (m/s)
COLUMN 4: Meridional component of Ocean Wind Vector (m/s)
COLUMN 5: Magnitude of Ocean Wind Vector (m/s)
 
I want to plot a image like this(Please see attached). How would I do? your
help will be highly appreciated!


Regards!
Johnson

To unsubscribe, send the message "signoff gmt-help" to listserv@...


califonia.bmp (1M) Download Attachment

Re: help plot vector

by Benjamin C. Horner-Johnson-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Quoting Johnson Smith <chenyindeyouxian@...>:

>     I have a file contasns five column as follows:
> Missing values >=      255
> COLUMN 1: Longitude
> COLUMN 2: Latitude
> COLUMN 3: Zonal component of Ocean Wind Vector (m/s)
> COLUMN 4: Meridional component of Ocean Wind Vector (m/s)
> COLUMN 5: Magnitude of Ocean Wind Vector (m/s)
>
> I want to plot a image like this(Please see attached). How would I do? your
> help will be highly appreciated!

It looks like you should be able to use xyz2grd, grdimage, and  
grdvector to make the plot.

Which values are set to >= 255 to indicate missing (columns 3, 4, and 5)?

awk '$3 < 255 {print $1,$2,$3}' datafile | xyz2grd -Igridspace -Rregion \
      -Gzonal.grd

awk '$4 < 255 {print $1,$2,$4}' datafile | xyz2grd -Igridspace -Rregion \
      -Gmeridional.grd

awk '$5 < 255 {print $1,$2,$5}' datafile | xyz2grd -Igridspace -Rregion \
      -Gmagnitude.grd

You'll have to set up a color palette (grd2cpt or makecpt).

grdimage magnitude.grd -Cpalette.cpt -Jproj -Rregion -K > plot.ps
grdvector zonal.grd meridional.grd -Jproj -Rregion -O -Q >> plot.ps

Something like the script outline above should work.

Good luck,

Ben Horner-Johnson
ben@...

To unsubscribe, send the message "signoff gmt-help" to listserv@...