# Re: [ferret_users] how to calculate 5day average

Hello,
It is not working. Iam attaching the input and output file.the input file is dat1.dat and output file is 5day.dat

On Tue, Sep 11, 2012 at 3:30 PM, jagadish karmacharya wrote:
Hi,

Assuming you have daily dataset, first compute the 5 day running mean and then pick every 5th point starting at the 3rd day.
Note that this method doesn't distinguish leap year.

let var_rm=var[l=@sbx:5]
let var_pntd=var_rm[l=3:365:5]    ! assuming lend=365 ( i.e.e 1 year's daily data)

Further for pentad climatology I did the following: (Assuming multi year daily data)

def axis/t=0:365.2425/edges/npoints=365/t0=1-jan-0001/units=days/modulo tdaily
let prc=precip[d=1,gt=tdaily@mod]
let prrm1=prc[l=@sbx:5]

I probabaly got the idea/ pick this up from past email archives, but I am not sure if this the best method to compute pentad & pentad climatology but comparision with daily and daily climatogy plots gave satisfactory result for me

Hope this helps

From:
chinnu sachi <chinnu.sachi7@xxxxxxxxx>
To: ferret_users@xxxxxxxx
Sent: Tuesday, September 11, 2012 9:46 AM
Subject: [ferret_users] how to calculate 5day average

help:
Dear all,
I have a daily dataset of current velocity for standard depths for a particular location, I want to find out the 5day mean. I use the below .jnl file

set mem/size=400
use 77_04-08.nc
let u_5day= u[l=1:1315:5@ave]
list/file=5day.dat u_5day[k=1]
plot u_5day[z=48]
!save/file=u5day.gif

though the .jnl file is working but in ferret the 5day average is not computing correctly,when i computed it manualy.

--
Regards,
Chinnu Sachidanandan
Physical Oceanography Division
National Institute of Oceanography
csachidanandan@xxxxxxx

--
Regards,
Chinnu Sachidanandan
Physical Oceanography Division
National Institute of Oceanography
csachidanandan@xxxxxxx

Attachment: 5day.dat
Description: Binary data

Attachment: dat1.dat
Description: Binary data