[ncl-talk] Reading Multiple Files stored in Short Format

Bappaditya Nag bappaditya.nag82 at gmail.com
Sun Jul 29 23:00:25 MDT 2018


Hi,

I have 6 hrly ERA-Interim data stored in chunks of monthly files in short
format (i.e., each file have their own scale and offset factor). When I
read such multiple files in ncl (i.e., using v->f[:]) and convert to float
(i.e., using short2flt), I do not get the correct result since the scale
and offset of the first file is used for all the files.

Solution : I can unpack and repack the files in a single file, but that is
against the purpose of storing the data in optimal compact format. I am
looking for a solution to read every file, convert to float and
then concatenate the data. Can this be done? Or any other more
effcient solution. Any help is appreciated.

Present Code is as follows:

files = systemfunc("ls " + dir + "ERA_Interim/ERA_Interim_v_"+year+"*.nc")
fil = addfiles(files,"r")
ListSetType (fil, "cat")
v6hrly = short2flt(fil[:]->v(iStrt:iLast,{lev1:lev2},:,:))

Also attached is a figure generated from the code.

Warm Regards,
Bappaditya Nag
Post-doctoral Scholar
Florida State University
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20180730/f1678ae3/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: xt_Meridional Wind.png
Type: image/png
Size: 84111 bytes
Desc: not available
URL: <http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20180730/f1678ae3/attachment.png>


More information about the ncl-talk mailing list