<div dir="ltr"><span style="font-family:arial,sans-serif;font-size:13px">Hi Antonella</span><br><div><span style="font-family:arial,sans-serif;font-size:13px"><br></span></div><div style>The GrADS script can be modified to read coordinate data from this text file also. Here beginning of each block can be identified by looking for texts such as ' <span style="color:rgb(0,0,0);white-space:pre-wrap">meanLon        meanLat' </span></div>
<div style><span style="color:rgb(0,0,0);white-space:pre-wrap">or '</span><font color="#000000"><span style="white-space:pre-wrap">id        lon        lat        state        age        orientation'</span></font></div><div style><font color="#000000"><span style="white-space:pre-wrap">Once such text are identified, the required data can be read based on their position relative to the previously identified text.</span></font></div>
<div style><font color="#000000"><span style="white-space:pre-wrap"><br></span></font></div><div style><font color="#000000"><span style="white-space:pre-wrap">Do you want to plot only the mean position at each time or the position of all the particles?</span></font></div>
</div><div class="gmail_extra"><br><br><div class="gmail_quote">On 15 November 2013 16:16, <span dir="ltr"><<a href="mailto:antonia.dimaio@cnr.it" target="_blank">antonia.dimaio@cnr.it</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Hi Martin,<br>
I can use the text file such as you sent to me but I don't know to tweak your script, because in my file there are block of coordinate. In other words, at each time step a new block of coordinates are disponible; I have to plot each block with a different color. Please, find in attach the file.out (it is the originary file for the file.ctl,dat,map sent in my precedent email<br>
I hope you can help me, I find that really very hard<br>
Thank you<br>
Antonella<br>
<br>
<br>
"Martin V. Mathew" <<a href="mailto:vmartinmathew@gmail.com" target="_blank">vmartinmathew@gmail.com</a>> ha scritto:<div class="HOEnZb"><div class="h5"><br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Hi Antonella,<br>
<br>
The script I sent you earlier reads coordinates of the trajectory from text<br>
files. An example of such a text file is attached with this mail (longitude<br>
in first column and latitude in second column). The script uses functions<br>
subline and subword to read data from the text files. Such functions are<br>
not required read data when the data is in binary station data format.<br>
<br>
The script I sent you earlier will not require extensive modification if<br>
the trajectory data can be written in text file similar to the attached one<br>
(you may have to add a third column for time). I can help you If you find<br>
it very hard to tweak the script.<br>
<br>
regards<br>
martin<br>
<br>
<br>
On 14 November 2013 19:45, <<a href="mailto:antonia.dimaio@cnr.it" target="_blank">antonia.dimaio@cnr.it</a>> wrote:<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Hi<br>
I d0n' know whi but the command 'printim' doesn't work. Can be a lib<br>
problem?<br>
Anyway, I tried to mofify a script sent to me by Martin to plot track<br>
cyclone and so I could produce a image output.eps.<br>
<br>
The question now is that this layout is just the final image of the<br>
tracking while I want produce an image for eache timestep.<br>
Martin open a netcdf file while I have a ctl file (map and dat,<br>
too). How can I modify the following part of the script to read my ctl<br>
file? I don't know how use subline and subwrd functions to find lat<br>
and lon using a ctl file<br>
<br>
Thank you very much!!<br>
Antonella<br>
<br>
<br>
*=============================<u></u>==============================<u></u>================<br>
* 9) Plotting cyclone tracks<br>
<br>
*=============================<u></u>==============================<u></u>================<br>
dta1=trkNo<br>
dta=0<br>
while(dta1>0)<br>
dta=dta+1<br>
*dtaFile=InFile2Prt%trkFile.<u></u>dta<br>
dtaFile=datum1.ctl<br>
say 'reading from file 'dtaFile<br>
res=read(dtaFile) ;* skipping first line of cyclone track data file<br>
say 'title line 'res<br>
rows=trk1.dta<br>
res=read (dtaFile);* Reading first lat lon points<br>
anslin2=sublin(res,2)<br>
say 'second row ' res<br>
lonpt1=subwrd (anslin2,1)<br>
latpt1=subwrd (anslin2,2)<br>
'q w2xy 'lonpt1' 'latpt1<br>
<br>
<br>
*'q w2xy 100 28' will give result as 'X = 6.22321 Y = 8.08214'<br>
* 'x1 = subwrd(result,3)', will take '6.22321', which is in 3rd<br>
position in 'result'<br>
* and save it in 'x1'<br>
x1=subwrd(result,3)<br>
y1=subwrd(result,6)<br>
<br>
while(rows>1)<br>
<br>
res=read (dtaFile)<br>
anslin2=sublin(res,2)<br>
lonpt2=subwrd (anslin2,1)<br>
latpt2=subwrd (anslin2,2)<br>
<br>
'q w2xy 'lonpt2' 'latpt2<br>
x2=subwrd(result,3)<br>
y2=subwrd(result,6)<br>
<br>
'set line 'LnClr' 'LnStyl;*set line color# <style> <thickness><br>
'draw line 'x1' 'y1' 'x2' 'y2<br>
<br>
<br>
My ctl file is following (I want plot the variabel 'age'):<br>
<br>
dset datum1.dat<br>
dtype station<br>
stnmap datum1.map<br>
undef -999.0<br>
title PIW-6<br>
tdef 85 linear 23:57z11jul2013 30mn<br>
vars 3<br>
sta 0 99 State<br>
age 0 99 Age<br>
ort 0 99 Orientation<br>
endvars<br>
<br>
------------------------------<u></u>------------------------------<u></u>----<br>
This message was sent using IMP, the Internet Messaging Program.<br>
<br>
<br>
______________________________<u></u>_________________<br>
gradsusr mailing list<br>
<a href="mailto:gradsusr@gradsusr.org" target="_blank">gradsusr@gradsusr.org</a><br>
<a href="http://gradsusr.org/mailman/listinfo/gradsusr" target="_blank">http://gradsusr.org/mailman/<u></u>listinfo/gradsusr</a><br>
<br>
</blockquote>
<br>
<br>
<br>
--<br>
Martin V. Mathew<br>
Research scholar<br>
Centre for Oceans, Rivers, Atmosphere and Land Sciences (CORAL)<br>
IIT Kharagpur<br>
India.<br>
<br>
</blockquote>
<br>
<br>
<br>
------------------------------<u></u>------------------------------<u></u>----<br>
This message was sent using IMP, the Internet Messaging Program.<br>
<br>
</div></div><br>_______________________________________________<br>
gradsusr mailing list<br>
<a href="mailto:gradsusr@gradsusr.org">gradsusr@gradsusr.org</a><br>
<a href="http://gradsusr.org/mailman/listinfo/gradsusr" target="_blank">http://gradsusr.org/mailman/listinfo/gradsusr</a><br>
<br></blockquote></div><br><br clear="all"><div><br></div>-- <br>Martin V. Mathew<br>Research scholar<br>Centre for Oceans, Rivers, Atmosphere and Land Sciences (CORAL)<br>IIT Kharagpur<br>India.<br>
</div>