# Re: 2-6 days band pass filter

From: Maria Gehne <mgehne_at_nyahnyahspammersnyahnyah>
Date: Fri Sep 06 2013 - 13:50:12 MDT

Hi Soumik,

the missing values at the beginning and end of the filtered data array
are not errors.

When you do a moving average the filtered value at time t, say y_t,
depends on the original values before and after the time you are looking
at. The number of points before and after depends on the number of
weights you are using. So if your number of weights is N then the
filtered value y_t depends on the (N-1)/2 values before and after x_t
(the original data at time t).

When you get to the end-points of your original data there are not
enough data points on one side to compute the average and NCL puts in a

In your case, you say you have 360 data points and your filter has 359
weights. In that case only 2 values in your filtered data will not be
missing.

I would suggest you play with changing the number of weights to see how
the filtered data depends on the number of weights you use. That will
give you a better feeling for how the moving average works.

Best,
Maria

On 09/06/2013 12:26 PM, Soumik Basu wrote:
> Hello,
>
> I would like to add some details to my problem mentioned in the last
> email about weights and weighted running average.
> I have this array of eke which does not have any missing values
>
> Variable: eke775
> Type: float
> Total Size: 47185920 bytes
> 11796480 values
> Number of Dimensions: 3
> Dimensions and sizes: [time | 360] x [lat | 128] x [lon | 256]
> Coordinates:
> time: [30.5..120.25]
> lat: [-88.92773535229591..88.92773535229591]
> lon: [ 0..358.59375]
> Number Of Attributes: 2
> lev_p : 775
> _FillValue : 9.96921e+36
> (0)
> (0) min=6.84898e-06 max=2269.73
>
> So when I do a running average of this array using 2-6days band pass
> filter(359 weights) it was seen that most of the values are missing
> values in this array as a result the running average is wrong.
> Can anybody please give me some suggestions about what can cause such
> problems in a weighted running average. I am attaching the code.
>
> Variable: eke_f
> Type: float
> Total Size: 47185920 bytes
> 11796480 values
> Number of Dimensions: 3
> Dimensions and sizes: [time | 360] x [lat | 128] x [lon | 256]
> Coordinates:
> time: [30.5..120.25]
> lat: [-88.92773535229591..88.92773535229591]
> lon: [ 0..358.59375]
> Number Of Attributes: 3
> lev_p : 775
> _FillValue : 9.96921e+36
> wgt_runave_op_ncl : wgt_runave_n
> (0)
> (0) min=-295.503 max=333.579
>
>
> Thanks,
> Soumik
>
>
>
> _______________________________________________
> ncl-talk mailing list
> List instructions, subscriber options, unsubscribe:
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk

```--
Maria Gehne
Postdoctoral Fellow
NCAR/CGD/CAS
P.O. Box 3000
Boulder, CO 80307

```

_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Fri Sep 6 13:50:30 2013

This archive was generated by hypermail 2.1.8 : Mon Sep 16 2013 - 13:43:52 MDT