<div dir="ltr"><div class="gmail_default" style="font-size:small">Stavros,</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">I think you have a syntax error. Your array is 3004 x 5. Remember that dimension numbering in NCL starts at 0, so to access columns 2,3 and 5, you need:</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small"><span style="font-size:12.8000001907349px"> station = asciiread(ascii_filename,(/</span><span style="font-size:12.8000001907349px">3004,5/),"float")</span><br style="font-size:12.8000001907349px"><span style="font-size:12.8000001907349px"> x = station(:,2) ; Column 3 of file contains X values.</span><br style="font-size:12.8000001907349px"><span style="font-size:12.8000001907349px"> y = station(:,1) ; Column 2 of file contains Y values.</span><br style="font-size:12.8000001907349px"><span style="font-size:12.8000001907349px"> z = station(:,4) ; Column 5 of file contains Z values.</span><br></div><div class="gmail_default" style="font-size:small"><span style="font-size:12.8000001907349px"><br></span></div><div class="gmail_default" style="font-size:small"><span style="font-size:12.8000001907349px">Also make sure that your "x" values are the longitude values, and "y" is latitude.</span></div><div class="gmail_default" style="font-size:small"><span style="font-size:12.8000001907349px"><br></span></div><div class="gmail_default" style="font-size:small"><span style="font-size:12.8000001907349px">I'm in a conference this week, so not on email much. I will try to look for further emails and respond faster.</span></div><div class="gmail_default" style="font-size:small"><span style="font-size:12.8000001907349px"><br></span></div><div class="gmail_default" style="font-size:small"><span style="font-size:12.8000001907349px">--Mary</span></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Sun, Jul 5, 2015 at 4:55 AM, Stavros Dafis <span dir="ltr"><<a href="mailto:sdafis@cc.uoi.gr" target="_blank">sdafis@cc.uoi.gr</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">First of all, happy Independence day to all American users. Secondly, thank you<br>
for your prompt replies.<br>
<br>
I am sorry that I did not make myself clear, I need to regrid my data and then<br>
make a shaded contour plot. For instance, I have a txt file with lat/lon and<br>
rain gauge values. By "decent manner" I mean that NCL triangular mesh<br>
interpolation VS GrADS station interpolation is very bad. Also, the plot<br>
examples with coloured dots are not convenient when you have thousands of<br>
stations.<br>
<br>
These guys in Meteonetwork use natgrid in NCL to plot station data with<br>
excellent results:<br>
<a href="http://www.meteonetwork.it/rete/mappe.php?region=" rel="noreferrer" target="_blank">http://www.meteonetwork.it/rete/mappe.php?region=</a><br>
<br>
So I decided to plot my data this way, but with no success..<br>
<br>
<br>
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl"<br>
begin<br>
ascii_filename = "12h_totalrain_with_id.txt"<br>
station = asciiread(ascii_filename,(/3004,5/),"float")<br>
x = station(:,3) ; Column 3 of file contains X values.<br>
y = station(:,2) ; Column 2 of file contains Y values.<br>
z = station(:,5) ; Column 5 of file contains Z values.<br>
numxout = 21 ; Define output grid for call to "natgrids".<br>
numyout = 21<br>
xmin = min(x)<br>
ymin = min(y)<br>
xmax = max(x)<br>
ymax = max(y)<br>
xc = (xmax-xmin)/(numxout-1)<br>
yc = (ymax-ymin)/(numyout-1)<br>
xo = xmin + ispan(0,numxout-1,1)*xc<br>
yo = ymin + ispan(0,numyout-1,1)*yc<br>
<br>
zo = natgrid(x, y, z, xo, yo) ; Interpolate.<br>
<br>
<br>
The problem seems to be at the 5th column (rain data) according to NCL but I<br>
can't figure it out..<br>
<br>
<br>
Thank you for your time,<br>
<br>
<br>
Stavros<br>
<div><div class="h5"><br>
<br>
<br>
<br>
Quoting Mary Haley <<a href="mailto:haley@ucar.edu">haley@ucar.edu</a>>:<br>
<br>
> Stavros,<br>
><br>
> In what manner do you need to plot the station data? Do you mean like the<br>
> weather plots that Dennis pointed you to, or do you actually need to regrid<br>
> the data and then generate something like a contour plot?<br>
><br>
> Here's is a "station data" examples page, but as you pointed out, some of<br>
> these examples are rather simplistic:<br>
><br>
> <a href="http://www.ncl.ucar.edu/Applications/station.shtml" rel="noreferrer" target="_blank">http://www.ncl.ucar.edu/Applications/station.shtml</a><br>
><br>
> It would help if you could be more specific about what you need.<br>
><br>
> --Mary<br>
><br>
><br>
> On Fri, Jul 3, 2015 at 10:47 AM, Stavros Dafis <<a href="mailto:sdafis@cc.uoi.gr">sdafis@cc.uoi.gr</a>> wrote:<br>
><br>
> > Hi everyone,<br>
> ><br>
> > I am Stavros from Greece, a new user of NCL and I would like to ask you if<br>
> > you<br>
> > have managed to plot station data via NCL in a decent manner. Meteonetwork<br>
> > in<br>
> > Italy uses natgrid interpolation in NCL and plots rain from station data<br>
> > very<br>
> > nice but I haven't managed to do so. In UCAR's page the examples are too<br>
> > simple<br>
> > and they are useless if you have many data. I want to plot about 4000<br>
> > station<br>
> > data in West Europe..<br>
> ><br>
> > Stavros Dafis<br>
> > MSc student Atmospheric Sciences and Environment<br>
> > University of Ioannina<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>
><br>
<br>
<br>
Stavros Dafis<br>
MSc student Atmospheric Sciences and Environment<br>
University of Ioannina<br>
</div></div>Tel: <a href="tel:%2B30%202651008499" value="+302651008499">+30 2651008499</a>, Mobile: <a href="tel:%2B30%206970420242" value="+306970420242">+30 6970420242</a><br>
e-mails: <a href="mailto:sdafis@noa.gr">sdafis@noa.gr</a> or <a href="mailto:dafis91@yahoo.gr">dafis91@yahoo.gr</a> or <a href="mailto:sdafis@cc.uoi.gr">sdafis@cc.uoi.gr</a><br>
Weather charts: <a href="http://www.metar.gr" rel="noreferrer" target="_blank">http://www.metar.gr</a><br>
<a href="http://www.meteovolos.gr" rel="noreferrer" target="_blank">http://www.meteovolos.gr</a><br>
Photos: <a href="https://www.flickr.com/photos/22498448@N04/" rel="noreferrer" target="_blank">https://www.flickr.com/photos/22498448@N04/</a><br>
</blockquote></div><br></div>