<div dir="ltr"><div class="gmail_default" style="font-size:small">Ipsita,</div><div class="gmail_default" style="font-size:small"><div class="gmail_default"><br class="">If you have 3 columns of data, where each column has 360*720 values, then you will need to read them in as an n x 3 array as you are already doing, but then use the "reshape" function to reshape the arrays into 2D arrays of 360 x 720.<br></div><div class="gmail_default"><br></div><div class="gmail_default"><a href="http://www.ncl.ucar.edu/Document/Functions/Built-in/reshape.shtml">http://www.ncl.ucar.edu/Document/Functions/Built-in/reshape.shtml</a><br></div><div class="gmail_default"><br></div></div><div class="gmail_default" style="font-size:small">Your information about the ASCII data file is too vague.</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">I don't know what latitude index 108 or longitude index 523 represents in terms of actual degrees. Do you have a description of this file that tells you? This responsibility falls on you to know this, and write the script accordingly, because NCL can't make any assumptions on what the actual values are.</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">Also, is this a rectilinear grid or a curvilinear grid? If you indeed have a 360 x 720 array of unique latitude values, and a 360 x 720 array of longitude values, then this is a curvilinear grid, and hence you cannot use coordinate arrays in the way you were trying to do so in your original script.</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">Please, in the future, you must include more information about your data, because otherwise it creates a lot of back and forth emails with us trying to figure it out. </div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">--Mary</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Nov 26, 2014 at 8:28 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><div><div>The lat lon value 108 and 500 etc is giving the index of lat lon not the exact lat lon in degrees; there are actually 360 *720 lat lon points and for testing purpose I have selected a part of the file.<br><br></div>I want to create a 2D variable say Var(lat,lon) where for each grid point there must be a single value of the variable. But the ascii file contains lat, lon,var in three different column.<br><br></div>Say for example the third row I want Var(lat,lon)=0.06 which should corresponds to the grid where lat=108 and lon=523.<br></div>Hope I am able to make it clear what I want.<br><br></div>Thanks,<br></div>Ipsita<br><div><div><div><br><br><div><br></div></div></div></div></div><div class="HOEnZb"><div class="h5"><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Nov 26, 2014 at 9:46 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">Ipsita,</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">You are creating an 18 x 18 2D array to hold your data, but you only have a 1D array of 18 values. </div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">Also, I don't know what you mean by "2-dimensional coordinate variable". </div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">What you have is a collection of 18 random points, each with a lat/lon point associated with it. This cannot be represented by a 2D array with lat/lon coordinate arrays.</div><div class="gmail_default" style="font-size:small"><br>Also, the latitude values all have a value of "108", and the longitude values are all greater than 500. Are you sure these values are actually lat/lon?</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 Wed, Nov 26, 2014 at 3:54 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><div dir="ltr"><div><div><div>Dear NCL users,<br></div> I have an ASCII file (tt.txt) with data in 3 columns for latitude longitude and variable respectively. Am reading this data using asciiread and trying to create a 2 dimensional coordinate variable with the same lat lon and variable values.But the output is giving all undefined values. Any help in this issues will be appreciated. My script is attached herewith. <br><br></div>Thanks,<br></div>Ipsita<br></div>
<br></div></div>_______________________________________________<br>
ncl-talk mailing list<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></blockquote></div><br></div>
</blockquote></div><br></div>
</div></div></blockquote></div><br></div>