[ncl-talk] multiple files with different sizes
Dennis Shea
shea at ucar.edu
Sun Oct 21 15:20:03 MDT 2018
*systemfunc*
<https://www.ncl.ucar.edu/Document/Functions/Built-in/systemfunc.shtml> +
*addfiles*
<https://www.ncl.ucar.edu/Document/Functions/Built-in/addfiles.shtml>
Without knowing specifics, it is hard to answer the question.
[1] *systemfunc *will return the *paths *to files. *They can be* *any* *file
sizes*
[2] *addfiles *allows users to access a single variable that spans multiple
files.
Two options are available:* cat* and *join* [see documentation]
If the variable [say, *X*] is (*time*,[level/depth,],lat,lon). '*time*' is
the record dimension
and the sizes of the *record* (*leftmost*) dimension are (say) 31, 28,
31,30 then
F = *addfiles*(path, "r")
xCat = F[:]->X ; (120,[level/depth,],lat,lon) ,
default *cat *(concatenate) mode
The '*join*' option could *not* be used
-----
There was a recent [ October 6-8 ] ncl-talk question:
*[ncl-talk] read variable with different size dimension in multiple files*
>From the ncl-talk archives: *http://mailman.ucar.edu/pipermail/ncl-talk/*
<http://mailman.ucar.edu/pipermail/ncl-talk/>
Question:
*http://mailman.ucar.edu/pipermail/ncl-talk/2018-October/013295.html*
<http://mailman.ucar.edu/pipermail/ncl-talk/2018-October/013295.html>
Response:
*http://mailman.ucar.edu/pipermail/ncl-talk/2018-October/013302.html*
<http://mailman.ucar.edu/pipermail/ncl-talk/2018-October/013302.html>
---
If you are looping over multiple files and the variable [say, *X*] has
different dimension sizes and the data from each file ar to be processed
individually, then use NCL's replacement (overwrite) syntax *:=*
do nf=0,nfiles-1
f = addfile(path(nf),"r")
x :*=* f->X ; create new 'x' ... can be
a different size/shape/type
end do
On Sat, Oct 20, 2018 at 6:04 PM Vanúcia Schumacher <
vanucia-schumacher at hotmail.com> wrote:
> Hi users,
>
>
> I would like to know if it has another command or way in which I can read multiple
> data files using systemfunc + addfiles, which the files have different
> sizes.
>
>
> Thanks
> _______________________________________________
> 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/20181021/1fcd1473/attachment.html>
More information about the ncl-talk
mailing list