Re: 2-panel skewT plot

From: steve kirby <thin_runner_at_nyahnyahspammersnyahnyah>
Date: Wed Oct 19 2011 - 09:07:25 MDT

I was able to solve the problem yesterday after all.  What I meant was having 1 skewT at the top and another below it.  I had to make sure to set vpXF and vpYF each time I drew and that fixed things. thanks, Steve ________________________________ From: Mary Haley <haley_at_ucar.edu> To: steve kirby <thin_runner_at_yahoo.com> Cc: "ncl-talk_at_ucar.edu" <ncl-talk_at_ucar.edu> Sent: Tuesday, October 18, 2011 10:23 PM Subject: Re: [ncl-talk] 2-panel skewT plot Steve, I'm not sure what you mean by "one panel" versus "two panel". Do you have an image that shows the problem? Have you tried using the paneling capability in the skew-T code? See example 5 at: http://www.ncl.ucar.edu/Applications/skewt.shtml --Mary On Oct 18, 2011, at 11:07 AM, steve kirby wrote: I'm trying to generate a 2-panel skewT plot, using vpXF and vpYF to offset things, but it is still plotting in one panel; not sure why.  Maybe someone can tell me what I'm doing wrong: >============================================================================================= >;read data > 25 diri="./" > 26 fili="lru1400_07_15_2010_revised.TXT"    ;jul15 > 27 ;fili="lru1400_07_16_2010_revised.TXT"   ;jul16 > 28 ;fili="lru1400_08_20_2010_revised.TXT"   ;aug20 > 29 ;fili="lru1400_12_02_2010_revised.TXT"   ;dec02 > 30 nlvl=101    ;jul15 > 31 ;nlvl=106   ;jul16 > 32 ;nlvl=42    ;aug20 > 33 ;nlvl=49     ;dec02 > 34 ncol=6 > 35 TestData = asciiread(diri+fili,(/nlvl,ncol/),"float") > 36 > 37 > 38 z = TestData(:,0) > 39 p = TestData(:,1) > 40 tc = TestData(:,2) > 41 tdc = TestData(:,3) > 42 wdir = TestData(:,4) > 43 ;convert ws to knots (from m/s) > 44 wspd = TestData(:,5) * 1.9438444924406 >wspd@_FillValue = -999. > 47 wdir@_FillValue = -999. > 48 > 49 > 50 > 51 ;****************************************************** > 52 ;create plot > 53 ;****************************************************** > 54 wks=gsn_open_wks(type,"skewt") > 55 > 56 ;skewT 1 - WRF control and raob > 57 ;--- create background skew-T and plot sounding ---------------- > 58 skewtOpts = True > 59 skewtOpts_at_vpXF=0.08   ;offset from left > 60 skewtOpts_at_vpYF=0.94   ;offset from bottom! > 61 skewtOpts_at_vpWidthF=0.40   ;size of plot > 62 skewtOpts_at_vpHeightF=0.40   ;size of plot > 63 skewtOpts_at_DrawColAreaFill=True ; default is False > 64 skewtOpts_at_tiMainString = "LRU A/P 7/15/2010 20:05 RAOB;WRF w/ TAMDAR" > 65 ; skewtOpts_at_tiMainString = "LRU A/P 7/16/2010 20:27 RAOB;WRF w/ TAMDAR" > 66 ;skewtOpts_at_tiMainString = "LRU A/P 8/20/2010 19:54 RAOB;WRF w/ TAMDAR" > 67 ;skewtOpts_at_tiMainString = "LRU A/P 12/2/2010 20:00 RAOB;WRF w/ TAMDAR" > 68 skewtOpts_at_DrawFahrenheit = True >skewtOpts_at_DrawHeightScale = True        ;plot height scale on side > 70 skewtOpts_at_DrawHeightScaleFt = False     ;plot height scale in km > 71 > 72 skewt_bkgd=skewT_BackGround(wks,skewtOpts) > 73 > 74 ;draw background > 75 draw(skewt_bkgd) > 76 delete(skewtOpts) > 77 > 78 dataOpts = True ;options describing data plotting > 79 dataOpts_at_ThermoInfo=False > 80 dataOpts_at_colTemperature = "black" > 81 dataOpts_at_colDewPt = "blue" > 82 ;dataOpts_at_linePatternTemperature = 2 ;(line dash) defaults to 1 (solid) > 83 ;dataOpts_at_linePatternTemperature = 1 ;(line dash) defaults to 1 (solid) > 84 ;dataOpts_at_linePatternDewPt = 8 ;defaults to 1 (solid) > 85 ;dataOpts_at_linePatternDewPt = 14 ;defaults to 1 (solid) > 86 ;dataOpts_at_linePatternDewPt = 1 ;defaults to 1 (solid) > 87 ;dataOpts_at_linePatternCape = 8 ;defaults to 1 (solid) > 88 ;dataOpts_at_colWindP = "black" > 89  dataOpts_at_Wthin = 2 >skewt_data=skewT_PlotData(wks,skewt_bkgd,p,tc,tdc,z,wspd,wdir,dataOpts) > 93 > 94 ;******* draw the RAOB T, Td ********** > 95 draw(skewt_data) > 96 delete(dataOpts) > 97 > 98 > 99 ;========================================================================= >100 ;========================================================================= >101 ;========================================================================= >102 ;***********now, the WRF profile****************************************** >103 ;========================================================================= >104 ;========================================================================= >105 ;========================================================================= >106 atamdar=addfile("./TAMDAR_WRF/wrfout_d02_2010-07-15_20_00_00.nc","r");           ;jul15 >107 acontrol=addfile("./CONTROL_WRF/wrfout_d02_2010-07-15_20_00_00.nc","r");           ;jul15 >108 ;atamdar=addfile("./TAMDAR_WRF/wrfout_d02_2010-07-16_20_00_00.nc","r");          ;jul16 20z >109 ;acontrol=addfile("./CONTROL_WRF/wrfout_d02_2010-07-16_20_00_00.nc","r");          ;jul16 20z >;a=addfile("./TAMDAR_WRF/wrfout_d02_2010-07-16_21_00_00.nc","r");      ;jul1    6 21z >111 ;a=addfile("./CONTROL_WRF/wrfout_d02_2010-07-16_21_00_00.nc","r");      ;jul    16 21z >112 ;a=addfile("./TAMDAR_WRF/wrfout_d02_2010-08-20_20_00_00.nc","r");      ;aug2    0 >113 ;a=addfile("./CONTROL_WRF/wrfout_d02_2010-08-20_20_00_00.nc","r");      ;aug    20 >114 ;a=addfile("./TAMDAR_WRF/wrfout_d02_2010-12-02_20_00_00.nc","r");      ;dec0    2 >115 ;a=addfile("./CONTROL_WRF/wrfout_d02_2010-12-02_20_00_00.nc","r");      ;dec    02 >116 XLAT=atamdar->XLAT >117 XLONG=atamdar->XLONG >118 >119 ;get the variables >120 wrftctamdar=wrf_user_getvar(atamdar,"tc",0) >121 wrftdtamdar=wrf_user_getvar(atamdar,"td",0) >122 wrfptamdar=wrf_user_getvar(atamdar,"pressure",0) >123 wrfztamdar=wrf_user_getvar(atamdar,"z",0) >124 uvmtamdar=wrf_user_getvar(atamdar,"uvmet",0) >;;;; >128 ; get ij point in model domain for location of interest >129 ; loc(1) is south-north (y) and loc(0) is west-east (x) >130 ; ensure this point is in the domain, as we are not checking >131 ; we are interested in NCL array pointers, so subtract 1 >132 loc=wrf_user_ll_to_ij(atamdar,-106.91,32.28,True) ;jul15 >133 ;loc=wrf_user_ll_to_ij(a,253.07,32.28,True) ;jul16 >134 latlon=wrf_user_ij_to_ll(atamdar,83,68,True) >135 ;loc=wrf_user_ll_to_ij(a,253.07,32.28,True) ;jul16 >136 ;loc=wrf_user_ll_to_ij(a,-79.,36.,True) >137 locX=loc(0)-1 >138 locY=loc(1)-1 >139 >140 >141 rh=wrf_user_getvar(atamdar,"rh",0) >142 >143 ;extract u and v from uvm array and convert to knots >144 utamdar=uvmtamdar(0,:,:,:)*1.94386 >145 vtamdar=uvmtamdar(1,:,:,:)*1.94386 >146 >147 r2d=45.0/atan(1.0)     ;conversion factor, radians to degrees >148 wdtamdar = atan2(utamdar,vtamdar)*r2d+180 >windspeedtamdar=sqrt(utamdar^2 + vtamdar^2) >152 >153 >154 >155 >156 dataOpts=True >157 dataOpts_at_colTemperature = "yellow" >158 dataOpts_at_colDewPt = "aquamarine" >159 ;new location for winds (default is 45) >160 ;dataOpts_at_xpWind = 40. >161 dataOpts_at_xpWind = 100.    ;until WRF winds fixed, plot them off screen!!!! >162 dataOpts_at_colWindP = "orange" >163 >164 skewTtamdar_data = skewT_PlotData (wks,skewt_bkgd,wrfptamdar(:,locY,locX),\ >165                                            wrftctamdar(:,locY,locX),\ >166                                            wrftdtamdar(:,locY,locX),\ >167                                            wrfztamdar(:,locY,locX),\ >168                                            utamdar(:,locY,locX),\ >169                                            vtamdar(:,locY,locX),\ >170                                            dataOpts) >171 >172 draw(skewTtamdar_data) >173 delete(dataOpts) >;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; >178 ;now plot the control WRF data >179 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; >180 wrftccontrol=wrf_user_getvar(acontrol,"tc",0) >181 wrftdcontrol=wrf_user_getvar(acontrol,"td",0) >182 wrfpcontrol=wrf_user_getvar(acontrol,"pressure",0) >183 wrfzcontrol=wrf_user_getvar(acontrol,"z",0) >184 uvmcontrol=wrf_user_getvar(acontrol,"uvmet",0) >185 dataOpts=True >186 dataOpts_at_vpXF=0.05 >187 dataOpts_at_vpYF=0.45 >188 dataOpts_at_vpWidthF=0.40   ;size of plot >189 dataOpts_at_vpHeightF=0.40   ;size of plot >190 dataOpts_at_colTemperature = "gray" >191 dataOpts_at_colDewPt = "green" >192 ;new location for winds (default is 45) >193 ;dataOpts_at_xpWind = 40. >194 dataOpts_at_xpWind = 100.    ;until WRF winds fixed, plot them off screen!!!! >195 dataOpts_at_colWindP = "orange" >196 ;dataOpts_at_linePatternTemperature = 8 ;(line dash) defaults to 1 (solid) >197 dataOpts_at_linePatternTemperature = 2 ;(line dash) defaults to 1 (solid) >198 ;dataOpts_at_linePatternDewPt = 8 ;defaults to 1 (solid) >199 dataOpts_at_linePatternDewPt = 20 ;defaults to 1 (solid) >ucontrol=uvmcontrol(0,:,:,:)*1.94386 >201 vcontrol=uvmcontrol(1,:,:,:)*1.94386 >202 >203 r2d=45.0/atan(1.0)     ;conversion factor, radians to degrees >204 wdcontrol = atan2(ucontrol,vcontrol)*r2d+180 >205 >206 skewTcontrol_data = skewT_PlotData (wks,skewt_bkgd,wrfpcontrol(:,locY,locX),    \ >207                                            wrftccontrol(:,locY,locX),\ >208                                            wrftdcontrol(:,locY,locX),\ >209                                            wrfzcontrol(:,locY,locX),\ >210                                            ucontrol(:,locY,locX),\ >211                                            vcontrol(:,locY,locX),\ >212                                            dataOpts) >213 >214 draw(skewTcontrol_data) >215 >216 ;close the frame >217 frame(wks) >218 >219 end >  >  >  >  >  >  > _______________________________________________ >ncl-talk mailing list >List instructions, subscriber options, unsubscribe: >http://mailman.ucar.edu/mailman/listinfo/ncl-talk >

_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Wed Oct 19 09:07:34 2011

This archive was generated by hypermail 2.1.8 : Wed Oct 19 2011 - 13:36:10 MDT