<div dir="ltr"><div class="gmail_default" style="font-size:small">Arun,</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">The issue is that "lonFlip" is expecting the "180" point to be exactly halfway in your longitude array. We need to update the documentation to indicate this.</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">Your longitude values don't jump to 181 until more than halfway through the array, so this is why lonFlip was failing.</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">You can use lonPivot to do what you want:</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small"><div class="gmail_default"><font face="monospace, monospace"> var = in->$ip$</font></div><div class="gmail_default"><font face="monospace, monospace"> var = lonPivot(var,181)</font></div><div class="gmail_default"><font face="monospace, monospace"> printVarSummary(var)</font></div></div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">To make sure that you are referencing the correct latitudes and longitudes afterwards, you want to set xlat and xlon to the arrays that are attached to "var", instead of reading them off the file:</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small"><div class="gmail_default"><font face="monospace, monospace">xlat = var&YT_J</font></div><div class="gmail_default"><font face="monospace, monospace">xlon = var&XT_I</font></div><div class="gmail_default"><font face="arial, helvetica, sans-serif"><br></font></div><div class="gmail_default"><font face="arial, helvetica, sans-serif">These changes should get you the plot you want.</font></div><div class="gmail_default"><font face="arial, helvetica, sans-serif"><br></font></div><div class="gmail_default"><font face="arial, helvetica, sans-serif">-Mary</font></div><div class="gmail_default"><font face="monospace, monospace"><br></font></div></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Jan 19, 2016 at 9:28 PM, Arun Kumar Dwivedi <span dir="ltr"><<a href="mailto:dwivedi.arunkumar@gmail.com" target="_blank">dwivedi.arunkumar@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"><span style="font-size:12.8px">Dear All,</span><div style="font-size:12.8px">As discussed earlier, We have uploaded our nc file and our script in the ftp server. Our requirement is to plot a parameter for Atlantic and Indian ocean (For eg -90W to 100E and from -50S to 50 N).. And our resultant output is also attached where in the plot is only until 0E. </div><div style="font-size:12.8px"><br></div><div style="font-size:12.8px">NOTE: We are taking our inputs from a dat file which is also attached here (mom-ctrl-slc.dat)</div><div style="font-size:12.8px"><br></div><div style="font-size:12.8px">Data File Name--Forecast201510040000.nc</div><div style="font-size:12.8px">Input control File Name  --mom-ctrl-slc.dat</div><div style="font-size:12.8px">Script Name-- mom-slc.ncl</div><div style="font-size:12.8px">Our output Name-- mom_slc_TEMPNEW_2015100612UTC.png</div></div><div class="gmail_extra"><span class=""><br clear="all"><div><div><div dir="ltr"><div><div dir="ltr"><div><div>Thanks & Regards</div><div dir="ltr">Arun Kumar Dwivedi,<br>Project Engineer - II</div><div dir="ltr">Computational Earth Science Group</div><div dir="ltr">CDAC, Pune - 411 007<br>Mob :09546189035</div></div></div></div></div></div></div>
<br></span><div><div class="h5"><div class="gmail_quote">On Sat, Jan 16, 2016 at 2:13 AM, Mary Haley <span dir="ltr"><<a href="mailto:haley@ucar.edu" target="_blank">haley@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 class="gmail_default" style="font-size:small">Can you provide me with the data file so I can test this here? It looks like the longitude values should be flipping correctly, but I don't understand why you are getting values from -257.75 to 101.75.</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">The longitude array must be monotonically increasing for this to work, I believe, but I want to check the array myself to see what's going on with it.</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">If your file is too large, then if you could just write sst to the file by itself, and send me that, then I don't need anything else.</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">You can write sst to a file using the following code:</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">  </div><div class="gmail_default" style="font-size:small"> system("rm <a href="http://marytest.nc" target="_blank">marytest.nc</a>")</div><div class="gmail_default" style="font-size:small"> mout = addfile("<a href="http://marytest.nc" target="_blank">marytest.nc</a>","c")</div><div class="gmail_default" style="font-size:small"> mout->sst = sst</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">You can upload the file to our ftp:</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default"><a href="http://www.ncl.ucar.edu/report_bug.shtml#HowToFTP" target="_blank">http://www.ncl.ucar.edu/report_bug.shtml#HowToFTP</a><br></div><div class="gmail_default"><br></div><div class="gmail_default">or share it via Dropbox or Google Drive or something similar.</div><div class="gmail_default"><br></div><div class="gmail_default">Thanks,</div><div class="gmail_default"><br></div><div class="gmail_default">--Mary</div><div class="gmail_default"><br></div><div class="gmail_default" style="font-size:small">  </div></div><div><div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Jan 13, 2016 at 12:40 AM, Arun Kumar Dwivedi <span dir="ltr"><<a href="mailto:dwivedi.arunkumar@gmail.com" target="_blank">dwivedi.arunkumar@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 style="color:rgb(0,0,0);font-family:Arial,Helvetica,sans-serif;font-size:12px">Dear all,</div><div style="color:rgb(0,0,0);font-family:Arial,Helvetica,sans-serif;font-size:12px">Thank q for the response</div><div style="color:rgb(0,0,0);font-family:Arial,Helvetica,sans-serif;font-size:12px">In continuation to my above query the description is given below </div><div style="color:rgb(0,0,0);font-family:Arial,Helvetica,sans-serif;font-size:12px"><br></div><div style="color:rgb(0,0,0);font-family:Arial,Helvetica,sans-serif;font-size:12px">Our data is rectilinear data ( data is in rectangular matrix with un-uniform spacing). '</div><div style="color:rgb(0,0,0);font-family:Arial,Helvetica,sans-serif;font-size:12px"> </div><div style="color:rgb(0,0,0);font-family:Arial,Helvetica,sans-serif;font-size:12px">Our basic data structure is :</div><div style="color:rgb(0,0,0);font-family:Arial,Helvetica,sans-serif;font-size:12px"> </div><div style="color:rgb(0,0,0);font-family:Arial,Helvetica,sans-serif;font-size:12px">Variable: sst</div><div style="color:rgb(0,0,0);font-family:Arial,Helvetica,sans-serif;font-size:12px">Type: float <br>Total Size: 4499840 bytes <br>           1124960 values <br>Number of Dimensions: 4 <br>Dimensions and sizes:   [T1 | 20] x [ZT_K1_1 | 1] x [YT_J | 178] x [XT_I | 316] <br>Coordinates: <br>           T1: [1005606..1005720] <br>           ZT_K1_1: [ 2.5.. 2.5] <br>           YT_J: [ -79.. 79] <br>           XT_I: [  1.. 359] <br>Number Of Attributes: 4 <br> missing_value :   -1e+34 <br> _FillValue :   -1e+34 <br> long_name :   SST <br> units :   C <br><br></div><div style="color:rgb(0,0,0);font-family:Arial,Helvetica,sans-serif;font-size:12px"><br></div><div style="color:rgb(0,0,0);font-family:Arial,Helvetica,sans-serif;font-size:12px">****************************</div><div style="color:rgb(0,0,0);font-family:Arial,Helvetica,sans-serif;font-size:12px">Our actual problem is we need to plot longitude in the selected range for eg -90W to 120E then it doesnt accept the -90W value since the longitude array is from 0 to 360 , the plot comes from 0 to 120E only. (-ve values not accepted.) . To solve this we used lonflip function so that our longitude array changes from -180 to 180. but since it is un-uniform data ,</div><div style="color:rgb(0,0,0);font-family:Arial,Helvetica,sans-serif;font-size:12px">***********************************</div><div style="color:rgb(0,0,0);font-family:Arial,Helvetica,sans-serif;font-size:12px">After LonFlip , it is</div><div style="color:rgb(0,0,0);font-family:Arial,Helvetica,sans-serif;font-size:12px"><br></div><div style="color:rgb(0,0,0);font-family:Arial,Helvetica,sans-serif;font-size:12px">Variable: sstnew <br>Type: float <br>Total Size: 4499840 bytes <br>           1124960 values <br>Number of Dimensions: 4 <br>Dimensions and sizes:   [T1 | 20] x [ZT_K1_1 | 1] x [YT_J | 178] x [XT_I | 316] <br>Coordinates: <br>           T1: [1005606..1005720] <br>           ZT_K1_1: [ 2.5.. 2.5] <br>           YT_J: [ -79.. 79] <br>           XT_I: [-257.75..101.75] <br>Number Of Attributes: 5 <br> missing_value :   -1e+34 <br> _FillValue :   -1e+34 <br> long_name :   SST <br> units :   C <br> lonFlip :   longitude coordinate variable has been reordered via lonFlip</div><div style="color:rgb(0,0,0);font-family:Arial,Helvetica,sans-serif;font-size:12px"> </div><div style="color:rgb(0,0,0);font-family:Arial,Helvetica,sans-serif;font-size:12px">The longitude is originally from 0 to 360 and after LonFlip it is -257.75..101.75... But when we are plotting in the longitude range (-90, 120) it is coming only in the longitude range (-90, 101)</div><div style="color:rgb(0,0,0);font-family:Arial,Helvetica,sans-serif;font-size:12px"><br></div><div style="color:rgb(0,0,0);font-family:Arial,Helvetica,sans-serif;font-size:12px">So what would be the solution for our problem</div><div style="color:rgb(0,0,0);font-family:Arial,Helvetica,sans-serif;font-size:12px"><br></div><div style="color:rgb(0,0,0);font-family:Arial,Helvetica,sans-serif;font-size:12px"> </div></div><div class="gmail_extra"><br clear="all"><div><div><div dir="ltr"><div><div dir="ltr"><div><div>Thanks & Regards</div><span><font color="#888888"><div dir="ltr">Arun Kumar Dwivedi,<br>Project Engineer - II</div><div dir="ltr">Computational Earth Science Group</div><div dir="ltr">CDAC, Pune - 411 007<br>Mob :<a href="tel:09546189035" value="+919546189035" target="_blank">09546189035</a></div></font></span></div></div></div></div></div></div><div><div>
<br><div class="gmail_quote">On Tue, Jan 12, 2016 at 7:44 PM, Mary Haley <span dir="ltr"><<a href="mailto:haley@ucar.edu" target="_blank">haley@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 class="gmail_default" style="font-size:small">Arun,</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">We need a little more information here. Is your data on a rectilinear grid? This function only works for rectilinear grids (grids represented by 1D lat/lon arrays).</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">Did you look at your longitude values to make sure there are no issues with them before you do lonFlip?  </div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">It would help if we could see a "printVarSummary" of the variable you are trying to call lonFlip on, and also any error messages.</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">--Mary</div><div class="gmail_default" style="font-size:small"><br></div></div><div class="gmail_extra"><br><div class="gmail_quote"><div><div>On Sun, Jan 10, 2016 at 11:10 PM, Arun Kumar Dwivedi <span dir="ltr"><<a href="mailto:dwivedi.arunkumar@gmail.com" target="_blank">dwivedi.arunkumar@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><div dir="ltr">Dear All,<div>I am working on ocean data (MOM and WAM) for global domain. I have issues with longitude, when trying to plot in for particular region. For eg if I want plot with Latitude 0 to 30 and Lon -40 to 100. Then it doesn't recognize the value -40 in the longitude array. </div><div><br></div><div>For this i have tried using LonFlip function, it works fine with uniform grid but doesn't work with my data set which has varied grid resolution (0.5,1 and 1.5). </div><div><br></div><div><br clear="all"><div><div><div dir="ltr"><div dir="ltr"><div>Thanks & Regards</div><span><font color="#888888"><div dir="ltr">Arun Kumar Dwivedi,<br><br></div></font></span></div></div></div></div>
</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>
<br>_______________________________________________<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>
</div></div></blockquote></div><br></div></div></div>
<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" rel="noreferrer" target="_blank">http://mailman.ucar.edu/mailman/listinfo/ncl-talk</a><br>
<br></blockquote></div><br></div>