Wendi,<br>Assuming your radar data are available at the same time every day, create an overall average and add daily averages to it. Then take the average of the averages at the end. If you have differing numbers of radar valid times each day, you should take a weighted average based on the number of data slices available each day.<br>
<br>Do you plan to access each day's radar data using a separate control file or using a single control file? This distinction makes a difference in how best to code your script. You could either do it one day at a time, or sum all days in one line. That is, you could do it like this:<br>
<br><div>'reinit'<br>'sumaverage = 0'<br>dd = 1<br>while (dd <= 10)<br></div><div>'open [DAY dd CONTROL FILE]'</div><div>'set grads off'</div><div>'set mproj latlon'</div><div>'set mpdset hires'</div>
<div>'set gxout shaded'</div>
<div>'set lon 100 100.82'</div><div>'set lat -0.7 0'</div><div>'set z 3600'</div><div>'set parea 1 7.5 2.8 8.3'</div><div>'set clevs 0 5 10 15 20 25 30 35 40 45 50 55 60'</div><div>
'set ccols 9 14 4 11 5 13 3 10 7 12 8 2 6'</div><div>'set t 1 3600'</div><div>'R=pow(10, ref/10)'</div><div><br>day = dd + 9<br></div><div>'R1=ave(R,time=13Z'dd'APR2004,time=22Z'dd'APR2004)'<br>
'sumaverage = sumaverage + R1'<br></div>dd = dd + 1<br>endwhile<br><div>'average = sumaverage / 10'<br></div><div>...color table options...<br>...map options...<br>'d average'<br>'printim try.gif white'</div>
<br>OR like this<br><br><div>'reinit'<br></div><div>'open [ALL INCLUSIVE CONTROL FILE]'</div><div>'set grads off'</div><div>'set mproj latlon'</div><div>'set mpdset hires'</div><div>
'set gxout shaded'</div>
<div>'set lon 100 100.82'</div><div>'set lat -0.7 0'</div><div>'set z 3600'</div><div>'set parea 1 7.5 2.8 8.3'</div><div>'set clevs 0 5 10 15 20 25 30 35 40 45 50 55 60'</div><div>
'set ccols 9 14 4 11 5 13 3 10 7 12 8 2 6'</div><div>'set t 1 3600'</div><div>'R=pow(10, ref/10)'</div><div>'R1=ave(R,time=13Z10APR2004,time=22Z10APR2004)+ave(R,time=13Z11APR2004,time=22Z11APR2004)+ave(R,time=13Z12APR2004,time=22Z12APR2004)+ave(R,time=13Z13APR2004,time=22Z13APR2004)+ave(R,time=13Z14APR2004,time=22Z14APR2004)+ave(R,time=13Z15APR2004,time=22Z15APR2004)+ave(R,time=13Z16APR2004,time=22Z16APR2004)+ave(R,time=13Z17APR2004,time=22Z17APR2004)+ave(R,time=13Z18APR2004,time=22Z18APR2004)+ave(R,time=13Z19APR2004,time=22Z19APR2004)'<br>
</div><div>...color table options...<br>...map options...<br>'d R1/10'<br>'printim try.gif white'</div><br>Jeff<br><br><div class="gmail_quote">On Fri, Dec 14, 2012 at 12:20 AM, wendi harjupa <span dir="ltr"><<a href="mailto:wendiharjupa@gmail.com" target="_blank">wendiharjupa@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Dear Jeff<div><br></div><div>Thank you very much for your solution,</div><div><br></div><div>I need to make average for 10 days, how to make loop for the next day (same time/13-22)??</div>
<div><br></div><div>Best regards,</div>
<div><div class="gmail_quote">On Fri, Dec 14, 2012 at 1:06 PM, Jeff Duda <span dir="ltr"><<a href="mailto:jeffduda319@gmail.com" target="_blank">jeffduda319@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Change the line<div><div>'R1=ave(R, t=1, t=3600)'</div><div><br></div><div>to </div><div><br></div><div>'R1=ave(R,time=13Z10APR2004,time=22Z10APR2004)'</div><div><br></div><div>Jeff Duda</div><br><div class="gmail_quote">
<div><div>
On Thu, Dec 13, 2012 at 8:42 PM, wendi harjupa <span dir="ltr"><<a href="mailto:wendiharjupa@gmail.com" target="_blank">wendiharjupa@gmail.com</a>></span> wrote:<br></div></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div><div>
Dear Sir/Madam<div><br></div><div>Please I need your help. </div><div>I have one set data (10 days data)</div><div><br></div><div>How to make looping to make reflectivity average for only 10 hours on every day (13hrs-22hrs only)??</div>
<div><br></div><div>Below is my ctl and gs script</div><div><br></div><div><div>try.ctl</div><div><br></div><div>DSET /misc/home/wendi/data1/radar/kototabang/XDR/data/%y4%m2%d2/%d2%h2.dat</div><div>TITLE RADAR</div><div>
OPTIONS TEMPLATE LITTLE_ENDIAN</div><div>UNDEF -1000</div><div>XDEF 321 LINEAR 99.688120996 0.004492369</div><div>YDEF 321 LINEAR -1.083708891 0.004522556</div><div>ZDEF 39 LINEAR 1.0 0.5</div><div>
TDEF 3600 LINEAR 00:00Z10apr2004 4mn </div><div>VARS 2</div><div>ref 39 99 Reflectivity(dBZ)</div><div>vel 39 99 Doppler Velocity(m/s)</div><div>ENDVARS</div></div><div><br></div><div><br></div><div><a href="http://script.gs" target="_blank">script.gs</a></div>
<div><br></div><div><div>'reinit'</div><div>'open try.ctl'</div><div>'set grads off'</div><div>'set mproj latlon'</div><div>'set mpdset hires'</div><div>'set gxout shaded'</div>
<div>'set lon 100 100.82'</div><div>'set lat -0.7 0'</div><div>'set z 3600'</div><div>'set parea 1 7.5 2.8 8.3'</div><div>'set clevs 0 5 10 15 20 25 30 35 40 45 50 55 60'</div><div>
'set ccols 9 14 4 11 5 13 3 10 7 12 8 2 6'</div><div>'set t 1 3600'</div><div>'R=pow(10, ref/10)'</div><div><br></div><div>'R1=ave(R, t=1, t=3600)'</div><div>'set t 1'</div><div>'R2=log10 (R1)'</div>
<div>'d 10*R2'</div><div>'run /misc/home/wendi/grads-2.0.1/cbarn 0.7 0.7 7.4 5.5'</div><div>'draw string 7.2 8.1 [dBz]'</div><div>'draw xlab longitude'</div><div>'draw ylab latitude'</div>
<div>'set mproj latlon'</div><div>'set mpdset hires'</div><div>'set grid off'</div><div><br></div><div>'close 1'</div><div><br></div><div>'printim try.gif white'</div><div>'disable print'</div>
<div> </div><div>'close 1' </div><div><br></div><div>Thank you very much for your help</div><div><br></div><div>Best regards,</div><div>wendi</div><span><font color="#888888"><div><br></div></font></span></div>
<span><font color="#888888"><div><br></div><div><br></div><div><br></div>
<div><br></div><div><br></div><div><br clear="all"><div><br></div>-- <br><span style="font-size:16px;font-family:arial,helvetica,sans-serif">-------------</span><br style="font-size:16px;font-family:arial,helvetica,sans-serif">
<span style="font-size:16px;font-family:arial,helvetica,sans-serif">Wendi Harjupa. ST </span><br style="font-size:16px;font-family:arial,helvetica,sans-serif">
<span style="color:rgb(51,51,51);font-family:arial,sans-serif;font-size:16px;background-color:rgb(245,245,245)">Shimane</span><span style="color:rgb(51,51,51);font-family:arial,sans-serif;font-size:16px;background-color:rgb(245,245,245)"> </span><span style="color:rgb(51,51,51);font-family:arial,sans-serif;font-size:16px;background-color:rgb(245,245,245)">University</span><span style="color:rgb(51,51,51);font-family:arial,sans-serif;font-size:16px;background-color:rgb(245,245,245)"> </span><span style="color:rgb(51,51,51);font-family:arial,sans-serif;font-size:16px;background-color:rgb(245,245,245)">Graduate</span><span style="color:rgb(51,51,51);font-family:arial,sans-serif;font-size:16px;background-color:rgb(245,245,245)"> </span><span style="color:rgb(51,51,51);font-family:arial,sans-serif;font-size:16px;background-color:rgb(245,245,245)">School of</span><span style="color:rgb(51,51,51);font-family:arial,sans-serif;font-size:16px;background-color:rgb(245,245,245)"> </span><span style="color:rgb(51,51,51);font-family:arial,sans-serif;font-size:16px;background-color:rgb(245,245,245)">Engineering Sciences</span><br style="color:rgb(51,51,51);font-family:arial,sans-serif;font-size:16px;background-color:rgb(245,245,245)">
<span style="color:rgb(51,51,51);font-family:arial,sans-serif;font-size:16px;background-color:rgb(245,245,245)">Department of</span><span style="color:rgb(51,51,51);font-family:arial,sans-serif;font-size:16px;background-color:rgb(245,245,245)"> </span><span style="color:rgb(51,51,51);font-family:arial,sans-serif;font-size:16px;background-color:rgb(245,245,245)">Electronic Control</span><span style="color:rgb(51,51,51);font-family:arial,sans-serif;font-size:16px;background-color:rgb(245,245,245)"> </span><span style="color:rgb(51,51,51);font-family:arial,sans-serif;font-size:16px;background-color:rgb(245,245,245)">Systems</span><br style="color:rgb(51,51,51);font-family:arial,sans-serif;font-size:16px;background-color:rgb(245,245,245)">
<span style="color:rgb(51,51,51);font-family:arial,sans-serif;font-size:16px;background-color:rgb(245,245,245)">Remote</span><span style="color:rgb(51,51,51);font-family:arial,sans-serif;font-size:16px;background-color:rgb(245,245,245)"> </span><span style="color:rgb(51,51,51);font-family:arial,sans-serif;font-size:16px;background-color:rgb(245,245,245)">Sensing</span><span style="color:rgb(51,51,51);font-family:arial,sans-serif;font-size:16px;background-color:rgb(245,245,245)"> </span><span style="color:rgb(51,51,51);font-family:arial,sans-serif;font-size:16px;background-color:rgb(245,245,245)">Laboratory</span><div>
<span style="color:rgb(51,51,51);font-family:arial,sans-serif;font-size:16px;background-color:rgb(245,245,245)">s119447</span></div><div><font color="#333333" face="arial, sans-serif" size="3">Cellphone : <a href="tel:%2B81-080-4268-6676" value="+818042686676" target="_blank">+81-080-4268-6676</a></font></div>
<div><font color="#333333" face="arial, sans-serif" size="3">email : <a href="mailto:wendi@rslab.riko.shimane-u.ac.jp" target="_blank">wendi@rslab.riko.shimane-u.ac.jp</a></font></div><br>
</div>
</font></span><br></div></div>_______________________________________________<br>
gradsusr mailing list<br>
<a href="mailto:gradsusr@gradsusr.org" target="_blank">gradsusr@gradsusr.org</a><br>
<a href="http://gradsusr.org/mailman/listinfo/gradsusr" target="_blank">http://gradsusr.org/mailman/listinfo/gradsusr</a><br>
<br></blockquote></div><span><font color="#888888"><br><br clear="all"><span class="HOEnZb"><font color="#888888"><div><br></div>-- <br>Jeff Duda<br>Graduate research assistant<br>University of Oklahoma School of Meteorology<br>
Center for Analysis and Prediction of Storms<br>
<br>
</font></span></font></span></div><span class="HOEnZb"><font color="#888888">
<br>_______________________________________________<br>
gradsusr mailing list<br>
<a href="mailto:gradsusr@gradsusr.org" target="_blank">gradsusr@gradsusr.org</a><br>
<a href="http://gradsusr.org/mailman/listinfo/gradsusr" target="_blank">http://gradsusr.org/mailman/listinfo/gradsusr</a><br>
<br></font></span></blockquote></div><span class="HOEnZb"><font color="#888888"><br><br clear="all"><div><br></div>-- <br><span style="font-size:16px;font-family:arial,helvetica,sans-serif">-------------</span><br style="font-size:16px;font-family:arial,helvetica,sans-serif">
<span style="font-size:16px;font-family:arial,helvetica,sans-serif">Wendi Harjupa. ST </span><br style="font-size:16px;font-family:arial,helvetica,sans-serif">
<span style="color:rgb(51,51,51);font-family:arial,sans-serif;font-size:16px;background-color:rgb(245,245,245)">Shimane</span><span style="color:rgb(51,51,51);font-family:arial,sans-serif;font-size:16px;background-color:rgb(245,245,245)"> </span><span style="color:rgb(51,51,51);font-family:arial,sans-serif;font-size:16px;background-color:rgb(245,245,245)">University</span><span style="color:rgb(51,51,51);font-family:arial,sans-serif;font-size:16px;background-color:rgb(245,245,245)"> </span><span style="color:rgb(51,51,51);font-family:arial,sans-serif;font-size:16px;background-color:rgb(245,245,245)">Graduate</span><span style="color:rgb(51,51,51);font-family:arial,sans-serif;font-size:16px;background-color:rgb(245,245,245)"> </span><span style="color:rgb(51,51,51);font-family:arial,sans-serif;font-size:16px;background-color:rgb(245,245,245)">School of</span><span style="color:rgb(51,51,51);font-family:arial,sans-serif;font-size:16px;background-color:rgb(245,245,245)"> </span><span style="color:rgb(51,51,51);font-family:arial,sans-serif;font-size:16px;background-color:rgb(245,245,245)">Engineering Sciences</span><br style="color:rgb(51,51,51);font-family:arial,sans-serif;font-size:16px;background-color:rgb(245,245,245)">
<span style="color:rgb(51,51,51);font-family:arial,sans-serif;font-size:16px;background-color:rgb(245,245,245)">Department of</span><span style="color:rgb(51,51,51);font-family:arial,sans-serif;font-size:16px;background-color:rgb(245,245,245)"> </span><span style="color:rgb(51,51,51);font-family:arial,sans-serif;font-size:16px;background-color:rgb(245,245,245)">Electronic Control</span><span style="color:rgb(51,51,51);font-family:arial,sans-serif;font-size:16px;background-color:rgb(245,245,245)"> </span><span style="color:rgb(51,51,51);font-family:arial,sans-serif;font-size:16px;background-color:rgb(245,245,245)">Systems</span><br style="color:rgb(51,51,51);font-family:arial,sans-serif;font-size:16px;background-color:rgb(245,245,245)">
<span style="color:rgb(51,51,51);font-family:arial,sans-serif;font-size:16px;background-color:rgb(245,245,245)">Remote</span><span style="color:rgb(51,51,51);font-family:arial,sans-serif;font-size:16px;background-color:rgb(245,245,245)"> </span><span style="color:rgb(51,51,51);font-family:arial,sans-serif;font-size:16px;background-color:rgb(245,245,245)">Sensing</span><span style="color:rgb(51,51,51);font-family:arial,sans-serif;font-size:16px;background-color:rgb(245,245,245)"> </span><span style="color:rgb(51,51,51);font-family:arial,sans-serif;font-size:16px;background-color:rgb(245,245,245)">Laboratory</span><div>
<span style="color:rgb(51,51,51);font-family:arial,sans-serif;font-size:16px;background-color:rgb(245,245,245)">s119447</span></div><div><font color="#333333" face="arial, sans-serif" size="3">Cellphone : +81-080-4268-6676</font></div>
<div><font color="#333333" face="arial, sans-serif" size="3">email : <a href="mailto:wendi@rslab.riko.shimane-u.ac.jp" target="_blank">wendi@rslab.riko.shimane-u.ac.jp</a></font></div><br>
</font></span></div>
<br>_______________________________________________<br>
gradsusr mailing list<br>
<a href="mailto:gradsusr@gradsusr.org">gradsusr@gradsusr.org</a><br>
<a href="http://gradsusr.org/mailman/listinfo/gradsusr" target="_blank">http://gradsusr.org/mailman/listinfo/gradsusr</a><br>
<br></blockquote></div><br><br clear="all"><br>-- <br>Jeff Duda<br>Graduate research assistant<br>University of Oklahoma School of Meteorology<br>Center for Analysis and Prediction of Storms<br><br>