Hello,
I am trying to use ferret to plot an ascii data file. My data file
is comprised of four columns which include latitude, longitude, and
u and v components respectively. The first ten rows (out of a total
of 56745) looks like this (I have attached the full file
"filename.txt" above):
15.66400 -166.1470 -7.553388 -1.256299
15.66800 -166.0910 -7.556085 -1.258102
15.67200 -166.0360 -7.558600 -1.260010
15.67500 -165.9800 -7.560195 -1.262088
15.67900 -165.9250 -7.560886 -1.265384
15.68200 -165.8690 -7.560416 -1.268836
15.68600 -165.8140 -7.559073 -1.272530
15.69000 -165.7580 -7.556891 -1.277025
15.69300 -165.7030 -7.554591 -1.281174
15.69700 -165.6470 -7.553061 -1.285058
Here is the script I have been using to read it into ferret and plot:
cancel mode logo
set view full
DEFINE AXIS/X=166.946W:149.529W:1/UNIT=degrees salx
DEFINE AXIS/Y=15.664N:26.456N:1/UNIT=degrees saly
DEFINE GRID/X=salx/Y=saly salgrid
FILE/GRID=salgrid/VAR="y,x,u,v"/COL=4 filename.txt
let wind1 = u^2
let wind2 = v^2
let wind3 = (wind1+wind2)^0.5
let wind_speed=wind3*1.94
fill/LEV=(1.8,21,.5)/AXES=1,1,1,1/nolab/NOKEY/PALETTE=rainbow
wind_speed
vector/over u,v
DEFINE AXIS/Z=1:11680:1 vec_len
DEFINE GRID/Z=vec_len vec_grid
FILE/VAR=lon,lat/G=vec_grid hawaii.dat
PLOT/VS/LINE/OVER/COLOR=BLACK/NOLABEL 360+lon,lat
GO ccbar 0.93,0.96 0.22,0.8, 3,21,.5, v,rainbow
I have attached the image the script produces above
(islands_wind.gif). This image is incorrect. With matlab, using
the TriScatteredInterp function, I was able to produce a correct
image of the data (islands_wind_correct.jpg) but unfortunately it is
important that I get this done in ferret. Any suggestions would be
greatly appreciated.
thanks
David
<filename.txt><islands_wind.gif><islands_wind_correct.jpg>