Arbitrary cross section - need help

Heiner Körnich heiner at MISU.SU.SE
Mon Dec 4 02:56:56 EST 2006


Hi,

you can try mine, which i constructed around stuff that I have found in
the GrADS-webpages. I added for example the x-axis which shows distance
in km.
Check the parameter dlon if you want a finer resolution.

Good luck,
Heiner

Elizabeth Austin wrote:
> Hello all,
>
> A while back someone posted a script to plot an arbitrary cross section.
> I tried to modify it to plot turbulent kinetic energy but keep getting
> the message: incorrect input args.
>
> As you will see, I do not know what to put for x1 and x2. I am also not
> sure if I am modifying the script correctly. I am trying to draw a cross
> section from:
> 39.3°N, 94.6°W to 38.0°N, 92.6°W
>
> The script is pasted at the end of this message
>
> Any help or suggestions would be much appreciated.
> Thanks,
> Elizabeth Austin
>
> WeatherExtreme Ltd.
> elizabeth at weatherextreme.com
>
>
> function cross_sec(args)
> say 'Usage: cross_sec var lon1 lon2 x1 x2 lat1 lat2 lev1 lev2'
> say '       tkeprs   ----   variable'
> say '       -94.6  ----   leftmost longitude'
> say '       -92.6  ----   rightmost longitude'
> say '       x1    ----   leftmost x coordinate'
> say '       x2    ----   rightmost x coordinate'
> say '       38.0  ----   southmost latitude'
> say '       39.33  ----   northmost latitude'
> say '       1000  ----   lowmost level'
> say '       500  ----   highmost level'
> var  =  subwrd(args,1)
> lon1 =  subwrd(args,2)
> lon2 =  subwrd(args,3)
> x1   =  subwrd(args,4)
> x2   =  subwrd(args,5)
> lat1 =  subwrd(args,6)
> lat2 =  subwrd(args,7)
> lev1 =  subwrd(args,8)
> lev2 =  subwrd(args,9)
> if(var=''|lon1=''|lon2=''|x1=''|x2=''|lat1=''|lat2=''|lev1=''|lev2='');
> say 'Incorrect input args';
> return;
> endif
> 'set grads off'
> 'set zlog on'
> 'set x 1'
> 'set y 1'
> 'set z 'lev1' 'lev2''
> lon = lon1
> 'collect 1 free'
> while (lon <= lon2)
>  lat = lat1 + (lat2-lat1)*(lon-lon1) / (lon2-lon1)
>  'collect 1 gr2stn('var','lon','lat')'
>  lon = lon + 1
> endwhile
> 'set x 'x1' 'x2''
> 'set xaxis 'lon1' 'lon2
> 'set clab on'
> 'set gxout shaded'
> 'd tkeprs'
> 'cbarn.gs'
> return

--
Heiner Körnich
Dept. of Meteorology            Tel:  +46 8 164333
Stockholms University, SE-106 91 Stockholm, Sweden
Email: heiner at misu.su.se   www.misu.su.se/~heiner/

-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: section.gs
Url: http://gradsusr.org/pipermail/gradsusr/attachments/20061204/21986383/attachment.pl 


More information about the gradsusr mailing list