[gradsusr] printim particles traj
Martin V. Mathew
vmartinmathew at gmail.com
Thu Nov 14 23:22:32 EST 2013
Hi Antonella,
The script I sent you earlier reads coordinates of the trajectory from text
files. An example of such a text file is attached with this mail (longitude
in first column and latitude in second column). The script uses functions
subline and subword to read data from the text files. Such functions are
not required read data when the data is in binary station data format.
The script I sent you earlier will not require extensive modification if
the trajectory data can be written in text file similar to the attached one
(you may have to add a third column for time). I can help you If you find
it very hard to tweak the script.
regards
martin
On 14 November 2013 19:45, <antonia.dimaio at cnr.it> wrote:
> Hi
> I d0n' know whi but the command 'printim' doesn't work. Can be a lib
> problem?
> Anyway, I tried to mofify a script sent to me by Martin to plot track
> cyclone and so I could produce a image output.eps.
>
> The question now is that this layout is just the final image of the
> tracking while I want produce an image for eache timestep.
> Martin open a netcdf file while I have a ctl file (map and dat,
> too). How can I modify the following part of the script to read my ctl
> file? I don't know how use subline and subwrd functions to find lat
> and lon using a ctl file
>
> Thank you very much!!
> Antonella
>
>
> *===========================================================================
> * 9) Plotting cyclone tracks
>
> *===========================================================================
> dta1=trkNo
> dta=0
> while(dta1>0)
> dta=dta+1
> *dtaFile=InFile2Prt%trkFile.dta
> dtaFile=datum1.ctl
> say 'reading from file 'dtaFile
> res=read(dtaFile) ;* skipping first line of cyclone track data file
> say 'title line 'res
> rows=trk1.dta
> res=read (dtaFile);* Reading first lat lon points
> anslin2=sublin(res,2)
> say 'second row ' res
> lonpt1=subwrd (anslin2,1)
> latpt1=subwrd (anslin2,2)
> 'q w2xy 'lonpt1' 'latpt1
>
>
> *'q w2xy 100 28' will give result as 'X = 6.22321 Y = 8.08214'
> * 'x1 = subwrd(result,3)', will take '6.22321', which is in 3rd
> position in 'result'
> * and save it in 'x1'
> x1=subwrd(result,3)
> y1=subwrd(result,6)
>
> while(rows>1)
>
> res=read (dtaFile)
> anslin2=sublin(res,2)
> lonpt2=subwrd (anslin2,1)
> latpt2=subwrd (anslin2,2)
>
> 'q w2xy 'lonpt2' 'latpt2
> x2=subwrd(result,3)
> y2=subwrd(result,6)
>
> 'set line 'LnClr' 'LnStyl;*set line color# <style> <thickness>
> 'draw line 'x1' 'y1' 'x2' 'y2
>
>
> My ctl file is following (I want plot the variabel 'age'):
>
> dset datum1.dat
> dtype station
> stnmap datum1.map
> undef -999.0
> title PIW-6
> tdef 85 linear 23:57z11jul2013 30mn
> vars 3
> sta 0 99 State
> age 0 99 Age
> ort 0 99 Orientation
> endvars
>
> ----------------------------------------------------------------
> This message was sent using IMP, the Internet Messaging Program.
>
>
> _______________________________________________
> gradsusr mailing list
> gradsusr at gradsusr.org
> http://gradsusr.org/mailman/listinfo/gradsusr
>
--
Martin V. Mathew
Research scholar
Centre for Oceans, Rivers, Atmosphere and Land Sciences (CORAL)
IIT Kharagpur
India.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://gradsusr.org/pipermail/gradsusr/attachments/20131115/6eeddcbb/attachment.html
-------------- next part --------------
%track1
91.81 08.26
91.27 08.82
90.60 10.10
90.26 10.79
90.19 11.75
89.64 13.86
90.04 15.89
91.05 18.84
92.03 20.81
93.00 22.20
93.08 22.29
93.66 23.13
More information about the gradsusr
mailing list