[gradsusr] Displaying the appropriate vectors to show the updrafts and downdrafts of a storm arbitrary cross section

Nimrod Micael nmicael at aggies.ncat.edu
Tue Nov 26 17:50:19 EST 2013


I have storm I am analyzing but the vectors are not displaying
appropriately. I am trying to show the appropriate updrafts and downdrafts
of the storm.


My code:


'reinit'
>
> 'open 20110416_d03.ctl'
> 'set display color white'
> 'clear'
> 'set map 2 1 5'
> 'set annot 1 12'
> 'set xlopts 1 6 .17'
> 'set ylopts 1 6 .16'
> 'set mpdset hires'
> 'set grid off'
> 'set timelab off'
> 'set csmooth on'
> *'set gxout shaded'
> 'set t 84'
> *light green to dark green
> 'set rgb 31 230 255 225'
> 'set rgb 32 200 255 190'
> 'set rgb 33 180 250 170'
> 'set rgb 34 150 245 140'
> 'set rgb 35 120 245 115'
> 'set rgb 36  80 240  80'
> 'set rgb 37  55 210  60'
> 'set rgb 38  30 180  30'
> 'set rgb 39  15 160  15'
> *light beige to dark brown
> 'set rgb 71 250 240 230'
> 'set rgb 72 240 220 210'
> 'set rgb 73 225 190 180'
> 'set rgb 74 200 160 150'
> 'set rgb 75 180 140 130'
> 'set rgb 76 160 120 110'
> 'set rgb 77 140 100  90'
> 'set rgb 78 120  80  70'
> 'set rgb 79 100  60  50'
> 'set xlint 1.5'
> ********************************************************
> *
> *          Color Shades
> *******************************************************
> 'set rgb 59 0 0 0'
> 'set rgb 60 15 15 15'
> 'set rgb 61 30 30 30'
> 'set rgb 62 45 45 45'
> 'set rgb 63 60 60 60'
> 'set rgb 64 75 75 75'
> 'set rgb 65 90 90 90'
> 'set rgb 66 105 105 105'
> 'set rgb 67 120 120 120'
> 'set rgb 68 135 135 135'
> 'set rgb 69 150 150 150'
> 'set rgb 70 165 165 165'
> 'set rgb 71 180 180 180'
> 'set rgb 72 195 195 195'
> 'set rgb 73 210 210 210'
> 'set rgb 74 225 225 225'
> 'set rgb 75 245 245 245'
> 'set rgb 76 255 255 255'
> *light yellow to dark red
> 'set rgb 20 255 250 200'
> 'set rgb 21 255 250 170'
> 'set rgb 22 255 232 120'
> 'set rgb 23 255 192  60'
> 'set rgb 24 255 160   0'
> 'set rgb 25 255  96   0'
> 'set rgb 26 255  50   0'
> 'set rgb 27 225  20   0'
> 'set rgb 28 192   0   0'
> 'set rgb 29 165   0   0'
> *light blue to dark blue
> 'set rgb 81 225 255 255'
> 'set rgb 82 180 240 250'
> 'set rgb 83 150 210 250'
> 'set rgb 84 120 185 250'
> 'set rgb 85  80 165 245'
> 'set rgb 86  60 150 245'
> 'set rgb 87  40 130 240'
> 'set rgb 88  30 110 235'
> 'set rgb 89  20 100 210'
> 'set rgb 40 0 0 0'
> 'set rgb 41 0 236 236'
> 'set rgb 42 1 160 246'
> 'set rgb 43 0 0 246'
> 'set rgb 44 0 255 0'
> 'set rgb 45 0 200 0'
> 'set rgb 46 0 144 0'
> 'set rgb 47 255 255 0'
> 'set rgb 48 231 192 0'
> 'set rgb 49 255 144 0'
> 'set rgb 50 255 0 0'
> 'set rgb 51 214 0 0'
> 'set rgb 52 192 0 0'
> 'set rgb 53 255 0 255'
> 'set rgb 54 153 85 201'
> 'set rgb 55 255 255 255'
> * These are the BLUE shades
> 'set rgb 16   0   0 255'
> 'set rgb 17  55  55 255'
> 'set rgb 18 110 110 255'
> 'set rgb 19 165 165 255'
> 'set rgb 20 220 220 255'
> 'c'
> 'set background 0'
> 'set line 0'
> 'draw rec 0 0 11 8.5'
> 'set lev 1000 100'
> *'define prs = 100'
> *'qv = qvapor'
> *'th = theta'
> *"define e=0.01*prs*qv/(0.6219718+qv)+1e-20"
> *"define t=th*pow((prs/100000.0),(287.04/1005.7))"
> *"define tlcl=55.0+2840.0/(3.5*log(t)-log(e)-4.805)"
> *"define
> the=t*pow(100000.0/prs,0.2854*(1.0-0.28*qv))*exp(((3376.0/tlcl)-2.54)*qv*(1.0+0.81*qv))"
> "define vvort= hcurl(u,v)"
>
> *******************************************************************************************
> 'set x 1'
> 'set y 10'
> *'set lev 1000 100'
> *'set lat 35.65 35.75'
> *'set lon 280.95 281.3'
> *'set gxout shaded'
> 'set parea 1 9.25 1 7.75'
> * ARBITRARY CROSS-SECTION defined by lon1-lat1 lon2-lat2
>
> *lon1=281.2 (78.8)*
> *lon2=281.36 (78.64)*
> *lat1=35.78*
> *lat2=35.86**Vector winds projected in the plane
> m=(lat2-lat1)/(lon2-lon1)
> angle=math_atan(m)
> xproj = math_cos(angle)
> yproj = math_sin(angle)
> lon=lon1
> lat=lat1
> 'collect 1 free'
> 'collect 2 free'
> 'collect 3 free'
> 'collect 4 free'
> *'collect 5 free'
> 'collect 6 free'
> 'collect 7 free'
> while (lon<=lon2)
>      'collect 1 gr2stn(w,'lon','lat')'
>      'collect 2 gr2stn(u,'lon','lat')'
>      'collect 3 gr2stn(v,'lon','lat')'
>      'collect 4 gr2stn(dbz,'lon','lat')'
> *    'collect 5 gr2stn(the,'lon','lat')'
>     'collect 6 gr2stn(mag(u,v),'lon','lat')'
>     'collect 7 gr2stn(vvort,'lon','lat')'
>      say lon
>      say lat
>      lon=lon+0.013
>      lat=lat1 + (lat2-lat1)*(lon-lon1) / (lon2-lon1)
> endwhile
> 'set arrlab off'
> 'set grads off'
> 'set x 1 50'
> "* Display vector winds projected into plane
> 'set gxout vector'
> 'set ccolor 1'
> 'set arrscl 0.2 7'
> 'set cthick 6'
> 'd
> skip(coll2gr(2,-u)*'%xproj%'+coll2gr(3,-u)*'%yproj%',2,2);coll2gr(1,-u)*10'"
> So I dont see what I did wrong. Here's the image.
>
>
Thanks for the help.


Also the range that is being displayed is incorrect

It should be from 78.64 W to 78.8 W NOT 84.05W to 83.55 W.

I dont understand why it's not displaying that.


Thanks!


-- 

> Nimrod Micael
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://gradsusr.org/pipermail/gradsusr/attachments/20131126/dd9bb047/attachment-0001.html 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: SevereWeather.png
Type: image/png
Size: 46509 bytes
Desc: not available
Url : http://gradsusr.org/pipermail/gradsusr/attachments/20131126/dd9bb047/attachment-0001.png 


More information about the gradsusr mailing list