<html>
<head>
<style><!--
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 12pt;
font-family:Calibri
}
--></style></head>
<body class='hmmessage'><div dir='ltr'>Dear Mary,<div>Thank you very much. Now i am assured with my output maps. It was typo error in 2 and 24 from me.<br><br><i>Regards<br>Ramchandra Karki</i><div></div><div>From: haley@ucar.edu<br>Date: Mon, 15 Aug 2016 10:29:06 +0200<br>Subject: Re: [ncl-talk] reshape function and averaging<br>To: rammetro@hotmail.com<br>CC: ncl-talk@ucar.edu<br><br><div dir="ltr"><div class="ecxgmail_default"><font face="arial, helvetica, sans-serif">Dear Ramchandra,</font></div><div class="ecxgmail_default"><font face="arial, helvetica, sans-serif"><br></font></div><div class="ecxgmail_default"><font face="arial, helvetica, sans-serif">I assume that you meant ndays was equal to ntime/24 and not ntime/2.</font></div><div class="ecxgmail_default"><font face="arial, helvetica, sans-serif"><br></font></div><div class="ecxgmail_default"><font face="arial, helvetica, sans-serif">You want the "24" part of the array to be the second one from the left, if your time array is consecutive in time. That is, it is arranged by hour 0, hour 1, ..., hour 23 for the first day, and then hour 0, hour 1, ... hour 23 for the second day, and so on.</font></div><div class="ecxgmail_default"><font face="arial, helvetica, sans-serif"><br></font></div><div class="ecxgmail_default"><font face="arial, helvetica, sans-serif">So what you had was correct:</font></div><div class="ecxgmail_default"><font face="arial, helvetica, sans-serif"><br></font></div><div class="ecxgmail_default"><font face="arial, helvetica, sans-serif">Re3d = reshape(T, (/ndays,24, nlat, nlon/))</font></div><div class="ecxgmail_default"><font face="arial, helvetica, sans-serif"><br></font></div><div class="ecxgmail_default"><font face="arial, helvetica, sans-serif">Regarding the average, if you want to average all the hour 0s as one quantity, and the hour 1s as one quantity, up to hour 23, then:</font></div><div class="ecxgmail_default"><font face="arial, helvetica, sans-serif"><br></font></div><div class="ecxgmail_default"><font face="arial, helvetica, sans-serif">Re3d_avg = dim_avg_n(Re3d,0)</font></div><div class="ecxgmail_default"><font face="arial, helvetica, sans-serif"><br></font></div><div class="ecxgmail_default"><font face="arial, helvetica, sans-serif">which will give you a Re3d_avg that is dimensioned 24 x nlat x nlon.</font></div><div class="ecxgmail_default"><font face="arial, helvetica, sans-serif"><br></font></div><div class="ecxgmail_default"><font face="arial, helvetica, sans-serif"> --Mary</font></div><div class="ecxgmail_default"><font face="arial, helvetica, sans-serif"><br></font></div><div class="ecxgmail_default"><div><font face="arial, helvetica, sans-serif"><br></font></div></div><div class="ecxgmail_extra"><font face="arial, helvetica, sans-serif"><br></font><div class="ecxgmail_quote"><font face="arial, helvetica, sans-serif">On Thu, Aug 11, 2016 at 12:41 PM, Ramchandra Karki <span dir="ltr"><<a href="mailto:rammetro@hotmail.com" target="_blank">rammetro@hotmail.com</a>></span> wrote:<br></font><blockquote class="ecxgmail_quote" style="border-left:1px #ccc solid;padding-left:1ex;">
<div><div dir="ltr"><font face="arial, helvetica, sans-serif"> </font><div><font face="arial, helvetica, sans-serif">Dear NCL users,</font></div><div><font face="arial, helvetica, sans-serif">I am bit confused with reshape function in NCL.</font></div><div><ul><li><font face="arial, helvetica, sans-serif">I have an hourly wrf output for 30days with 720 time stamp. and I want to get hourly average of 30 days 2m Temperature data as each 0, 1, 2, .....................23 hour average values. (or 24 values in total)</font></li><li><font face="arial, helvetica, sans-serif"> I have array as (ntime, nlat, nlon) number of time, latitude and longitude points for variable T</font></li><li><font face="arial, helvetica, sans-serif">then i defined ndays = ntime/2</font></li><li><font face="arial, helvetica, sans-serif">and reshape as </font></li><li><font face="arial, helvetica, sans-serif">Re3d = reshape(T, (/ndays,24, nlat, nlon/)) ; i am confused with putting 24 at first array or second </font></li><li><font face="arial, helvetica, sans-serif">then averaged as</font></li><li><font face="arial, helvetica, sans-serif">Re3d_avg = dim_avg_n_Wrap(Re3d,0)</font></li><li><font face="arial, helvetica, sans-serif"><br></font></li><li><font face="arial, helvetica, sans-serif">would it correctly produce the hourly average for each hour or i am doing it in wrong way. I would be grateful if somebody could kindly suggest me the right way.</font></li></ul></div><div><font face="arial, helvetica, sans-serif"><br><i>Regards<span class="ecxHOEnZb"><font color="#888888"><br>Ramchandra Karki</font></span></i></font><div><font face="arial, helvetica, sans-serif"><br></font></div></div>                                            </div></div>
<font face="arial, helvetica, sans-serif"><br>______________________________<wbr>_________________<br>
ncl-talk mailing list<br>
<a href="mailto:ncl-talk@ucar.edu">ncl-talk@ucar.edu</a><br>
List instructions, subscriber options, unsubscribe:<br>
<a href="http://mailman.ucar.edu/mailman/listinfo/ncl-talk" rel="noreferrer" target="_blank">http://mailman.ucar.edu/<wbr>mailman/listinfo/ncl-talk</a><br>
<br></font></blockquote></div><br></div></div></div></div>                                            </div></body>
</html>