[ncl-talk] multiple asc files

Dennis Shea shea at ucar.edu
Thu Jul 18 13:20:45 MDT 2019


[1] "using the "do" (loop) I was trying, but I need to open all files at
once. As *systemfunc* + *addfiles*."

No. *addfiles*
<http://www.ncl.ucar.edu/Document/Functions/Built-in/addfiles.shtml> does
not work with ASCII/text/cvs/.... files.

[2] "And how could I save a new asc with this coordinate information from
the head?"

You must manually extract appropriate information and construct the
appropriate arrays.
ASCII/text can be messy. The user must think how to read data in some
appropriate form.
There is no generic 'read an arbitrary ascii file and generate appropriate
information' ... in any language.'
This becomes user responsibility! This is why the netCDF and HDF file
formats are useful.

[3] "Is this possible just reading one by one?"

Yes, of course. However, the user must think how to do it.
========================================================
Over the years, ncl-talk has answered many ASCII read questions.
It is not difficult. However, the user must construct the appropriate
constructs.

Attached, is a basic example.

I saved as netCDF. If you want to save as ascii ... you will have to write
the code.

Perhaps, *you* will have to make some changes for lat/lon.

Good luck



On Wed, Jul 17, 2019 at 5:46 PM Vanúcia Schumacher <
vanucia-schumacher at hotmail.com> wrote:

> Thank you for the support and for your time,
> but using the "do" (loop) I was trying, but I need to open all files at
> once. As systemfunc + addfiles.
> And how could I save a new asc with this coordinate information from the
> head?
> Is this possible or just reading one by one?
>
> Thanks
> ------------------------------
> *De:* Dennis Shea <shea at ucar.edu>
> *Enviado:* quarta-feira, 17 de julho de 2019 20:23
> *Para:* Vanúcia Schumacher
> *Cc:* ncl-talk at ucar.edu
> *Assunto:* Re: [ncl-talk] multiple asc files
>
> The attached is a start
>
>
> On Wed, Jul 17, 2019 at 3:23 PM Vanúcia Schumacher via ncl-talk <
> ncl-talk at ucar.edu> wrote:
>
> Hello
>
> I need help again with NCL.
> How can I open multiple asc files using readAsciiHead?
>
> I need to open multiple asc files and get head information to generate
> coordinate information, then sum these files within the area shape,
> and create an asc file with this coordinate information to plot.
>
> I have not been able to progress further if anyone can help me, I thank you
>
> Attached is an example of some of these asc files and the initial script
> of that I'm trying to do.
>
>
> _______________________________________________
> ncl-talk mailing list
> ncl-talk at ucar.edu
> List instructions, subscriber options, unsubscribe:
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20190718/a709acdc/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: vanucia_test.ncl
Type: application/octet-stream
Size: 4680 bytes
Desc: not available
URL: <http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20190718/a709acdc/attachment.obj>


More information about the ncl-talk mailing list