<div dir="ltr"><div class="gmail_default" style="font-size:small">You will have to do some debugging to figure this out, because without the data files, we can't verify that you are passing valid arrays to natgird.</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">Did you actually look at lat, lon, lonn, and latt before you called natgrid to make sure there are no missing values?</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">Here's what I suggest, to help you debug this problem. I'm just doing this for the "lon" variable, but you should do it for all of them:</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">;---Add these lines before you call natgrid</div><div class="gmail_default" style="font-size:small"><font face="monospace, monospace">printVarSummary(lon) ; print information about the variable</font></div><div class="gmail_default" style="font-size:small"><font face="monospace, monospace">printMinMax(lon,0) ; print the min / max of 'lon'</font></div><div class="gmail_default" style="font-size:small"><font face="monospace, monospace">print("# of 'lon' missing values = " + num(ismissing(lon))) ; count number of missing values</font></div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_extra"><div class="gmail_default" style="font-size:small">--Mary</div><div class="gmail_default" style="font-size:small"></div><br><div class="gmail_quote">On Mon, Jan 25, 2016 at 12:31 PM, Adv <span dir="ltr"><<a href="mailto:advita6@gmail.com" target="_blank">advita6@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>Hi,<br>strll = asciiread("stationmac.txt", -1, "string") ;<br> print(strll) ; STATION","STATION_NAME", "LAT", "LON"<br> print("=====")<br><br>sloc = str_get_field(strll , 2, ",")<br> lat = tofloat( str_get_field(strll , 3, ",") )<br> lon = tofloat( str_get_field(strll , 4, ",") )<br> print(sloc +" : "+lat+" "+lon)<br>mnlat=(min(lat))<br>mxlat=(max(lat))<br>mnlon=(min(lon))<br>mxlon=(max(lon))<br>printVarSummary(lon)<br>print(lon)<br>print(lat)<br>lon@_FillValue = -95.06125<br>lat@_FillValue = 46.80<br>print(lon)<br>print(lat)<br>print(mnlon)<br>print(mxlon)<br>print(mnlat)<br>print(mxlat)<br>mlon = 391<br>dlon = -90.35 / mlon<br>lonn = fspan (-116, (mlon - 1) * dlon, mlon)<br>print(lonn)<br>mlat = 391<br>dlat = 49.0 / mlat<br>latt = fspan (40.01, (mlat - 1) * dlat, mlat)<br>print(latt)<br>diri="dailysimms/prec-obs/"<br>z1 = asciiread(diri+"tmax_avg_Jan1965-2005",-1,"float")<br>;print(z1)<br>;printVarSummary(z1)<br>;a = (/1,2,3,4,5,6,7,8/)<br>;390 rows by 50 columns<br>;390 rows by 41 columns<br>a0 = onedtond(z1,(/391,41/))<br>;print(a0)<br>x=dim_avg_n(a0,1)<br>print(x)<br>diri1="dailysimms/prec-obs/"<br>z2 = asciiread(diri1+"tmin_avg_Jan1965-2005",-1,"float")<br>;print(z2)<br>;printVarSummary(z2)<br>;a = (/1,2,3,4,5,6,7,8/)<br>;390 rows by 50 columns<br>;390 rows by 41 columns<br>a1 = onedtond(z2,(/391,41/))<br>;print(a1)<br>y=dim_avg_n(a1,1)<br>print(y)<br>;tenth of degree celcius<br>s=(x+y)/20<br>printVarSummary(s)<br>print(s)<br>;return<br>fo = natgrid(lon,lat,s,lonn, latt)<br><br></div>The Error I encounter is fatal:natgrid: x cannot contain any missing values<br><br></div>I replaced the missing value with digits. Then also why would I get this error? Could someone help me to fix this bug.<br><br></div>Thank you<span class="HOEnZb"><font color="#888888"><br></font></span></div><span class="HOEnZb"><font color="#888888">Adv<br></font></span></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></div>