[Thread Prev][Thread Next][Index]
Re: Can ferret deal with scattered plot?
Hello Gaorz,
Ferret can overplot the locations of points on an existing chart
using the plot/over/vs command. But from the sample data records you
supplied you may have two other issues in mind
1) the longitude and latitude values have hemisphere indicated
with N,S,E,W whereas Ferret needs numbers only
2) there are values associated with each location; perhaps you
have in mind plotting a different symbol at the locations
depending on these values, or doing an overlay line contour
The first issue is easy to deal with. Suppose your data is in a file
called gaorz.d - I'll add some W and S points because if there were
ONLY values in one quarter of the globe say NE (or NW, or SE, or SW) all
you'd have to do would be to strip out these characters and define
latitude and longitude appropriately
unix> cat gaorz.d
120.5E 23.5S 7
117.5W 16.5N 8
112.5E 22.5S 2
110.5W 18.5N 4
105.5E 7.5S 10
112.5W 15.5N 3
109.5E 3.5S 20
122.5W 19.5N 15
...
Use "sed" or some other method to change the N,S,E,W characters
into + or - ones
unix> sed 's/E/ 1/;s/W/ -1/;s/N/ 1/;s/S/ -1/' gaorz.d > gaorz.new
unix> cat gaorz.new
120.5 1 23.5 -1 7
117.5 -1 16.5 1 8
112.5 1 22.5 -1 2
110.5 -1 18.5 1 4
105.5 1 7.5 -1 10
112.5 -1 15.5 1 3
109.5 1 3.5 -1 20
122.5 -1 19.5 1 15
...
Now you enter your Ferret session and make your underlying contour plot
use etopo20
region/x=100:260/y=-25:25
fill rose
! enter your data triplets from the gaorz.new file
file/form=free/var=xx,hx,yy,hy,value gaorz.new
! and convert xx,hx to east longitude, yy,hy to north latitude
let lon=if(hx gt 0)then xx else 360-xx ; let lat = hy*yy
can region
plot/o/vs/nolab lon,lat
! now the locations have been overplotted on the initial contoured chart
If there were just a few values of the third variable in the original
dataset you might choose to plot a different symbol for each value (or
range of values) as for example
let mask=if((value ge 5) and (value lt 10))then 1
plot/over/vs/set/nolab mask*lon,mask*lat
ppl line,1,2,3 ; ppl plot/over ! large X for this range
let mask=if((value ge 10) and (value lt 15))then 1
plot/over/vs/set/nolab mask*lon,mask*lat
ppl line,1,20,3 ; ppl plot/over ! large triangles for this range
...
Or you could use different colors for the marks. An alternative
might be to use the POLYMARK method for the overlays.
On the other hand it might be better to use one of the SCATTERTOGRID
tools to convert the triplets (lon,lat,value) to gridded values
(lon,lat,value) -> gridval
(see the mail archives) and then overlay line contours on your
original chart
set region ...
fill rose
contour/over/nolab/lev=... gridval
Hope this is of some help,
Mick
|--****--****-*---*---***--***--|____spillane@pmel.noaa.gov____|
|-*__---*-----*--*-*--*--*-*--*-|_SCIENCE APPLICATIONS SUPPORT_|
|--***--*-----*-*---*-***--***--|____EPIC/Ferret/PlotPlus______|
|-----*-*-----*-*****-*----*----|__Room 2070 Bldg#3 NOAA/PMEL__|
|-****---****-*-*---*-*----*----|____Phone_:_(206)526-6780_____|
[Thread Prev][Thread Next][Index]
Dept of Commerce /
NOAA /
OAR /
PMEL /
TMAP
Contact Us | Privacy Policy | Disclaimer | Accessibility Statement