<div dir="ltr">All,<br><br><pre>The below script works fine but I can not change the x-axix range/y-axis range (values). <br>it is 0. to 0.5 now but I want to make it going from 0 to 0.001 for instance. Is it possible to modify it? <br></pre><pre>Thank you in advance for your help on this.<br><br></pre><pre>Dipti <br></pre><pre>;Here is the script<br><br>;spec_4.ncl
;
; Concepts illustrated:
; - Calculating and plotting spectra
; - Calculating confidence intervals
; - Making an axis logarithmic in an XY plot
;*****************************<wbr>*******************
load "$NCARG_ROOT/lib/ncarg/<wbr>nclscripts/csm/gsn_code.ncl"
load "$NCARG_ROOT/lib/ncarg/<wbr>nclscripts/csm/gsn_csm.ncl"
load "$NCARG_ROOT/lib/ncarg/<wbr>nclscripts/csm/contributed.<wbr>ncl"
load "$NCARG_ROOT/lib/ncarg/<wbr>nclscripts/csm/shea_util.ncl"
;*****************************<wbr>*******************
begin
;*****************************<wbr>*******************
; variable and file handling
;*****************************<wbr>*******************
fn = "SOI_Darwin.nc" ; define filename
in = addfile(fn,"r") ; open netcdf file
soi = in->DSOI ; get data
;*****************************<wbr>*******************
; set function arguments
;*****************************<wbr>*******************
d = 0 ; detrending opt: 0=>remove mean 1=>remove mean + detrend
sm = 21 ; smooth: should be at least 3 and odd
pct = 0.10 ; percent taper: (0.0 <= pct <= 1.0) 0.10 common.
;*****************************<wbr>*******************
; calculate spectrum
;*****************************<wbr>*******************
sdof = specx_anal(soi,d,sm,pct)
;*****************************<wbr>*******************
; calculate confidence interval [here 5 and 95%]
; return 4 curves to be plotted
;*****************************<wbr>*******************
splt = specx_ci (sdof, 0.05, 0.95)
;*****************************<wbr>*******************
; plotting
;*****************************<wbr>*******************
wks = gsn_open_wks("ps","spec") ; Opens a ps file
r = True ; plot mods desired
r@tiMainString = "SOI" ; title
r@tiXAxisString = "Frequency (cycles/month)" ; xaxis
r@tiYAxisString = "Variance" ; yaxis
;*****************************<wbr>******************
; Generate log plot showing "red noise" confidence bounds
; (a) log scaling and (b) the Band Width
;*****************************<wbr>******************
r@trYLog = True ; log scaling
r@trYMinF = 0.10 ; manually set lower limit
r@trYMaxF = 30.0 ; " upper
r@gsnFrame = False ; do not advance frame
plot = gsn_csm_xy(wks,sdof@frq, splt,r)
xf = (/0.40, 0.40+sdof@bw/) ; Create band width line
ys = 0.75*max(sdof@spcx) ; 75% up Y axis
yv = (/ys,ys/)
rpl = True ; resources for polyline
rpl@gsLineThicknessF = 2 ; Define line thickness
gsn_polyline(wks,plot,xf,yv,<wbr>rpl) ; Draw BandWidth
txres= True ; label BW line
txres@txFontHeightF = 0.015 ; font height
txres@txJust = "CenterLeft" ; Set lable location
gsn_text(wks,plot,"BW",0.41+<wbr>sdof@bw,ys,txres); Label
frame (wks)
end
</pre><div class="gmail_extra"><br><div class="gmail_quote">On Sat, May 13, 2017 at 2:00 PM, <span dir="ltr"><<a href="mailto:ncl-talk-request@ucar.edu" target="_blank">ncl-talk-request@ucar.edu</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Send ncl-talk mailing list submissions to<br>
<a href="mailto:ncl-talk@ucar.edu">ncl-talk@ucar.edu</a><br>
<br>
To subscribe or unsubscribe via the World Wide Web, visit<br>
<a href="http://mailman.ucar.edu/mailman/listinfo/ncl-talk" rel="noreferrer" target="_blank">http://mailman.ucar.edu/<wbr>mailman/listinfo/ncl-talk</a><br>
or, via email, send a message with subject or body 'help' to<br>
<a href="mailto:ncl-talk-request@ucar.edu">ncl-talk-request@ucar.edu</a><br>
<br>
You can reach the person managing the list at<br>
<a href="mailto:ncl-talk-owner@ucar.edu">ncl-talk-owner@ucar.edu</a><br>
<br>
When replying, please edit your Subject line so it is more specific<br>
than "Re: Contents of ncl-talk digest..."<br>
<br>
<br>
Today's Topics:<br>
<br>
1. Re: Overlay profile of topography (Appo derbetini)<br>
<br>
<br>
------------------------------<wbr>------------------------------<wbr>----------<br>
<br>
Message: 1<br>
Date: Fri, 12 May 2017 19:17:56 +0100<br>
From: Appo derbetini <<a href="mailto:appopson4@gmail.com">appopson4@gmail.com</a>><br>
Subject: Re: [ncl-talk] Overlay profile of topography<br>
To: Mary Haley <<a href="mailto:haley@ucar.edu">haley@ucar.edu</a>><br>
Cc: NCL <<a href="mailto:ncl-talk@ucar.edu">ncl-talk@ucar.edu</a>><br>
Message-ID:<br>
<<a href="mailto:CAHVpkHj4MrBrGt1Yrcq1RGkVaF1Fy-fG5e2x6zcg9LOvT77S9Q@mail.gmail.com">CAHVpkHj4MrBrGt1Yrcq1RGkVaF1F<wbr>y-fG5e2x6zcg9LOvT77S9Q@mail.<wbr>gmail.com</a>><br>
Content-Type: text/plain; charset="utf-8"<br>
<br>
Thank you Mary<br>
<br>
<br>
<br>
2017-05-12 16:07 GMT+01:00 Mary Haley <<a href="mailto:haley@ucar.edu">haley@ucar.edu</a>>:<br>
<br>
> Hi Appo,<br>
><br>
> The first thing I tell people when they are trying to overlay plots and<br>
> not seeing both plots is to draw them individually before you call<br>
> overlay. This way you can make sure the individual plots look okay before<br>
> you get to the overlay call.<br>
><br>
> All this involves in your case is commenting out the gsnDraw and gsnFrame<br>
> settings.<br>
><br>
> When you do this, you'll see that the Y axis on the wind profile ranges<br>
> from 20000 to 100000, while on the humidity plot it ranges from 200 to 1000.<br>
><br>
> It's not well-advertised, but under the hood, gsn_csm_pres_hgt converts<br>
> the pressure axis to mb before plotting. (I've fixed the documentation to<br>
> make this more clear.)<br>
><br>
> gsn_csm_vector doesn't do this, so you will need to scale the pressure<br>
> values yourself before plotting.<br>
><br>
> I suggest scaling all the arrays, just to be consistent, even for r00:<br>
><br>
> ;---Convert levels from Pa to hPa for consistent plotting<br>
><br>
> r00&plev = r00&plev * 0.01<br>
> udiv00&plev = udiv00&plev * 0.01<br>
> omega00&plev = omega00&plev * 0.01<br>
> r00&plev@units = "mb"<br>
> udiv00&plev@units = "mb"<br>
> omega00&plev@units = "mb"<br>
><br>
> --Mary<br>
><br>
><br>
> On Wed, May 10, 2017 at 3:02 AM, Appo derbetini <<a href="mailto:appopson4@gmail.com">appopson4@gmail.com</a>><br>
> wrote:<br>
><br>
>> Dear Mary,<br>
>><br>
>> I am very surprise.<br>
>> I try the script with another dataset.<br>
>> As you can see in the attached plot, only humidity is displayed.<br>
>> Vertical profile of wind is not appearing.<br>
>><br>
>> What i going wrong?<br>
>><br>
>> Best regards,<br>
>><br>
>> Appo<br>
>><br>
>><br>
>><br>
>><br>
>><br>
>> 2017-05-08 20:22 GMT+01:00 Appo derbetini <<a href="mailto:appopson4@gmail.com">appopson4@gmail.com</a>>:<br>
>><br>
>>> Thank you very much Mary,<br>
>>> Now, I have a perfect plot.<br>
>>> Cheers,<br>
>>> Appo<br>
>>><br>
>>> 2017-05-07 16:08 GMT+01:00 Mary Haley <<a href="mailto:haley@ucar.edu">haley@ucar.edu</a>>:<br>
>>><br>
>>>> Hi,<br>
>>>><br>
>>>> If by "optimized for this plot" you mean is the plotting being done<br>
>>>> correctly, then I would say "yes".<br>
>>>><br>
>>>> However, I did notice that you have two slightly different scales on<br>
>>>> your color bar. The top one goes from 30 to 90 in steps of 5, while the<br>
>>>> bottom one goes from 20 to 90 in steps of 5.<br>
>>>><br>
>>>> If somebody is not paying attention when looking at these images, they<br>
>>>> may not realize that the bottom purple color represents values < 30 in the<br>
>>>> top plot, while it represents values < 20 in the bottom plot.<br>
>>>><br>
>>>> I recommend using the same color scale for both plots, and then using a<br>
>>>> single panel labelbar so that it's more clear what the colors mean.<br>
>>>><br>
>>>> To make sure you use the same contour levels for both plots, set these<br>
>>>> resources:<br>
>>>><br>
>>>> res@cnLevelSelectionMode = "ManualLevels" ; manually set contour levels<br>
>>>> res@cnMinLevelValF = 20. ; minimum contour level<br>
>>>> res@cnMaxLevelValF = 90. ; maximum contour level<br>
>>>> res@cnLevelSpacingF = 5.<br>
>>>><br>
>>>> You then you need to turn off the individual labelbars for both plots, so you can set a common labelbar in the panel:<br>
>>>><br>
>>>> res@lbLabelBarOn = False<br>
>>>><br>
>>>> Now, in the panel resources, set:<br>
>>>><br>
>>>> pres@gsnPanelLabelBar = True<br>
>>>> pres2@lbOrientation = "vertical" ; set this if you want a vertical label bar<br>
>>>><br>
>>>> If you need more customization of your panel plot, then we have some examples on our panel page:<br>
>>>><br>
>>>> <a href="http://www.ncl.ucar.edu/Applications/panel.shtml" rel="noreferrer" target="_blank">http://www.ncl.ucar.edu/<wbr>Applications/panel.shtml</a><br>
>>>><br>
>>>> --Mary<br>
>>>><br>
>>>><br>
>>>><br>
>>>><br>
>>>> On Fri, May 5, 2017 at 4:07 AM, Appo derbetini <<a href="mailto:appopson4@gmail.com">appopson4@gmail.com</a>><br>
>>>> wrote:<br>
>>>><br>
>>>>> Dear Mary,<br>
>>>>> I applied your suggestions.<br>
>>>>> Now, things are going like a charm.<br>
>>>>> Here attached figure obtained and script.<br>
>>>>> I guess that this script is optimized for this plot?<br>
>>>>><br>
>>>>> Thank you very much<br>
>>>>><br>
>>>>> begin<br>
>>>>><br>
>>>>> in1 = addfile("<a href="http://uvwr.mean.JJAS.nc" rel="noreferrer" target="_blank">uvwr.mean.JJAS.nc</a>", "r")<br>
>>>>> ; open netcdf file<br>
>>>>> input4 = addfile("<a href="http://topo.nc" rel="noreferrer" target="_blank">topo.nc</a>", "r")<br>
>>>>><br>
>>>>> u00 = in1->u<br>
>>>>> v00 = in1->v<br>
>>>>> w00 = in1->w<br>
>>>>> rhum00 = in1->r<br>
>>>>><br>
>>>>> topo1 = input4->HT<br>
>>>>><br>
>>>>><br>
>>>>> lat = in1->latitude<br>
>>>>> lon = in1->longitude<br>
>>>>><br>
>>>>><br>
>>>>> dv00 = uv2dvF (u00, v00)<br>
>>>>> uvd00 = dv2uvF (dv00)<br>
>>>>> ucomp_div00 = uvd00(0, :, : , :, :)<br>
>>>>> copy_VarCoords(u00, ucomp_div00)<br>
>>>>><br>
>>>>><br>
>>>>> sellat = 3.0<br>
>>>>> latmin = -5.0<br>
>>>>> latmax = 3.0<br>
>>>>> lonmin = min(lon)<br>
>>>>> lonmax = 20.0<br>
>>>>><br>
>>>>> sellat2 = -1.0<br>
>>>>> latmin2 = -4.0<br>
>>>>> latmax2 = -1.0<br>
>>>>> lonmin = min(lon)<br>
>>>>> lonmax = 20.0<br>
>>>>><br>
>>>>> udiv00 = dim_avg_n_Wrap(ucomp_div00(:, :, {latmin:latmax},<br>
>>>>> {lonmin:lonmax}), 2)<br>
>>>>> omega00 = dim_avg_n_Wrap(w00(:, :, {latmin:latmax},<br>
>>>>> {lonmin:lonmax}), 2)<br>
>>>>> r00 = dim_avg_n_Wrap(rhum00(:, :, {latmin:latmax},{lonmin:<wbr>lonmax}),<br>
>>>>> 2)<br>
>>>>><br>
>>>>> udiv002 = dim_avg_n_Wrap(ucomp_div00(:, :, {latmin2:latmax2},<br>
>>>>> {lonmin:lonmax}), 2)<br>
>>>>> omega002 = dim_avg_n_Wrap(w00(:, :, {latmin2:latmax2},<br>
>>>>> {lonmin:lonmax}), 2)<br>
>>>>> r002 = dim_avg_n_Wrap(rhum00(:, :, {latmin2:latmax2},{lonmin:<wbr>lonmax}),<br>
>>>>> 2)<br>
>>>>><br>
>>>>><br>
>>>>><br>
>>>>> elev = 1013.25*(1 - topo1*0.0065/288.15)^5.25145<br>
>>>>><br>
>>>>> copy_VarCoords(topo1, elev)<br>
>>>>><br>
>>>>> ; topo = dim_avg_n_Wrap(elev({latmin:<wbr>latmax},{lonmin:lonmax}), 0)<br>
>>>>><br>
>>>>> topo = elev({sellat}, {lonmin:lonmax})<br>
>>>>> topo2 = elev({sellat2}, {lonmin:lonmax})<br>
>>>>><br>
>>>>> ;---create plot<br>
>>>>> wks = gsn_open_wks ("eps", "Overlay_Rhum_udiv_JJAS_<wbr>Timmean_5S3N")<br>
>>>>> ; open workstation<br>
>>>>> plot = new(2, graphic)<br>
>>>>> res = True ; plot mods desired<br>
>>>>> res@gsnDraw = False ; turn off draw<br>
>>>>> res@gsnFrame = False ; turn off frame<br>
>>>>> res@gsnMaximize = True<br>
>>>>><br>
>>>>> res@gsnRightString = ""<br>
>>>>> res@gsnLeftString = ""<br>
>>>>><br>
>>>>> cnres = res<br>
>>>>> cnres@cnFillOn = True ; turn on color fill<br>
>>>>> cnres@cnFillPalette = "MPL_rainbow"<br>
>>>>> cnres@lbOrientation = "Vertical"<br>
>>>>> cnres@pmLabelBarOrthogonalPosF = 0.08<br>
>>>>> cnres@tiYAxisString = "Pressure (hPa)"<br>
>>>>><br>
>>>>> vcres = res<br>
>>>>> vcres@vcRefMagnitudeF = 10.0 ; define vector ref mag<br>
>>>>> vcres@vcRefLengthF = 0.1 ; define length of vec ref<br>
>>>>> vcres@vcGlyphStyle = "CurlyVector" ; turn on curley vectors<br>
>>>>> vcres@vcMinDistanceF = 0.04 ; thin out vectors<br>
>>>>> vcres@vcMapDirection = False<br>
>>>>> vcres@vcLineArrowThicknessF = 3.0<br>
>>>>> vcres@vcVectorDrawOrder = "Draw" ; draw vectors last<br>
>>>>><br>
>>>>><br>
>>>>><br>
>>>>> contour_plota1 = gsn_csm_pres_hgt(wks, r00(0, :,<br>
>>>>> {lonmin:lonmax}), cnres)<br>
>>>>> vector_plota1 = gsn_csm_vector(wks, udiv00(0, :,<br>
>>>>> {lonmin:lonmax}), -200.0*omega00(0, :, {lonmin:lonmax}), vcres )<br>
>>>>><br>
>>>>> contour_plota2 = gsn_csm_pres_hgt(wks, r002(0, :,<br>
>>>>> {lonmin:lonmax}), cnres)<br>
>>>>> vector_plota2 = gsn_csm_vector(wks, udiv002(0, :,<br>
>>>>> {lonmin:lonmax}), -200.0*omega002(0, :, {lonmin:lonmax}), vcres )<br>
>>>>><br>
>>>>><br>
>>>>> ;---Add topo field using a filled polygon.<br>
>>>>> getvalues contour_plota1<br>
>>>>> "trYMinF" : ymin<br>
>>>>> "trYMaxF" : ymax<br>
>>>>> end getvalues<br>
>>>>><br>
>>>>> ;---Create new X,Y arrays that form a closed polygon.<br>
>>>>> nlon = dimsizes(topo&lon)<br>
>>>>> xtopo = new(nlon+3,typeof(topo&lon))<br>
>>>>> ytopo = new(nlon+3,typeof(topo))<br>
>>>>><br>
>>>>> xtopo(0:nlon-1) = topo&lon<br>
>>>>> ytopo(0:nlon-1) = topo<br>
>>>>> xtopo(nlon) = topo&lon(nlon-1)<br>
>>>>> ytopo(nlon) = ymax ; Use actual Y max of contour plot<br>
>>>>> xtopo(nlon+1) = topo&lon(0)<br>
>>>>> ytopo(nlon+1) = ymax<br>
>>>>> xtopo(nlon+2) = topo&lon(0) ; This last point closes<br>
>>>>> ytopo(nlon+2) = topo(0) ; the polygon.<br>
>>>>><br>
>>>>><br>
>>>>><br>
>>>>><br>
>>>>> ;---Add topo field using a filled polygon.<br>
>>>>> getvalues contour_plota2<br>
>>>>> "trYMinF" : ymin2<br>
>>>>> "trYMaxF" : ymax2<br>
>>>>> end getvalues<br>
>>>>><br>
>>>>> ;---Create new X,Y arrays that form a closed polygon.<br>
>>>>> nlon = dimsizes(topo2&lon)<br>
>>>>> xtopo2 = new(nlon+3,typeof(topo2&lon))<br>
>>>>> ytopo2 = new(nlon+3,typeof(topo2))<br>
>>>>><br>
>>>>> xtopo2(0:nlon-1) = topo2&lon<br>
>>>>> ytopo2(0:nlon-1) = topo2<br>
>>>>> xtopo2(nlon) = topo2&lon(nlon-1)<br>
>>>>> ytopo2(nlon) = ymax2 ; Use actual Y max of contour plot<br>
>>>>> xtopo2(nlon+1) = topo2&lon(0)<br>
>>>>> ytopo2(nlon+1) = ymax2<br>
>>>>> xtopo2(nlon+2) = topo2&lon(0) ; This last point closes<br>
>>>>> ytopo2(nlon+2) = topo2(0) ; the polygon.<br>
>>>>><br>
>>>>> ;---Add the polygon to the contour plot.<br>
>>>>> gnres = True<br>
>>>>> gnres@gsFillColor = "gray20"<br>
>>>>><br>
>>>>> id = gsn_add_polygon(wks, contour_plota1, xtopo, ytopo, gnres)<br>
>>>>> i2 = gsn_add_polygon(wks, contour_plota2, xtopo2, ytopo2, gnres)<br>
>>>>><br>
>>>>> overlay(contour_plota1, vector_plota1)<br>
>>>>> overlay(contour_plota2, vector_plota2)<br>
>>>>><br>
>>>>> plot(0) = contour_plota1<br>
>>>>> plot(1) = contour_plota2<br>
>>>>><br>
>>>>> ;draw(contour_plot) ; This draws everything<br>
>>>>><br>
>>>>><br>
>>>>><br>
>>>>><br>
>>>>> pres = True<br>
>>>>> pres@gsnMaximize = True<br>
>>>>> gsn_panel(wks, plot, (/2, 1/), pres)<br>
>>>>><br>
>>>>><br>
>>>>><br>
>>>>> end<br>
>>>>><br>
>>>>><br>
>>>>><br>
>>>>> 2017-05-05 0:39 GMT+01:00 Mary Haley <<a href="mailto:haley@ucar.edu">haley@ucar.edu</a>>:<br>
>>>>><br>
>>>>>> I'm so sorry I didn't get back to you sooner on this. I've been<br>
>>>>>> swamped and then was out-of-town for a few days.<br>
>>>>>><br>
>>>>>> It's a little hard to follow what's going on in this script without<br>
>>>>>> being able to run it.<br>
>>>>>><br>
>>>>>> I think the issue is that you are using the "res" variable in your<br>
>>>>>> call to gsn_panel, and "res" has both gsnDraw and gsnFrame set to False.<br>
>>>>>> This will cause *no* plot to appear when you call gsn_panel. I'm surprised<br>
>>>>>> you are getting any plot at all.<br>
>>>>>><br>
>>>>>> I recommend creating a new resource variable for gsn_panel, because<br>
>>>>>> you really don't want to use the one that you used for the plots themselves:<br>
>>>>>><br>
>>>>>> pres = True<br>
>>>>>> pres@gsnMaximize = True<br>
>>>>>> gsn_panel(wks, plot, (/2, 1/), pres)<br>
>>>>>><br>
>>>>>> If you<br>
>>>>>> ? continue to have problems, then it would help if you send me the<br>
>>>>>> two data files. If you can't send the files, then send me the image you're<br>
>>>>>> getting, and any error messages ?that the script produces.<br>
>>>>>><br>
>>>>>> ?Thanks,<br>
>>>>>><br>
>>>>>> --Mary<br>
>>>>>> ?<br>
>>>>>><br>
>>>>>><br>
>>>>>><br>
>>>>>> On Tue, Apr 25, 2017 at 12:56 AM, Appo derbetini <<a href="mailto:appopson4@gmail.com">appopson4@gmail.com</a><br>
>>>>>> > wrote:<br>
>>>>>><br>
>>>>>>> Good morning Mary,<br>
>>>>>>> Sorry , i forgot to add ncl-users email to the reply.<br>
>>>>>>><br>
>>>>>>> I am attaching the modified version of the script were I'm trying to<br>
>>>>>>> create a panel plot for two transects at latitude sellat and sellat2.<br>
>>>>>>> Unfortunately, only one plot appears.<br>
>>>>>>> Really, I don't know what is wrong this script.<br>
>>>>>>><br>
>>>>>>> Your help will be appreciated.<br>
>>>>>>><br>
>>>>>>><br>
>>>>>>><br>
>>>>>>> begin<br>
>>>>>>><br>
>>>>>>> in1 = addfile("<a href="http://uvwr.mean.JJAS.nc" rel="noreferrer" target="_blank">uvwr.mean.JJAS.nc</a>",<br>
>>>>>>> "r") ; open netcdf file<br>
>>>>>>> input4 = addfile("<a href="http://atanas_topo.nc" rel="noreferrer" target="_blank">atanas_topo.nc</a>", "r")<br>
>>>>>>><br>
>>>>>>> u00 = in1->u<br>
>>>>>>> v00 = in1->v<br>
>>>>>>> w00 = in1->w<br>
>>>>>>> rhum00 = in1->r<br>
>>>>>>><br>
>>>>>>> topo1 = input4->HT<br>
>>>>>>><br>
>>>>>>><br>
>>>>>>> lat = in1->latitude<br>
>>>>>>> lon = in1->longitude<br>
>>>>>>><br>
>>>>>>><br>
>>>>>>> dv00 = uv2dvF (u00, v00)<br>
>>>>>>> uvd00 = dv2uvF (dv00)<br>
>>>>>>> ucomp_div00 = uvd00(0, :, : , :, :)<br>
>>>>>>> copy_VarCoords(u00, ucomp_div00)<br>
>>>>>>><br>
>>>>>>><br>
>>>>>>> sellat = 3.0<br>
>>>>>>> sellat2 = -2.5<br>
>>>>>>> latmin = -5.0<br>
>>>>>>> latmax = 3.0<br>
>>>>>>> lonmin = min(lon)<br>
>>>>>>> lonmax = 20.0<br>
>>>>>>><br>
>>>>>>> udiv00 = dim_avg_n_Wrap(ucomp_div00(:, :, {latmin:latmax},<br>
>>>>>>> {lonmin:lonmax}), 2)<br>
>>>>>>> omega00 = dim_avg_n_Wrap(w00(:, :, {latmin:latmax},<br>
>>>>>>> {lonmin:lonmax}), 2)<br>
>>>>>>> r00 = dim_avg_n_Wrap(rhum00(:, :, {latmin:latmax},{lonmin:<wbr>lonmax}),<br>
>>>>>>> 2)<br>
>>>>>>><br>
>>>>>>> ;udiv00 = ucomp_div00(:, :, {sellat}, {lonmin:lonmax})<br>
>>>>>>> ;omega00 = w00(:, :, {sellat}, {lonmin:lonmax})<br>
>>>>>>> ;r00 = rhum00(:, :, {sellat},{lonmin:lonmax})<br>
>>>>>>><br>
>>>>>>><br>
>>>>>>> elev = 1013.25*(1 - topo1*0.0065/288.15)^5.25145<br>
>>>>>>><br>
>>>>>>> copy_VarCoords(topo1, elev)<br>
>>>>>>><br>
>>>>>>> ; topo = dim_avg_n_Wrap(elev({latmin:<wbr>latmax},{lonmin:lonmax}), 0)<br>
>>>>>>><br>
>>>>>>> topo = elev({sellat}, {lonmin:lonmax})<br>
>>>>>>> topo2 = elev({sellat2}, {lonmin:lonmax})<br>
>>>>>>><br>
>>>>>>> ;---create plot<br>
>>>>>>> wks = gsn_open_wks ("eps", "Overlay_Rhum_udiv_topo") ;<br>
>>>>>>> open workstation<br>
>>>>>>> plot = new(2, graphic)<br>
>>>>>>> res = True ; plot mods<br>
>>>>>>> desired<br>
>>>>>>> res@gsnDraw = False ; turn off draw<br>
>>>>>>> res@gsnFrame = False ; turn off frame<br>
>>>>>>> res@gsnMaximize = True<br>
>>>>>>><br>
>>>>>>> res@gsnRightString = ""<br>
>>>>>>> res@gsnLeftString = ""<br>
>>>>>>><br>
>>>>>>> cnres = res<br>
>>>>>>> cnres@cnFillOn = True ; turn on color fill<br>
>>>>>>> cnres@cnFillPalette = "MPL_rainbow"<br>
>>>>>>> cnres@lbOrientation = "Vertical"<br>
>>>>>>> cnres@pmLabelBarOrthogonalPosF = 0.08<br>
>>>>>>> cnres@tiYAxisString = "Pressure (hPa)"<br>
>>>>>>><br>
>>>>>>> vcres = res<br>
>>>>>>> vcres@vcRefMagnitudeF = 10.0 ; define vector ref<br>
>>>>>>> mag<br>
>>>>>>> vcres@vcRefLengthF = 0.1 ; define length of vec<br>
>>>>>>> ref<br>
>>>>>>> vcres@vcGlyphStyle = "CurlyVector" ; turn on curley<br>
>>>>>>> vectors<br>
>>>>>>> vcres@vcMinDistanceF = 0.04 ; thin out vectors<br>
>>>>>>> vcres@vcMapDirection = False<br>
>>>>>>> vcres@vcLineArrowThicknessF = 3.0<br>
>>>>>>> vcres@vcVectorDrawOrder = "Draw" ; draw vectors last<br>
>>>>>>><br>
>>>>>>> contour_plot_1 = gsn_csm_pres_hgt(wks, r00(0, :,<br>
>>>>>>> {lonmin:lonmax}), cnres)<br>
>>>>>>> vector_plot_1 = gsn_csm_vector(wks, udiv00(0, :,<br>
>>>>>>> {lonmin:lonmax}), -200.0*omega00(0, :, {lonmin:lonmax}), vcres )<br>
>>>>>>><br>
>>>>>>> contour_plot_2 = gsn_csm_pres_hgt(wks, r00(0, :,<br>
>>>>>>> {lonmin:lonmax}), cnres)<br>
>>>>>>> vector_plot_2 = gsn_csm_vector(wks, udiv00(0, :,<br>
>>>>>>> {lonmin:lonmax}), -200.0*omega00(0, :, {lonmin:lonmax}), vcres )<br>
>>>>>>><br>
>>>>>>><br>
>>>>>>> ;---Add topo field using a filled polygon.<br>
>>>>>>> getvalues contour_plot_1<br>
>>>>>>> "trYMinF" : ymin<br>
>>>>>>> "trYMaxF" : ymax<br>
>>>>>>> end getvalues<br>
>>>>>>><br>
>>>>>>><br>
>>>>>>> ;---Add topo field using a filled polygon.<br>
>>>>>>> getvalues contour_plot_2<br>
>>>>>>> "trYMinF" : ymin2<br>
>>>>>>> "trYMaxF" : ymax2<br>
>>>>>>> end getvalues<br>
>>>>>>><br>
>>>>>>><br>
>>>>>>><br>
>>>>>>> ;---Create new X,Y arrays that form a closed polygon.<br>
>>>>>>> nlon = dimsizes(topo&lon)<br>
>>>>>>> xtopo = new(nlon+3,typeof(topo&lon))<br>
>>>>>>> ytopo = new(nlon+3,typeof(topo))<br>
>>>>>>><br>
>>>>>>> xtopo(0:nlon-1) = topo&lon<br>
>>>>>>> ytopo(0:nlon-1) = topo<br>
>>>>>>> xtopo(nlon) = topo&lon(nlon-1)<br>
>>>>>>> ytopo(nlon) = ymax ; Use actual Y max of contour plot<br>
>>>>>>> xtopo(nlon+1) = topo&lon(0)<br>
>>>>>>> ytopo(nlon+1) = ymax<br>
>>>>>>> xtopo(nlon+2) = topo&lon(0) ; This last point closes<br>
>>>>>>> ytopo(nlon+2) = topo(0) ; the polygon.<br>
>>>>>>><br>
>>>>>>><br>
>>>>>>> nlon2 = dimsizes(topo2&lon)<br>
>>>>>>> xtopo2 = new(nlon2+3,typeof(topo2&lon))<br>
>>>>>>> ytopo2 = new(nlon2+3,typeof(topo2))<br>
>>>>>>><br>
>>>>>>> xtopo2(0:nlon-1) = topo2&lon<br>
>>>>>>> ytopo2(0:nlon-1) = topo2<br>
>>>>>>> xtopo2(nlon) = topo2&lon(nlon-1)<br>
>>>>>>> ytopo2(nlon) = ymax2 ; Use actual Y max of contour<br>
>>>>>>> plot<br>
>>>>>>> xtopo2(nlon+1) = topo2&lon(0)<br>
>>>>>>> ytopo2(nlon+1) = ymax2<br>
>>>>>>> xtopo2(nlon+2) = topo2&lon(0) ; This last point closes<br>
>>>>>>> ytopo2(nlon+2) = topo2(0) ; the polygon.<br>
>>>>>>><br>
>>>>>>><br>
>>>>>>> ;---Add the polygon to the contour plot.<br>
>>>>>>> gnres = True<br>
>>>>>>> gnres@gsFillColor = "gray20"<br>
>>>>>>><br>
>>>>>>> id = gsn_add_polygon(wks, contour_plot_1, xtopo, ytopo, gnres)<br>
>>>>>>> id2 = gsn_add_polygon(wks, contour_plot_2, xtopo2, ytopo2, gnres)<br>
>>>>>>> overlay(contour_plot_1, vector_plot_1)<br>
>>>>>>> overlay(contour_plot_2, vector_plot_2)<br>
>>>>>>><br>
>>>>>>><br>
>>>>>>> draw(contour_plot_1) ; This draws everything<br>
>>>>>>> draw(contour_plot_2) ; This draws everything<br>
>>>>>>><br>
>>>>>>> plot(0) = contour_plot_1<br>
>>>>>>><br>
>>>>>>> plot(1) = contour_plot_2<br>
>>>>>>><br>
>>>>>>> gsn_panel(wks,plot, (/2, 1/), res) ; now draw as<br>
>>>>>>> one plot<br>
>>>>>>><br>
>>>>>>><br>
>>>>>>> end<br>
>>>>>>><br>
>>>>>>><br>
>>>>>>> 2017-04-24 21:58 GMT+01:00 Mary Haley <<a href="mailto:haley@ucar.edu">haley@ucar.edu</a>>:<br>
>>>>>>><br>
>>>>>>>> Hi,<br>
>>>>>>>><br>
>>>>>>>> In the future, please email ncl-talk with follow-up questions so<br>
>>>>>>>> everybody can benefit from the answers.<br>
>>>>>>>><br>
>>>>>>>> What is the exact error message you're getting?<br>
>>>>>>>><br>
>>>>>>>> --Mary<br>
>>>>>>>><br>
>>>>>>>><br>
>>>>>>>> On Mon, Apr 24, 2017 at 4:08 AM, Appo derbetini <<br>
>>>>>>>> <a href="mailto:appopson4@gmail.com">appopson4@gmail.com</a>> wrote:<br>
>>>>>>>><br>
>>>>>>>>> Hi Mary,<br>
>>>>>>>>><br>
>>>>>>>>> Since you send me the script that plot masked fields, I am working<br>
>>>>>>>>> to do it for many latitude in a panel plot.<br>
>>>>>>>>> Always i got many errors saying that i cannot overlay.<br>
>>>>>>>>> How to solve it?<br>
>>>>>>>>> Thank you in advance.<br>
>>>>>>>>><br>
>>>>>>>>> Appo<br>
>>>>>>>>><br>
>>>>>>>>> 2017-04-10 8:23 GMT+01:00 Appo derbetini <<a href="mailto:appopson4@gmail.com">appopson4@gmail.com</a>>:<br>
>>>>>>>>><br>
>>>>>>>>>> Thank you very much.<br>
>>>>>>>>>> It's look like what I'm trying to do.<br>
>>>>>>>>>> regards<br>
>>>>>>>>>><br>
>>>>>>>>>> 2017-04-09 22:11 GMT+01:00 Mary Haley <<a href="mailto:haley@ucar.edu">haley@ucar.edu</a>>:<br>
>>>>>>>>>><br>
>>>>>>>>>>> I'm sorry I didn't get back to this sooner, but I was having<br>
>>>>>>>>>>> trouble trying to understand what you are doing in the script.<br>
>>>>>>>>>>><br>
>>>>>>>>>>> First, I'm not sure it makes sense to take an average of<br>
>>>>>>>>>>> topographical data across a set of latitudes and plot that as a topo layer.<br>
>>>>>>>>>>><br>
>>>>>>>>>>> But, that aside, I think you just want to plot the topo line as<br>
>>>>>>>>>>> a filled polygon instead of a separate XY plot.<br>
>>>>>>>>>>><br>
>>>>>>>>>>> I'm not sure what I've attached is correct, but hopefully it<br>
>>>>>>>>>>> gives you an idea of what to do.<br>
>>>>>>>>>>><br>
>>>>>>>>>>> Note that I'm using "sellat" to select a single latitude value,<br>
>>>>>>>>>>> rather than averaging across a range of latitudes.<br>
>>>>>>>>>>><br>
>>>>>>>>>>> --Mary<br>
>>>>>>>>>>><br>
>>>>>>>>>>><br>
>>>>>>>>>>> On Sun, Apr 9, 2017 at 2:10 AM, Appo derbetini <<br>
>>>>>>>>>>> <a href="mailto:appopson4@gmail.com">appopson4@gmail.com</a>> wrote:<br>
>>>>>>>>>>><br>
>>>>>>>>>>>> Dear Mary,<br>
>>>>>>>>>>>><br>
>>>>>>>>>>>> Despite applying what you suggest the problem remain the same<br>
>>>>>>>>>>>> Thank you very much<br>
>>>>>>>>>>>><br>
>>>>>>>>>>>> 2017-04-06 8:53 GMT+01:00 Appo derbetini <<a href="mailto:appopson4@gmail.com">appopson4@gmail.com</a>>:<br>
>>>>>>>>>>>><br>
>>>>>>>>>>>>> Dear Mary,<br>
>>>>>>>>>>>>><br>
>>>>>>>>>>>>> Datasets are uploaded as indicated.<br>
>>>>>>>>>>>>><br>
>>>>>>>>>>>>> What I really trying to do is something like Mask Example 14.<br>
>>>>>>>>>>>>><br>
>>>>>>>>>>>>> But I don't want to interpolate topography to grid of wind.<br>
>>>>>>>>>>>>><br>
>>>>>>>>>>>>> Here attached figure produced by the script<br>
>>>>>>>>>>>>><br>
>>>>>>>>>>>>> Thank you<br>
>>>>>>>>>>>>><br>
>>>>>>>>>>>>><br>
>>>>>>>>>>>>> 2017-04-05 15:36 GMT+01:00 Mary Haley <<a href="mailto:haley@ucar.edu">haley@ucar.edu</a>>:<br>
>>>>>>>>>>>>><br>
>>>>>>>>>>>>>> I don't think I've ever seen this error before.<br>
>>>>>>>>>>>>>><br>
>>>>>>>>>>>>>> It's hard to debug this particular script without having the<br>
>>>>>>>>>>>>>> data so I can run it. But, I'm wondering if this line might be part of the<br>
>>>>>>>>>>>>>> problem:<br>
>>>>>>>>>>>>>><br>
>>>>>>>>>>>>>> plot = gsn_csm_pres_hgt_vector(wks, r00(0, :,<br>
>>>>>>>>>>>>>> {lonmin:lonmax}), udiv00(0, :, {lonmin:lonmax}), -200.0*omega00(0, :,<br>
>>>>>>>>>>>>>> {lonmin:lonmax}), res )<br>
>>>>>>>>>>>>>><br>
>>>>>>>>>>>>>> When you do an arithmetic operation on an array, like:<br>
>>>>>>>>>>>>>><br>
>>>>>>>>>>>>>> -200. * omega00<br>
>>>>>>>>>>>>>><br>
>>>>>>>>>>>>>> you end up stripping all of the metadata off omega00. What's<br>
>>>>>>>>>>>>>> getting passed into gsn_csm_pres_hgt has no metadata. This might be okay,<br>
>>>>>>>>>>>>>> however, because I think this routine might just use the metadata from<br>
>>>>>>>>>>>>>> "udiv00" instead.<br>
>>>>>>>>>>>>>><br>
>>>>>>>>>>>>>> Still, it's worth trying this:<br>
>>>>>>>>>>>>>><br>
>>>>>>>>>>>>>> omega00_scale = omega00(0, :, {lonmin:lonmax}) ; subsets<br>
>>>>>>>>>>>>>> omega00 *and* copies all metadata<br>
>>>>>>>>>>>>>> omega00_scale = -200.0 * omega00_scale<br>
>>>>>>>>>>>>>><br>
>>>>>>>>>>>>>> plot = gsn_csm_pres_hgt_vector(wks, r00(0, :,<br>
>>>>>>>>>>>>>> {lonmin:lonmax}), udiv00(0, :, {lonmin:lonmax}), omega00_scale, res )<br>
>>>>>>>>>>>>>><br>
>>>>>>>>>>>>>> If you continue to have problems with this script, could you<br>
>>>>>>>>>>>>>> upload your data (if it's not too large) to our ftp:<br>
>>>>>>>>>>>>>><br>
>>>>>>>>>>>>>> ftp <a href="http://ftp.cgd.ucar.edu" rel="noreferrer" target="_blank">ftp.cgd.ucar.edu</a><br>
>>>>>>>>>>>>>> anonymous<br>
>>>>>>>>>>>>>> <use your email address for the password><br>
>>>>>>>>>>>>>> cd incoming<br>
>>>>>>>>>>>>>> put <a href="http://uvwr.mean.JJAS.nc" rel="noreferrer" target="_blank">uvwr.mean.JJAS.nc</a><br>
>>>>>>>>>>>>>> put <a href="http://atanas_topo.nc" rel="noreferrer" target="_blank">atanas_topo.nc</a><br>
>>>>>>>>>>>>>> quit<br>
>>>>>>>>>>>>>><br>
>>>>>>>>>>>>>> Thanks,<br>
>>>>>>>>>>>>>><br>
>>>>>>>>>>>>>> --Mary<br>
>>>>>>>>>>>>>><br>
>>>>>>>>>>>>>><br>
>>>>>>>>>>>>>> On Tue, Apr 4, 2017 at 9:18 AM, Appo derbetini <<br>
>>>>>>>>>>>>>> <a href="mailto:appopson4@gmail.com">appopson4@gmail.com</a>> wrote:<br>
>>>>>>>>>>>>>><br>
>>>>>>>>>>>>>>> Dear all,<br>
>>>>>>>>>>>>>>> I am trying to overlay topography profil on a profil of wind<br>
>>>>>>>>>>>>>>> and relative humidity.<br>
>>>>>>>>>>>>>>> I don't want to interpolate topography to show some details.<br>
>>>>>>>>>>>>>>><br>
>>>>>>>>>>>>>>> Atached are script and datasets used for the plot.<br>
>>>>>>>>>>>>>>><br>
>>>>>>>>>>>>>>> But I having errors.<br>
>>>>>>>>>>>>>>><br>
>>>>>>>>>>>>>>> warning:LlDataPolygon: point 6.150009,0.000000 outside data<br>
>>>>>>>>>>>>>>> domain<br>
>>>>>>>>>>>>>>> warning:LlDataPolygon: point 19.983337,0.000000 outside data<br>
>>>>>>>>>>>>>>> domain<br>
>>>>>>>>>>>>>>> warning:LlDataLineTo: point 6.150009,0.000000 outside data<br>
>>>>>>>>>>>>>>> domain<br>
>>>>>>>>>>>>>>> warning:LlDataLineTo: point 19.983337,0.000000 outside data<br>
>>>>>>>>>>>>>>> domain<br>
>>>>>>>>>>>>>>><br>
>>>>>>>>>>>>>>> Any help will be appreciated.<br>
>>>>>>>>>>>>>>><br>
>>>>>>>>>>>>>>> Best regards.<br>
>>>>>>>>>>>>>>><br>
>>>>>>>>>>>>>>> ______________________________<wbr>_________________<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" rel="noreferrer" target="_blank">http://mailman.ucar.edu/<wbr>mailman/listinfo/ncl-talk</a><br>
>>>>>>>>>>>>>>><br>
>>>>>>>>>>>>>>><br>
>>>>>>>>>>>>>><br>
>>>>>>>>>>>>><br>
>>>>>>>>>>>><br>
>>>>>>>>>>><br>
>>>>>>>>>><br>
>>>>>>>>><br>
>>>>>>>><br>
>>>>>>><br>
>>>>>><br>
>>>>><br>
>>>><br>
>>><br>
>><br>
><br>
-------------- next part --------------<br>
An HTML attachment was scrubbed...<br>
URL: <a href="http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20170512/89245831/attachment-0001.html" rel="noreferrer" target="_blank">http://mailman.ucar.edu/<wbr>pipermail/ncl-talk/<wbr>attachments/20170512/89245831/<wbr>attachment-0001.html</a><br>
<br>
------------------------------<br>
<br>
______________________________<wbr>_________________<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" rel="noreferrer" target="_blank">http://mailman.ucar.edu/<wbr>mailman/listinfo/ncl-talk</a><br>
<br>
<br>
End of ncl-talk Digest, Vol 162, Issue 26<br>
******************************<wbr>***********<br>
</blockquote></div><br></div></div>