<div dir="ltr">Hi Ipsita,<div>So you know: You do not need to lonFlip the data if you are plotting across the original cyclic point. Thus, if your data originally runs from 0-360, and you want to plot the region 20W:20E, there's no need to lonFlip it just to plot it. </div><div><br></div><div>I wonder though if this is the problem: According to your printVarSummary of the original data the cyclic point was already included:</div><div><span style="background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline">Variable: rl</span><br style="background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial"><span style="background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline">Type: float</span><br style="background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial"><span style="background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline">Total Size: 221184000 bytes</span><br style="background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial"><span style="background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"> 55296000 values</span><br style="background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial"><span style="background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline">Number of Dimensions: 4</span><br style="background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial"><span style="background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline">Dimensions and sizes: [ncl_join | 20] x [ncl0 | 6] x [LAT | 320] x [LON | 1440]</span><br style="background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial"><span style="background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline">Coordinates:<span> </span></span><br style="background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial"><span style="background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"> LAT: [-40..40]</span><br style="background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial"><span style="background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"> <b> LON: [ 0..360]</b></span><br></div><div><br></div><div>I would try eliminating the cyclic point (@360 degrees) upon read in. Then proceed with your script. I bet your error message is happening because you have two longitudes at 0 when you lonFlip the array. You can see if this is true by printing out the longitudes: print(rr&LON)</div><div><br></div><div>Hope that helps!</div><div>Adam</div></div><br><div class="gmail_quote"><div dir="ltr">On Fri, Jun 15, 2018 at 7:59 AM Dennis Shea <<a href="mailto:shea@ucar.edu" target="_blank">shea@ucar.edu</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div><div>I have no idea why your script is encountering is not working.<br><b><br></b><span class="m_1657269390287640940m_8776206045668016640gmail-im"><b>Warning:</b>_NhlCreateSplineCoordApprox: Attempt to create spline approximation for X axis failed:</span><br><br></div><div>You have: <b>res@gsnAddCyclic = False <br></b></div><div>which is appropriate for the regional grid.<br><br></div><div>As a wild guess, try commenting out or deleting the following line:<br><br> <b>;; </b>res@mpCenterLonF = -5<br><br></div>[SNIP]<br> printVarSummary(rr) ; [ncl0 | 6] x [LAT | 42] x [LON | 122]<br><b> ; Coordinates:<br> ; LAT: [-19.9373..-9.655172]<br> ; LON: [-19.76373..10.25712</b>]<br> printMinMax(rr,0)<br>;============================================================<br> wks = gsn_open_wks("png","SATL") ; send graphics to PNG file<br> cmap = read_colormap_file("gui_default") ; read color data<br><br> res = True ; plot mods desired<br> res@gsnMaximize = True ; Maximize plot size <br> res@cnLinesOn = False ; No contour lines<br> res@cnFillOn = True ; color plot desired<br> res@cnFillPalette = cmap(:15,:) ; set color map<br> res@cnLineLabelsOn = False<br> <br> <b>res@gsnAddCyclic = False </b> <b> ; regional data ... not global</b><br> res@mpMinLatF = -20 ; zoom in on map<br> res@mpMaxLatF = -10<br> res@mpMinLonF = -20<br> res@mpMaxLonF = 10<br><b>;;</b> res@mpCenterLonF = -5<br> plot = gsn_csm_contour_map(wks,rr(0,:,:),res)<br></div>[SNIP]<br><br><br><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Jun 14, 2018 at 10:02 PM, Ipsita Putatunda <span dir="ltr"><<a href="mailto:ipsita.putatunda@gmail.com" target="_blank">ipsita.putatunda@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div><div><div>Hi Dennis,<br></div>The output of my script (attached herewith) is coming as below:<br>***************************************<br>Variable: rl<br>Type: float<br>Total Size: 221184000 bytes<br> 55296000 values<br>Number of Dimensions: 4<br>Dimensions and sizes: [ncl_join | 20] x [ncl0 | 6] x [LAT | 320] x [LON | 1440]<br>Coordinates: <br> LAT: [-40..40]<br> LON: [ 0..360]<br>Number Of Attributes: 1<br> _FillValue : 9.96921e+36<br><br>Variable: rflip<br>Type: float<br>Total Size: 221184000 bytes<br> 55296000 values<br>Number of Dimensions: 4<br>Dimensions and sizes: [ncl_join | 20] x [ncl0 | 6] x [LAT | 320] x [LON | 1440]<br>Coordinates: <br> LAT: [-40..40]<br> LON: [-179.8749..179.8749]<br>Number Of Attributes: 2<br> _FillValue : 9.96921e+36<br> lonFlip : longitude coordinate variable has been reordered via lonFlip<br><br>Variable: rh<br>Type: float<br>Total Size: 2459520 bytes<br> 614880 values<br>Number of Dimensions: 4<br>Dimensions and sizes: [ncl_join | 20] x [ncl0 | 6] x [LAT | 42] x [LON | 122]<br>Coordinates: <br> LAT: [-19.9373..-9.655172]<br> LON: [-19.76373..10.25712]<br>Number Of Attributes: 2<br> lonFlip : longitude coordinate variable has been reordered via lonFlip<br> _FillValue : 9.96921e+36<br><br>Variable: rr<br>Type: float<br>Total Size: 122976 bytes<br> 30744 values<br>Number of Dimensions: 3<br>Dimensions and sizes: [ncl0 | 6] x [LAT | 42] x [LON | 122]<br>Coordinates: <br> LAT: [-19.9373..-9.655172]<br> LON: [-19.76373..10.25712]<br>Number Of Attributes: 3<br> _FillValue : 9.96921e+36<br> lonFlip : longitude coordinate variable has been reordered via lonFlip<br> average_op_ncl : dim_avg_n over dimension(s): ncl_join<span><br>warning:_NhlCreateSplineCoordApprox: Attempt to create spline approximation for X axis failed: consider adjusting trXTensionF value<br>warning:IrTransInitialize: error creating spline approximation for trXCoordPoints; defaulting to linear<br></span>***********************************************</div><div><br></div>Thanks,<br></div>Ipsita<br></div><div class="m_1657269390287640940m_8776206045668016640HOEnZb"><div class="m_1657269390287640940m_8776206045668016640h5"><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Jun 14, 2018 at 11:22 PM, Dennis Shea <span dir="ltr"><<a href="mailto:shea@ucar.edu" target="_blank">shea@ucar.edu</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div>Without knowing the 'structure' of the original variable, it is hard to offer any help.<br><br></div><div>As ncl-talk suggests, the user should <b>*always include* t</b>he output from <b>printVarSummary </b>of the original variable.<br><br> rl=f[:]->rh ; do <b>not</b> use (:,:,:,:) when importing entire variable; it is inefficient<br></div><div> <b>printVarSummary(rl)</b><br></div><div> rflip=lonFlip(rl)<br> <b>printVarSummary(rflip)<br><br></b> rh=rflip(:,:,80:121,640:761); [-20S to -10S, 20W to 10E]<br> <br> lat=rh&LAT<br> lon=rh&LON<br><br> rh&LAT@units = "degrees north"<br> rh&LON@units = "degrees east" <br> <b>printVarSummary(rh)</b><br> rr=dim_avg_n_Wrap(rh,0)<br> <b>printVarSummary(rr)</b><br></div><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote"><div><div class="m_1657269390287640940m_8776206045668016640m_6909137216342529841h5">On Thu, Jun 14, 2018 at 4:57 AM, Ipsita Putatunda <span dir="ltr"><<a href="mailto:ipsita.putatunda@gmail.com" target="_blank">ipsita.putatunda@gmail.com</a>></span> wrote:<br></div></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div class="m_1657269390287640940m_8776206045668016640m_6909137216342529841h5"><div dir="ltr"><div><div>Dear all,<br></div>I want to plot a region [10S to 20S;20W to 10E] over South Atlantic, my script is attached herewith, which is giving warning message like below-<br><br>*****************************************<br>warning:_NhlCreateSplineCoordApprox: Attempt to create spline approximation for X axis failed: consider adjusting trXTensionF value<br>warning:IrTransInitialize: error creating spline approximation for trXCoordPoints; defaulting to linear<br>********************************************<br>Please help me in this issue. Any suggestions will be appreciated.<br><br></div><div>Thanks in advance,<br></div><div>Ipsita<br></div><div><br></div></div>
<br></div></div>_______________________________________________<br>
ncl-talk mailing list<br>
<a href="mailto:ncl-talk@ucar.edu" target="_blank">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/mailman/listinfo/ncl-talk</a><br>
<br></blockquote></div><br></div>
</blockquote></div><br></div>
</div></div></blockquote></div><br></div>
_______________________________________________<br>
ncl-talk mailing list<br>
<a href="mailto:ncl-talk@ucar.edu" target="_blank">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/mailman/listinfo/ncl-talk</a><br>
</blockquote></div><br clear="all"><div><br></div>-- <br><div dir="ltr" class="m_1657269390287640940gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div><div><span><font color="#888888">Adam Phillips <br></font></span></div><span><font color="#888888">Associate Scientist, </font></span><span><font color="#888888">Climate and Global Dynamics Laboratory, NCAR<br></font></span></div></div><div><span><font color="#888888"><a href="http://www.cgd.ucar.edu/staff/asphilli/" target="_blank">www.cgd.ucar.edu/staff/asphilli/</a> </font></span><span><font color="#888888">303-497-1726 </font></span></div><span><font color="#888888"></font></span><div><div><span><font color="#888888"><br></font></span><div><span><font color="#888888"><a href="http://www.cgd.ucar.edu/staff/asphilli" target="_blank"></a></font></span></div></div></div></div></div></div></div></div></div></div></div>