<div dir="ltr"><div><div><div>Mira, <br><br></div>You have lost your lats/lons in the subtraction. It may have something to do with that. You might want to pull them in at the beginning and then associate them with diff_u and diff_v using:<br></div><div><br></div>diff_u@lon2d = lon<br></div>diff_u@lat2d = lat<br><div><br></div><div>diff_v@lon2d = lon<br>diff_v@lat2d = lat<br><br></div><div>Just pull the lats and lons on the same subsection that you are pulling u/v.<br><br></div><div>-Alex<br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Jun 8, 2015 at 9:30 PM, <span dir="ltr"><<a href="mailto:mberdahl@envsci.rutgers.edu" target="_blank">mberdahl@envsci.rutgers.edu</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi Alex,<br>
I changed it so the vectors were appropriately sized. I just tried the<br>
script with removing the second Magnitude definition and the spacing is<br>
still the same. Any other thoughts?<br>
Mira<br>
<div class="HOEnZb"><div class="h5">> Mira,<br>
><br>
> Why did you change vcres@vcRefMagnitudeF = 10.0 to vcres@vcRefMagnitudeF =<br>
> 1.0 after the first 2 plots were made? This is likely what is causing the<br>
> difference.<br>
><br>
> -Alex<br>
><br>
> On Mon, Jun 8, 2015 at 8:12 PM, <<a href="mailto:mberdahl@envsci.rutgers.edu">mberdahl@envsci.rutgers.edu</a>> wrote:<br>
><br>
>> Hi all,<br>
>> I have a 3 panel plot which shows the winds over a region. The first<br>
>> two<br>
>> panels show averages for selected years, and the third panel shows the<br>
>> difference between the top 2 panels. My problem is that the spacing of<br>
>> wind vectors is much denser in the first two plots than the third<br>
>> "difference" plot. Is there a reason why the grid spacing would<br>
>> suddenly<br>
>> be different (more sparse) when displaying the difference of two wind<br>
>> fields? The sizes (dimensions) of the u and v fields remain the same<br>
>> for<br>
>> each panel.<br>
>> My script and the VarSummaries for some of the variables are below.<br>
>> I will try to attach the pdf of the figure here if possible.<br>
>> Thanks very much for any help.<br>
>> Mira<br>
>><br>
>> ************************************************************<br>
>><br>
>><br>
>> load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl"<br>
>> load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl"<br>
>> load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/contributed.ncl"<br>
>> load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/shea_util.ncl"<br>
>> ;************************************************<br>
>> begin<br>
>> ;************************************************<br>
>> ; read in netCDF file<br>
>> ;************************************************<br>
>> a = addfile("<a href="http://uwnd.mon.mean.nc" target="_blank">uwnd.mon.mean.nc</a>","r")<br>
>> print(a)<br>
>> b = addfile("<a href="http://vwnd.mon.mean.nc" target="_blank">vwnd.mon.mean.nc</a>","r")<br>
>><br>
>> ;************************************************<br>
>> ; read in zonal [u] and meridional [v] winds (July)<br>
>> ;************************************************<br>
>><br>
>> u = a->uwnd(0:803,{45:90},{270:357.5})<br>
>> v = b->vwnd(0:803,{45:90},{270:357.5}) ; Get u, v, time (1),level<br>
>> (1000hpa),latitude(-90:90) and longitude(0:360) data.<br>
>><br>
>> printVarSummary(u)<br>
>> printVarSummary(v)<br>
>><br>
>> ; to take the average over the first dimensions (time)<br>
>> ;uAvgTime = dim_avg_n_Wrap(u,0)<br>
>> ;vAvgTime = dim_avg_n_Wrap(v,0)<br>
>><br>
>> ;printVarSummary(vAvgTime)<br>
>> ;printVarSummary(uAvgTime)<br>
>><br>
>> ; calculate speed from u and v components<br>
>> ;speed = sqrt(uAvgTime^2+vAvgTime^2)<br>
>><br>
>> ; Calculate the seasonal averages.<br>
>> uDJF = month_to_season(u, "DJF")<br>
>> vDJF = month_to_season(v, "DJF")<br>
>><br>
>> printVarSummary(uDJF)<br>
>> printVarSummary(vDJF)<br>
>><br>
>> ; from the matlab script i wrote: findExtremeYrs, i pulled out the<br>
>> extreme<br>
>> years (> or < 1std) that i want to average and plot here.<br>
>><br>
>> ; for ans = 4 (NAO)<br>
>> ; yearList_hi = 1973 1975 1983 1989 1995<br>
>> 2000 2007 2012<br>
>> ; yearList_lo = 1963 1964 1965 1969 1977<br>
>> 1979 1996 1997 2010 2011<br>
>><br>
>> ; ans = 5 (pressure)<br>
>> ;yearList_hi = 1963 1965 1968 1969 1970<br>
>> 1971 1977 1997 2006 2011<br>
>> ;yearList_lo = 1973 1989 1990 1991 1995<br>
>> 1999 2000 2007 2012<br>
>><br>
>> ;ans = 7 (longitude of IL)<br>
>> ;yearList_hi =1966 1967 1968 1969 1974<br>
>> 1975 1983 1994 1995 2005<br>
>> ;yearList_lo =1963 1964 1985 1987 1991<br>
>> 1992 1996 2002 2003 2006 2009<br>
>><br>
>><br>
>> ; this data starts at 1948 (this is index 0), so 1953=5, 1963=10 etc.<br>
>><br>
>> uDJF_NAO_lo = uDJF((/10,11,12,16,24,26,43,44,57,58/),:,:)<br>
>> uDJF_NAO_hi = uDJF((/20,22,30,36,42,47,54,59/),:,:)<br>
>><br>
>> vDJF_NAO_lo = vDJF((/10,11,12,16,24,26,43,44,57,58/),:,:)<br>
>> vDJF_NAO_hi = vDJF((/20,22,30,36,42,47,54,59/),:,:)<br>
>><br>
>> uAvgTime_hi = dim_avg_n_Wrap(uDJF_NAO_hi,0)<br>
>> uAvgTime_lo = dim_avg_n_Wrap(uDJF_NAO_lo,0)<br>
>><br>
>> printVarSummary(uAvgTime_hi)<br>
>> printVarSummary(uAvgTime_lo)<br>
>><br>
>> vAvgTime_hi = dim_avg_n_Wrap(vDJF_NAO_hi,0)<br>
>> vAvgTime_lo = dim_avg_n_Wrap(vDJF_NAO_lo,0)<br>
>><br>
>> printVarSummary(vAvgTime_hi)<br>
>> printVarSummary(vAvgTime_lo)<br>
>><br>
>><br>
>><br>
>> ;************************************************<br>
>> ; create plot<br>
>> ;************************************************<br>
>> wks = gsn_open_wks("eps","Panel_NAO") ; open a ps file<br>
>> plot = new(3,graphic) ; create a plot array<br>
>><br>
>> vcres = True<br>
>> vcres@gsnDraw = False ; dont draw<br>
>> vcres@gsnFrame = False ; dont advance frame<br>
>> vcres@cnInfoLabelOn = False ; trn off cn info label<br>
>><br>
>> vcres = True ; plot mods desired<br>
>> vcres@gsnAddCyclic = False ; has to do with<br>
>> wrapping<br>
>> the longitude at 0/360<br>
>> vcres@vcRefAnnoOrthogonalPosF = -1.0 ; move ref vector up<br>
>> vcres@vcRefMagnitudeF = 10.0 ; define vector ref mag<br>
>> vcres@vcRefLengthF = 0.045 ; define length of vec<br>
>> ref<br>
>> vcres@vcGlyphStyle = "CurlyVector" ; turn on curly vectors<br>
>> vcres@vcMinDistanceF = 0.017<br>
>><br>
>> ;************************************************<br>
>> ; Choose a subregion<br>
>> ;************************************************<br>
>> vcres@mpFillOn = False ; turn off gray fill<br>
>> vcres@mpOutlineBoundarySets = "National" ; turn on country<br>
>> boundaries<br>
>> vcres@mpGeophysicalLineColor = "Navy" ; color of cont.<br>
>> outlines<br>
>> vcres@mpGeophysicalLineThicknessF = 1.5 ; thickness of outlines<br>
>><br>
>> vcres@mpMaxLatF = 90 ;maximum latitude<br>
>> vcres@mpMinLatF = 45 ;minimum latitude<br>
>> vcres@mpMaxLonF = 357.5 ;maximum longitude<br>
>> vcres@mpMinLonF = 270 ;minimum longitude<br>
>><br>
>> diff_u = uAvgTime_hi - uAvgTime_lo<br>
>> diff_v = vAvgTime_hi - vAvgTime_lo<br>
>><br>
>> printVarSummary(diff_u)<br>
>> printVarSummary(diff_v)<br>
>><br>
>> vcres@gsnLeftString = "DJF High NAO"<br>
>> plot(0) = gsn_csm_vector_map_ce(wks,uAvgTime_hi,vAvgTime_hi,vcres)<br>
>><br>
>> vcres@gsnLeftString = "DJF Low NAO"<br>
>> plot(1) = gsn_csm_vector_map_ce(wks,uAvgTime_lo,vAvgTime_lo,vcres)<br>
>><br>
>><br>
>> vcres@vcRefMagnitudeF = 1.0 ; define vector ref mag<br>
>> vcres@vcRefLengthF = 0.045 ; define length of vec<br>
>> ref<br>
>> vcres@gsnLeftString = "Difference of High - Low"<br>
>> plot(2) = gsn_csm_vector_map_ce(wks, diff_u, diff_v,vcres)<br>
>><br>
>> ;************************************************<br>
>> ; create panel<br>
>> ;************************************************<br>
>> resP = True ; modify the panel plot<br>
>> resP@txString = "NAO"<br>
>> gsn_panel(wks,plot,(/3,1/),resP) ; now draw as one plot<br>
>><br>
>><br>
>><br>
>> end<br>
>><br>
>><br>
>><br>
>> OUTPUT<br>
>> *******************************************************<br>
>> Variable: vAvgTime_hi<br>
>> Type: float<br>
>> Total Size: 2736 bytes<br>
>> 684 values<br>
>> Number of Dimensions: 2<br>
>> Dimensions and sizes: [lat | 19] x [lon | 36]<br>
>> Coordinates:<br>
>> lat: [45..90]<br>
>> lon: [270..357.5]<br>
>> Number Of Attributes: 17<br>
>> NMO : 0<br>
>> _FillValue : -9.96921e+36<br>
>> actual_range : ( -15.43516, 19.79167 )<br>
>> parent_stat : Other<br>
>> statistic : Mean<br>
>> level_desc : Surface<br>
>> dataset : CDC Derived NCEP Reanalysis Products<br>
>> var_desc : v-wind<br>
>> least_significant_digit : 1<br>
>> precision : 2<br>
>> missing_value : -9.96921e+36<br>
>> scale_factor : 1<br>
>> add_offset : 0<br>
>> units : m/s<br>
>> valid_range : ( -102.2, 102.2 )<br>
>> long_name : DJF: Monthly Mean Meridional Wind at sigma level 0.995<br>
>> average_op_ncl : dim_avg_n over dimension(s): time<br>
>><br>
>> Variable: vAvgTime_lo<br>
>> Type: float<br>
>> Total Size: 2736 bytes<br>
>> 684 values<br>
>> Number of Dimensions: 2<br>
>> Dimensions and sizes: [lat | 19] x [lon | 36]<br>
>> Coordinates:<br>
>> lat: [45..90]<br>
>> lon: [270..357.5]<br>
>> Number Of Attributes: 17<br>
>> NMO : 0<br>
>> _FillValue : -9.96921e+36<br>
>> actual_range : ( -15.43516, 19.79167 )<br>
>> parent_stat : Other<br>
>> statistic : Mean<br>
>> level_desc : Surface<br>
>> dataset : CDC Derived NCEP Reanalysis Products<br>
>> var_desc : v-wind<br>
>> least_significant_digit : 1<br>
>> precision : 2<br>
>> missing_value : -9.96921e+36<br>
>> scale_factor : 1<br>
>> add_offset : 0<br>
>> units : m/s<br>
>> valid_range : ( -102.2, 102.2 )<br>
>> long_name : DJF: Monthly Mean Meridional Wind at sigma level 0.995<br>
>> average_op_ncl : dim_avg_n over dimension(s): time<br>
>><br>
>><br>
>> Variable: diff_u<br>
>> Type: float<br>
>> Total Size: 2736 bytes<br>
>> 684 values<br>
>> Number of Dimensions: 2<br>
>> Dimensions and sizes: [19] x [36]<br>
>> Coordinates:<br>
>> Number Of Attributes: 1<br>
>> _FillValue : -9.96921e+36<br>
>><br>
>> Variable: diff_v<br>
>> Type: float<br>
>> Total Size: 2736 bytes<br>
>> 684 values<br>
>> Number of Dimensions: 2<br>
>> Dimensions and sizes: [19] x [36]<br>
>> Coordinates:<br>
>> Number Of Attributes: 1<br>
>> _FillValue : -9.96921e+36<br>
>><br>
>><br>
>><br>
>><br>
>><br>
>> _______________________________________________<br>
>> ncl-talk mailing list<br>
>> <a href="mailto:ncl-talk@ucar.edu">ncl-talk@ucar.edu</a><br>
>> List instructions, subscriber options, unsubscribe:<br>
>> <a href="http://mailman.ucar.edu/mailman/listinfo/ncl-talk" target="_blank">http://mailman.ucar.edu/mailman/listinfo/ncl-talk</a><br>
>><br>
>><br>
><br>
<br>
<br>
</div></div></blockquote></div><br></div>