[gradsusr] printim particles traj

antonia.dimaio at cnr.it antonia.dimaio at cnr.it
Fri Nov 15 11:46:42 EST 2013


Hi Martin
I want plot all the particles (as station points) and overlap to them  
the mean position as line

I have in my mind the sequence of instructions, but I cannot translate  
them in script Grads. I always do syntax errors or  
unexpected......'something'
Uff....
Thank you for your attention
Antoenlla

"Martin V. Mathew" <vmartinmathew at gmail.com> ha scritto:

> Hi Antonella
>
> 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 ' meanLon meanLat'
> or 'id lon lat state age orientation'
> Once such text are identified, the required data can be read based on their
> position relative to the previously identified text.
>
> Do you want to plot only the mean position at each time or the position of
> all the particles?
>
>
> On 15 November 2013 16:16, <antonia.dimaio at cnr.it> wrote:
>
>> Hi Martin,
>> 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
>> I hope you can help me, I find that really very hard
>> Thank you
>> Antonella
>>
>>
>> "Martin V. Mathew" <vmartinmathew at gmail.com> ha scritto:
>>
>>
>>  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.
>>>
>>>
>>
>>
>> ----------------------------------------------------------------
>> 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.
>



----------------------------------------------------------------
This message was sent using IMP, the Internet Messaging Program.




More information about the gradsusr mailing list