<div dir="ltr"><div><div class="gmail_signature"><div dir="ltr"><div dir="ltr"><font color="#000000" style="background-color:rgb(255,255,255)"><span style="font-family:'comic sans ms',sans-serif">Dear All,</span><br></font></div></div></div></div><div class="gmail_quote"><div dir="ltr"><div style="font-family:'comic sans ms',sans-serif"><font color="#000000" style="background-color:rgb(255,255,255)">In continution to our previous query and according to the suggestions given, LonPivot function is used and the longitude array was reassigned from -180 to 180 after LonPivot, but still there is a problem with the output plot. Attached is our output file and the modified script. <br></font></div><div style="font-family:'comic sans ms',sans-serif"><font color="#000000" style="background-color:rgb(255,255,255)">The variable summary before LonPivot and After LonPivot is given below. <br><br><b>Before assigning</b><br>Variable: var<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: [ 1.. 359]<br>Number Of Attributes: 4<br> missing_value : -1e+34<br> _FillValue : -1e+34<br> long_name : Sea Surface Temperature<br> units : Deg C<br><br><br></font></div><div style="font-family:'comic sans ms',sans-serif"><font color="#000000" style="background-color:rgb(255,255,255)"><b>AFTER LONPIVOT</b><br>Variable: var1<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: [-179.. 179]<br>Number Of Attributes: 5<br> missing_value : -1e+34<br> _FillValue : -1e+34<br> long_name : Sea Surface Temperature<br> units : Deg C<br> lonPivot : reordered via lonPivot [NCL]: pivotLon=181<br></font></div></div></div><div class="gmail_extra"><font color="#000000" style="background-color:rgb(255,255,255)"><br clear="all"></font><div><div class="gmail_signature"><div dir="ltr"><div dir="ltr"><div><font color="#000000" style="background-color:rgb(255,255,255)">Thanks & Regards</font></div><div dir="ltr"><font color="#000000" style="background-color:rgb(255,255,255)">Arun Kumar Dwivedi</font></div><div dir="ltr"><span style="color:rgb(0,0,0)">Mob :09546189035</span></div></div></div></div></div>
<font color="#000000" style="background-color:rgb(255,255,255)"><br></font><div class="gmail_quote"><font color="#000000" style="background-color:rgb(255,255,255)">On Fri, Jan 22, 2016 at 1:29 AM, Mary Haley <span dir="ltr"><<a href="mailto:haley@ucar.edu" target="_blank">haley@ucar.edu</a>></span> wrote:<br></font><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div style="font-size:small"><font color="#000000" style="background-color:rgb(255,255,255)">Arun,</font></div><div style="font-size:small"><font color="#000000" style="background-color:rgb(255,255,255)"><br></font></div><div style="font-size:small"><font color="#000000" style="background-color:rgb(255,255,255)">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.</font></div><div style="font-size:small"><font color="#000000" style="background-color:rgb(255,255,255)"><br></font></div><div style="font-size:small"><font color="#000000" style="background-color:rgb(255,255,255)">Your longitude values don't jump to 181 until more than halfway through the array, so this is why lonFlip was failing.</font></div><div style="font-size:small"><font color="#000000" style="background-color:rgb(255,255,255)"><br></font></div><div style="font-size:small"><font color="#000000" style="background-color:rgb(255,255,255)">You can use lonPivot to do what you want:</font></div><div style="font-size:small"><font color="#000000" style="background-color:rgb(255,255,255)"><br></font></div><div style="font-size:small"><div><font face="monospace, monospace" color="#000000" style="background-color:rgb(255,255,255)"> var = in->$ip$</font></div><div><font face="monospace, monospace" color="#000000" style="background-color:rgb(255,255,255)"> var = lonPivot(var,181)</font></div><div><font face="monospace, monospace" color="#000000" style="background-color:rgb(255,255,255)"> printVarSummary(var)</font></div></div><div style="font-size:small"><font color="#000000" style="background-color:rgb(255,255,255)"><br></font></div><div style="font-size:small"><font color="#000000" style="background-color:rgb(255,255,255)">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:</font></div><div style="font-size:small"><font color="#000000" style="background-color:rgb(255,255,255)"><br></font></div><div style="font-size:small"><div><font face="monospace, monospace" color="#000000" style="background-color:rgb(255,255,255)">xlat = var&YT_J</font></div><div><font face="monospace, monospace" color="#000000" style="background-color:rgb(255,255,255)">xlon = var&XT_I</font></div><div><font face="arial, helvetica, sans-serif" color="#000000" style="background-color:rgb(255,255,255)"><br></font></div><div><font face="arial, helvetica, sans-serif" color="#000000" style="background-color:rgb(255,255,255)">These changes should get you the plot you want.</font></div><span class="HOEnZb" style="background-color:rgb(255,255,255)"><font color="#000000"><div><font face="arial, helvetica, sans-serif"><br></font></div><div><font face="arial, helvetica, sans-serif">-Mary</font></div><div><font face="monospace, monospace"><br></font></div></font></span></div></div><div class="HOEnZb"><div class="h5"><div class="gmail_extra"><font color="#000000" style="background-color:rgb(255,255,255)"><br></font><div class="gmail_quote"><font color="#000000" style="background-color:rgb(255,255,255)">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></font><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;background-color:rgb(255,255,255)"><font color="#000000">Dear All,</font></span><div style="font-size:12.8px"><font color="#000000" style="background-color:rgb(255,255,255)">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. </font></div><div style="font-size:12.8px"><font color="#000000" style="background-color:rgb(255,255,255)"><br></font></div><div style="font-size:12.8px"><font color="#000000" style="background-color:rgb(255,255,255)">NOTE: We are taking our inputs from a dat file which is also attached here (mom-ctrl-slc.dat)</font></div><div style="font-size:12.8px"><font color="#000000" style="background-color:rgb(255,255,255)"><br></font></div><div style="font-size:12.8px"><font color="#000000" style="background-color:rgb(255,255,255)">Data File Name--Forecast201510040000.nc</font></div><div style="font-size:12.8px"><font color="#000000" style="background-color:rgb(255,255,255)">Input control File Name --mom-ctrl-slc.dat</font></div><div style="font-size:12.8px"><font color="#000000" style="background-color:rgb(255,255,255)">Script Name-- mom-slc.ncl</font></div><div style="font-size:12.8px"><font color="#000000" style="background-color:rgb(255,255,255)">Our output Name-- mom_slc_TEMPNEW_2015100612UTC.png</font></div></div><div class="gmail_extra"><font color="#000000" style="background-color:rgb(255,255,255)"><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 :<a href="tel:09546189035" value="+919546189035" target="_blank">09546189035</a></div></div></div></div></div></div></div>
<br></font><div><div><div class="gmail_quote"><font color="#000000" style="background-color:rgb(255,255,255)">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></font><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div style="font-size:small"><font color="#000000" style="background-color:rgb(255,255,255)">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.</font></div><div style="font-size:small"><font color="#000000" style="background-color:rgb(255,255,255)"><br></font></div><div style="font-size:small"><font color="#000000" style="background-color:rgb(255,255,255)">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.</font></div><div style="font-size:small"><font color="#000000" style="background-color:rgb(255,255,255)"><br></font></div><div style="font-size:small"><font color="#000000" style="background-color:rgb(255,255,255)">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.</font></div><div style="font-size:small"><font color="#000000" style="background-color:rgb(255,255,255)"><br></font></div><div style="font-size:small"><font color="#000000" style="background-color:rgb(255,255,255)">You can write sst to a file using the following code:</font></div><div style="font-size:small"><font color="#000000" style="background-color:rgb(255,255,255)"><br></font></div><div style="font-size:small"><font color="#000000" style="background-color:rgb(255,255,255)"> </font></div><div style="font-size:small"><font color="#000000" style="background-color:rgb(255,255,255)"> system("rm <a href="http://marytest.nc" target="_blank">marytest.nc</a>")</font></div><div style="font-size:small"><font color="#000000" style="background-color:rgb(255,255,255)"> mout = addfile("<a href="http://marytest.nc" target="_blank">marytest.nc</a>","c")</font></div><div style="font-size:small"><font color="#000000" style="background-color:rgb(255,255,255)"> mout->sst = sst</font></div><div style="font-size:small"><font color="#000000" style="background-color:rgb(255,255,255)"><br></font></div><div style="font-size:small"><font color="#000000" style="background-color:rgb(255,255,255)">You can upload the file to our ftp:</font></div><div style="font-size:small"><font color="#000000" style="background-color:rgb(255,255,255)"><br></font></div><div><font color="#000000" style="background-color:rgb(255,255,255)"><a href="http://www.ncl.ucar.edu/report_bug.shtml#HowToFTP" target="_blank">http://www.ncl.ucar.edu/report_bug.shtml#HowToFTP</a><br></font></div><div><font color="#000000" style="background-color:rgb(255,255,255)"><br></font></div><div><font color="#000000" style="background-color:rgb(255,255,255)">or share it via Dropbox or Google Drive or something similar.</font></div><div><font color="#000000" style="background-color:rgb(255,255,255)"><br></font></div><div><font color="#000000" style="background-color:rgb(255,255,255)">Thanks,</font></div><div><font color="#000000" style="background-color:rgb(255,255,255)"><br></font></div><div><font color="#000000" style="background-color:rgb(255,255,255)">--Mary</font></div><div><font color="#000000" style="background-color:rgb(255,255,255)"><br></font></div><div style="font-size:small"><font color="#000000" style="background-color:rgb(255,255,255)"> </font></div></div><div><div><div class="gmail_extra"><font color="#000000" style="background-color:rgb(255,255,255)"><br></font><div class="gmail_quote"><font color="#000000" style="background-color:rgb(255,255,255)">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></font><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div style="font-family:Arial,Helvetica,sans-serif;font-size:12px"><font color="#000000" style="background-color:rgb(255,255,255)">Dear all,</font></div><div style="font-family:Arial,Helvetica,sans-serif;font-size:12px"><font color="#000000" style="background-color:rgb(255,255,255)">Thank q for the response</font></div><div style="font-family:Arial,Helvetica,sans-serif;font-size:12px"><font color="#000000" style="background-color:rgb(255,255,255)">In continuation to my above query the description is given below </font></div><div style="font-family:Arial,Helvetica,sans-serif;font-size:12px"><font color="#000000" style="background-color:rgb(255,255,255)"><br></font></div><div style="font-family:Arial,Helvetica,sans-serif;font-size:12px"><font color="#000000" style="background-color:rgb(255,255,255)">Our data is rectilinear data ( data is in rectangular matrix with un-uniform spacing). '</font></div><div style="font-family:Arial,Helvetica,sans-serif;font-size:12px"><font color="#000000" style="background-color:rgb(255,255,255)"> </font></div><div style="font-family:Arial,Helvetica,sans-serif;font-size:12px"><font color="#000000" style="background-color:rgb(255,255,255)">Our basic data structure is :</font></div><div style="font-family:Arial,Helvetica,sans-serif;font-size:12px"><font color="#000000" style="background-color:rgb(255,255,255)"> </font></div><div style="font-family:Arial,Helvetica,sans-serif;font-size:12px"><font color="#000000" style="background-color:rgb(255,255,255)">Variable: sst</font></div><div style="font-family:Arial,Helvetica,sans-serif;font-size:12px"><font color="#000000" style="background-color:rgb(255,255,255)">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></font></div><div style="font-family:Arial,Helvetica,sans-serif;font-size:12px"><font color="#000000" style="background-color:rgb(255,255,255)"><br></font></div><div style="font-family:Arial,Helvetica,sans-serif;font-size:12px"><font color="#000000" style="background-color:rgb(255,255,255)">****************************</font></div><div style="font-family:Arial,Helvetica,sans-serif;font-size:12px"><font color="#000000" style="background-color:rgb(255,255,255)">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 ,</font></div><div style="font-family:Arial,Helvetica,sans-serif;font-size:12px"><font color="#000000" style="background-color:rgb(255,255,255)">***********************************</font></div><div style="font-family:Arial,Helvetica,sans-serif;font-size:12px"><font color="#000000" style="background-color:rgb(255,255,255)">After LonFlip , it is</font></div><div style="font-family:Arial,Helvetica,sans-serif;font-size:12px"><font color="#000000" style="background-color:rgb(255,255,255)"><br></font></div><div style="font-family:Arial,Helvetica,sans-serif;font-size:12px"><font color="#000000" style="background-color:rgb(255,255,255)">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</font></div><div style="font-family:Arial,Helvetica,sans-serif;font-size:12px"><font color="#000000" style="background-color:rgb(255,255,255)"> </font></div><div style="font-family:Arial,Helvetica,sans-serif;font-size:12px"><font color="#000000" style="background-color:rgb(255,255,255)">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)</font></div><div style="font-family:Arial,Helvetica,sans-serif;font-size:12px"><font color="#000000" style="background-color:rgb(255,255,255)"><br></font></div><div style="font-family:Arial,Helvetica,sans-serif;font-size:12px"><font color="#000000" style="background-color:rgb(255,255,255)">So what would be the solution for our problem</font></div><div style="font-family:Arial,Helvetica,sans-serif;font-size:12px"><font color="#000000" style="background-color:rgb(255,255,255)"><br></font></div><div style="font-family:Arial,Helvetica,sans-serif;font-size:12px"><font color="#000000" style="background-color:rgb(255,255,255)"> </font></div></div><div class="gmail_extra"><font color="#000000" style="background-color:rgb(255,255,255)"><br clear="all"></font><div><div><div dir="ltr"><div><div dir="ltr"><div><div><font color="#000000" style="background-color:rgb(255,255,255)">Thanks & Regards</font></div><font color="#000000" style="background-color:rgb(255,255,255)"><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></div></div></div></div></div></div><div><div>
<font color="#000000" style="background-color:rgb(255,255,255)"><br></font><div class="gmail_quote"><font color="#000000" style="background-color:rgb(255,255,255)">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></font><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div style="font-size:small"><font color="#000000" style="background-color:rgb(255,255,255)">Arun,</font></div><div style="font-size:small"><font color="#000000" style="background-color:rgb(255,255,255)"><br></font></div><div style="font-size:small"><font color="#000000" style="background-color:rgb(255,255,255)">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).</font></div><div style="font-size:small"><font color="#000000" style="background-color:rgb(255,255,255)"><br></font></div><div style="font-size:small"><font color="#000000" style="background-color:rgb(255,255,255)">Did you look at your longitude values to make sure there are no issues with them before you do lonFlip? </font></div><div style="font-size:small"><font color="#000000" style="background-color:rgb(255,255,255)"><br></font></div><div style="font-size:small"><font color="#000000" style="background-color:rgb(255,255,255)">It would help if we could see a "printVarSummary" of the variable you are trying to call lonFlip on, and also any error messages.</font></div><div style="font-size:small"><font color="#000000" style="background-color:rgb(255,255,255)"><br></font></div><div style="font-size:small"><font color="#000000" style="background-color:rgb(255,255,255)">--Mary</font></div><div style="font-size:small"><font color="#000000" style="background-color:rgb(255,255,255)"><br></font></div></div><div class="gmail_extra"><font color="#000000" style="background-color:rgb(255,255,255)"><br></font><div class="gmail_quote"><div><div><font color="#000000" style="background-color:rgb(255,255,255)">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></font></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"><font color="#000000" style="background-color:rgb(255,255,255)">Dear All,</font><div><font color="#000000" style="background-color:rgb(255,255,255)">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. </font></div><div><font color="#000000" style="background-color:rgb(255,255,255)"><br></font></div><div><font color="#000000" style="background-color:rgb(255,255,255)">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). </font></div><div><font color="#000000" style="background-color:rgb(255,255,255)"><br></font></div><div><font color="#000000" style="background-color:rgb(255,255,255)"><br clear="all"></font><div><div><div dir="ltr"><div dir="ltr"><div><font color="#000000" style="background-color:rgb(255,255,255)">Thanks & Regards</font></div><div dir="ltr"><font color="#000000" style="background-color:rgb(255,255,255)">Arun Kumar Dwivedi,<br><br></font></div></div></div></div></div>
</div></div>
<font color="#000000" style="background-color:rgb(255,255,255)"><br></font></div></div><font color="#000000" style="background-color:rgb(255,255,255)">_______________________________________________<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></font></blockquote></div><font color="#000000" style="background-color:rgb(255,255,255)"><br></font></div>
</blockquote></div><font color="#000000" style="background-color:rgb(255,255,255)"><br></font></div></div></div>
<font color="#000000" style="background-color:rgb(255,255,255)"><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></font></blockquote></div><font color="#000000" style="background-color:rgb(255,255,255)"><br></font></div>
</div></div></blockquote></div><font color="#000000" style="background-color:rgb(255,255,255)"><br></font></div></div></div>
<font color="#000000" style="background-color:rgb(255,255,255)"><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></font></blockquote></div><font color="#000000" style="background-color:rgb(255,255,255)"><br></font></div>
</div></div></blockquote></div><br></div></div>