[gradsusr] R: plot name city on the maps
Gianni Cena
giannicena at alice.it
Sun Aug 1 04:49:00 EDT 2010
Thank you Mr Amit Misra,
I have very difficult to compile the script with your raccomandation, this
is my script for freezing level height .. but is not correct !
'open Xtemplate'
'set display color white'
'clear'
'set grads off'
'set poli on'
'set mpdset hires'
*'set mproj scaled'
'set map 1 1 6'
'set grads off'
'exec colors'
'set lat 43.8 46.5'
'set lon 6.6 9.3'
'd quantity'
'query w2xy 7.4 45'
'draw mark 3 7.4 45 0.15'
'draw string 7.4 45 TURIN'
*----------------------------------------------------------
*set number of forecast times here
nf=XXXX
fint=YYYY
t=1
fh=0
while (t<=nf)
'set t 't
cdate = mydate()
chr = subwrd(cdate,1)
cdy = subwrd(cdate,2)
cmo = subwrd(cdate,3)
cyr = subwrd(cdate,4)
*
'set vpage 0 22 1 17'
'set font 1'
'set grads off'
'set gxout shaded'
'set ccols 32 34 36 37 38 22 23 24 25 26 27 28'
'd hgt0deg'
'set gxout contour'
'set clab on'
*'set clab %.0f`3.`1C'
'set ccols 1 1 1 1 1 1 1 1 1 1 1 1'
'set cthick 1'
'd hgt0deg'
'run cbarhov2.gs'
'set string 1 c 7 0'
'set strsiz 0.25'
'draw string 5.5 8.3 WRF SALASSAMETEO * Altezza zero termico'
'set strsiz 0.20'
'draw string 5.5 8.0 Previsione Valida: 'chr''cdy''cmo''cyr''
'draw string 5.5 0.3 GFS Hi-Res, NMM Risoluzione 3Km * 45 Livelli Verticali'
'printim 'fh'_zero.png'
*pull res
'clear'
t=t+1
fh=fh+fint
endwhile
*'!mv *.png ./zero/'
'quit'
*----------------------------------------------------------
*
function mydate
'query time'
sres = subwrd(result,3)
i=1
while (substr(sres,i,1)!='Z')
i=i+1
endwhile
hour = substr(sres,1,i)
isav = i
i = i + 1
while (substr(sres,i,1)>='0' & substr(sres,i,1)<='9')
i = i + 1
endwhile
day = substr(sres,isav+1,i-isav-1)
month = substr(sres,i,3)
year = substr(sres,i+3,4)
return (hour' 'day' 'month' 'year)
Gianni Cena
Da: gradsusr-bounces at gradsusr.org [mailto:gradsusr-bounces at gradsusr.org] Per
conto di Amit Misra
Inviato: domenica 1 agosto 2010 07:33
A: GrADS Users Forum
Oggetto: Re: [gradsusr] plot name city on the maps
Dear Gianni,
Here is the procedure:
set lat lowlat highlat ; setting the latitudes
set lon lowlon highlon ; setting the longitudes
d quantity ; the variable you are
plotting
query w2xy longitude latitude ; here longitude and latitude are
coordinates of Turin.
draw mark 3 x y 0.15 ; x and y are output from the above
query command
draw string x y Turin
That's all. You may need to play with the x value in the final step
according to where you want "Turin" to be displayed (with respect to the
mark).
Best of Luck!
Amit Misra
Indian Institute of Technology
Kanpur
India
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://gradsusr.org/pipermail/gradsusr/attachments/20100801/6c9668c8/attachment-0003.html
More information about the gradsusr
mailing list