<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"></head><body dir="auto">Hi <span style="background-color: rgba(255, 255, 255, 0);">Bappaditya,</span><div><br></div><div>Have you tried creating a new, empty array of the same size of all the files you want to concatenate and then create a loop in which you read in a single file, convert it to from short to float and then “add” it to your array?</div><div><br></div><div>I’m not familiar with your data, so my idea might not work for you. Good luck though!</div><div><br></div><div>Greetings from Texas,</div><div>Toni</div><div><br></div><div><br><div id="AppleMailSignature"><b class="" style="background-color: rgba(255, 255, 255, 0); font-size: 13pt;">Toni Klemm</b><b class="" style="background-color: rgba(255, 255, 255, 0); font-size: 13pt;"><span class="">, </span><span class="">Ph.D.</span></b><div><span style="background-color: rgba(255, 255, 255, 0); font-size: 13pt;">Postdoctoral Research Associate</span></div><div><span style="background-color: rgba(255, 255, 255, 0); font-size: 13pt;">Department of Ecosystem Science and Management</span></div><div><span style="background-color: rgba(255, 255, 255, 0); font-size: 13pt;">Texas A&M University, College Station, TX</span></div><div><span style="background-color: rgba(255, 255, 255, 0); font-size: 13pt;">Contributor at the </span><a href="https://www.eccforum.org/" class="" style="background-color: rgba(255, 255, 255, 0); font-size: 13pt;">Early Career Climate Forum</a></div><div><span class="" style="background-color: rgba(255, 255, 255, 0); font-size: 13pt;"><a href="http://www.toni-klemm.de/" class="">www.toni-klemm.de</a> | </span><a href="https://twitter.com/ToniKlemm" class="" style="background-color: rgba(255, 255, 255, 0); font-size: 13pt;">@toniklemm</a></div><div><br></div></div><div><br>On Jul 30, 2018, at 12:00 AM, Bappaditya Nag <<a href="mailto:bappaditya.nag82@gmail.com">bappaditya.nag82@gmail.com</a>> wrote:<br><br></div><blockquote type="cite"><div><div dir="ltr"><div style="color:rgb(0,0,0);font-family:Calibri,Helvetica,sans-serif,EmojiFont,"Apple Color Emoji","Segoe UI Emoji",NotoColorEmoji,"Segoe UI Symbol","Android Emoji",EmojiSymbols;font-size:16px;text-decoration-style:initial;text-decoration-color:initial;margin-top:0px;margin-bottom:0px">Hi,</div><div style="color:rgb(0,0,0);font-family:Calibri,Helvetica,sans-serif,EmojiFont,"Apple Color Emoji","Segoe UI Emoji",NotoColorEmoji,"Segoe UI Symbol","Android Emoji",EmojiSymbols;font-size:16px;text-decoration-style:initial;text-decoration-color:initial;margin-top:0px;margin-bottom:0px"><br></div><div style="color:rgb(0,0,0);font-family:Calibri,Helvetica,sans-serif,EmojiFont,"Apple Color Emoji","Segoe UI Emoji",NotoColorEmoji,"Segoe UI Symbol","Android Emoji",EmojiSymbols;font-size:16px;text-decoration-style:initial;text-decoration-color:initial;margin-top:0px;margin-bottom:0px">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.</div><div style="color:rgb(0,0,0);font-family:Calibri,Helvetica,sans-serif,EmojiFont,"Apple Color Emoji","Segoe UI Emoji",NotoColorEmoji,"Segoe UI Symbol","Android Emoji",EmojiSymbols;font-size:16px;text-decoration-style:initial;text-decoration-color:initial;margin-top:0px;margin-bottom:0px"><br></div><div style="color:rgb(0,0,0);font-family:Calibri,Helvetica,sans-serif,EmojiFont,"Apple Color Emoji","Segoe UI Emoji",NotoColorEmoji,"Segoe UI Symbol","Android Emoji",EmojiSymbols;font-size:16px;text-decoration-style:initial;text-decoration-color:initial;margin-top:0px;margin-bottom:0px">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.</div><div style="color:rgb(0,0,0);font-family:Calibri,Helvetica,sans-serif,EmojiFont,"Apple Color Emoji","Segoe UI Emoji",NotoColorEmoji,"Segoe UI Symbol","Android Emoji",EmojiSymbols;font-size:16px;text-decoration-style:initial;text-decoration-color:initial;margin-top:0px;margin-bottom:0px"><br></div><div style="color:rgb(0,0,0);font-family:Calibri,Helvetica,sans-serif,EmojiFont,"Apple Color Emoji","Segoe UI Emoji",NotoColorEmoji,"Segoe UI Symbol","Android Emoji",EmojiSymbols;font-size:16px;text-decoration-style:initial;text-decoration-color:initial;margin-top:0px;margin-bottom:0px">Present Code is as follows:</div><div style="color:rgb(0,0,0);font-family:Calibri,Helvetica,sans-serif,EmojiFont,"Apple Color Emoji","Segoe UI Emoji",NotoColorEmoji,"Segoe UI Symbol","Android Emoji",EmojiSymbols;font-size:16px;text-decoration-style:initial;text-decoration-color:initial;margin-top:0px;margin-bottom:0px"><br></div><div style="color:rgb(0,0,0);font-family:Calibri,Helvetica,sans-serif,EmojiFont,"Apple Color Emoji","Segoe UI Emoji",NotoColorEmoji,"Segoe UI Symbol","Android Emoji",EmojiSymbols;font-size:16px;text-decoration-style:initial;text-decoration-color:initial;margin-top:0px;margin-bottom:0px"><span style="font-size:12pt">files</span><span style="font-size:12pt"> </span><span style="font-size:12pt">= systemfunc("ls " + dir + "ERA_Interim/ERA_Interim_v_"+year+"*.nc")</span><br></div><div style="color:rgb(0,0,0);font-family:Calibri,Helvetica,sans-serif,EmojiFont,"Apple Color Emoji","Segoe UI Emoji",NotoColorEmoji,"Segoe UI Symbol","Android Emoji",EmojiSymbols;font-size:16px;text-decoration-style:initial;text-decoration-color:initial"><font size="3"><span style="font-size:12pt">fil</span></font><font size="3"><span style="font-size:12pt"><span> </span></span></font><font size="3"><span style="font-size:12pt">= addfiles(files,"r")</span></font><br></div><div style="color:rgb(0,0,0);font-family:Calibri,Helvetica,sans-serif,EmojiFont,"Apple Color Emoji","Segoe UI Emoji",NotoColorEmoji,"Segoe UI Symbol","Android Emoji",EmojiSymbols;font-size:16px;text-decoration-style:initial;text-decoration-color:initial"><font size="3"><span style="font-size:12pt">ListSetType (fil, "cat")</span></font><br></div><div style="color:rgb(0,0,0);font-family:Calibri,Helvetica,sans-serif,EmojiFont,"Apple Color Emoji","Segoe UI Emoji",NotoColorEmoji,"Segoe UI Symbol","Android Emoji",EmojiSymbols;font-size:16px;text-decoration-style:initial;text-decoration-color:initial"><font size="3"><span style="font-size:12pt">v6hrly</span></font><font size="3"><span style="font-size:12pt"><span> </span></span></font><font size="3"><span style="font-size:12pt">= short2flt(fil[:]->v(iStrt:iLast,{lev1:lev2},:,:))</span></font><br></div><div style="color:rgb(0,0,0);font-family:Calibri,Helvetica,sans-serif,EmojiFont,"Apple Color Emoji","Segoe UI Emoji",NotoColorEmoji,"Segoe UI Symbol","Android Emoji",EmojiSymbols;font-size:16px;text-decoration-style:initial;text-decoration-color:initial"><font size="3"><span style="font-size:12pt"><br></span></font></div><div style="color:rgb(0,0,0);font-family:Calibri,Helvetica,sans-serif,EmojiFont,"Apple Color Emoji","Segoe UI Emoji",NotoColorEmoji,"Segoe UI Symbol","Android Emoji",EmojiSymbols;font-size:16px;text-decoration-style:initial;text-decoration-color:initial"><font size="3"><span style="font-size:12pt">Also attached is a figure generated from the code.</span></font></div><div style="color:rgb(0,0,0);font-family:Calibri,Helvetica,sans-serif,EmojiFont,"Apple Color Emoji","Segoe UI Emoji",NotoColorEmoji,"Segoe UI Symbol","Android Emoji",EmojiSymbols;font-size:16px;text-decoration-style:initial;text-decoration-color:initial"><br></div><div style="color:rgb(0,0,0);font-family:Calibri,Helvetica,sans-serif,EmojiFont,"Apple Color Emoji","Segoe UI Emoji",NotoColorEmoji,"Segoe UI Symbol","Android Emoji",EmojiSymbols;font-size:16px;text-decoration-style:initial;text-decoration-color:initial">Warm Regards,</div><div style="color:rgb(0,0,0);font-family:Calibri,Helvetica,sans-serif,EmojiFont,"Apple Color Emoji","Segoe UI Emoji",NotoColorEmoji,"Segoe UI Symbol","Android Emoji",EmojiSymbols;font-size:16px;text-decoration-style:initial;text-decoration-color:initial">Bappaditya Nag</div><div style="color:rgb(0,0,0);font-family:Calibri,Helvetica,sans-serif,EmojiFont,"Apple Color Emoji","Segoe UI Emoji",NotoColorEmoji,"Segoe UI Symbol","Android Emoji",EmojiSymbols;font-size:16px;text-decoration-style:initial;text-decoration-color:initial">Post-doctoral Scholar</div><div style="color:rgb(0,0,0);font-family:Calibri,Helvetica,sans-serif,EmojiFont,"Apple Color Emoji","Segoe UI Emoji",NotoColorEmoji,"Segoe UI Symbol","Android Emoji",EmojiSymbols;font-size:16px;text-decoration-style:initial;text-decoration-color:initial">Florida State University</div><div><div class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><br></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div>
</div>
</div></blockquote><blockquote type="cite"><div><xt_Meridional Wind.png></div></blockquote><blockquote type="cite"><div><span>_______________________________________________</span><br><span>ncl-talk mailing list</span><br><span><a href="mailto:ncl-talk@ucar.edu">ncl-talk@ucar.edu</a></span><br><span>List instructions, subscriber options, unsubscribe:</span><br><span><a href="http://mailman.ucar.edu/mailman/listinfo/ncl-talk">http://mailman.ucar.edu/mailman/listinfo/ncl-talk</a></span><br></div></blockquote></div></body></html>