<div dir="ltr"><div><div><div><div><div>There is no '"tricky way to convert multiple ascii files to nc files"<br><br></div>Please see: <a href="https://www.ncl.ucar.edu/Document/Functions/Built-in/systemfunc.shtml">https://www.ncl.ucar.edu/Document/Functions/Built-in/systemfunc.shtml</a><br><br></div>to get all desired file names ... then loop over files.<br><br></div>A minor change to previous script is needed.<br><br></div>attached [ uses := reassignment syntax available in v6.1.1; ... otherwise delete variable<br></div>at the end of each iteration]<br></div><div class="gmail_extra"><br><div class="gmail_quote">On Sat, Oct 4, 2014 at 8:49 AM, Li Qi <span dir="ltr"><<a href="mailto:liqi123sh@qq.com" target="_blank">liqi123sh@qq.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div>very nice script and nicely explained...</div><div><br></div><div>Thank you very much!</div><div><br></div><div>By the way: Is there any tricky way to convert multiple ascii files to nc files?</div><div><br></div><div>Attached are the data.</div><div><br></div><div><div><br></div><div style="font-size:12px;font-family:Arial Narrow;padding:2px 0 2px 0">------------------ 原始邮件 ------------------</div><div style="font-size:12px;background:#efefef;padding:8px"><div><b>发件人:</b> "Dennis Shea";<<a href="mailto:shea@ucar.edu" target="_blank">shea@ucar.edu</a>>;</div><div><b>发送时间:</b> 2014年10月4日(星期六) 晚上9:33</div><div><b>收件人:</b> "Li Qi"<<a href="mailto:liqi123sh@qq.com" target="_blank">liqi123sh@qq.com</a>>; <u></u></div><div><b>抄送:</b> "ncl-talk"<<a href="mailto:ncl-talk@ucar.edu" target="_blank">ncl-talk@ucar.edu</a>>; <u></u></div><div><b>主题:</b> Re: [ncl-talk] problems about converting ASCII to nc and plotting thenc file</div></div><div><div class="h5"><div><br></div><div dir="ltr"><div><div><div><div><div><div><div><div><div>[1] lat, lon, rain are all one-dimensional (1D)<br></div>[2] You are setting<br><br></div> rain@lat2d = lat<br></div> rain@lon2d= lon<br><br></div> The reserved attributes @lat2d and @lon2d require two-dimensional arrays.<br></div> That is what the 2d means.<br><br></div>[3] You do not need to create a netCDF file for plotting.<br></div> You can read the ascii and plot<br><br></div>See attached.<br><br>--<br></div>Responses to ncl-talk only. Please no personal salutation.<br></div><div class="gmail_extra"><br><div class="gmail_quote">On Sat, Oct 4, 2014 at 2:14 AM, Li Qi <span dir="ltr"><<a href="mailto:liqi123sh@qq.com" target="_blank">liqi123sh@qq.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div>Dear NCL,</div><div><br></div><div>I have an ASCII file having dimensions [lon,lat],</div><div><br></div><div>then I'd like to convert it to nc file and plot it.</div><div><br></div><div>Attached please find the data and scripts.</div><div><br></div><div>However, when I plot it, I got error warnings and no contours appeared on the map.</div><div><br></div><div>(0) Error: scalar_field: If the input data is 1-dimensional, you must set sfXArray and sfYArray to 1-dimensional arrays of the same length.</div><div>warning:create: Bad HLU id passed to create, ignoring it</div><div>warning:ContourPlotSetValues: Data values out of range of levels set by EXPLICITLEVELS mode</div><div><br></div><div>Could you please to help me?</div><div><br></div><div>Any advice will be greatly appreciated!</div><div><br></div><div>Best,</div><div><br></div><div>LI Qi<span style="line-height:0px"></span></div></div><br>_______________________________________________<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></div></div></div></blockquote></div><br></div>