Hi,
There are two kinds of transformations, (try the command "show
transformations" for a list of all of them). Variable
transformations return their result on the same underlying axis as
the original variable but do some operation such as smoothing, along
that axis. Regridding transformations put the result onto a new
axis.
It sounds as if you want a regridding operation. You need to define
a new axis with the desired output time interval and regrid onto
that with the @AVE regridding transformation. That might look like
this, if we're just starting with an axis that is t=1,2,3,...,84
yes? DEFINE AXIS/t=2:84:3 t3axis
yes? LET p3 = p[gt=t3axis@AVE]
Then axis t3axis has points 2,5,8, ..., 83 and the first value of
variable p3 is the average of p at 1, 2, and 3 and so on. If your
axis is defined in terms of dates you would do something similar.
You might find this FAQ useful:
How can I determine the averaging weights when regridding with @AVE?
-Ansley
On 10/19/2011 10:24 AM, nuncio@xxxxxxxxx wrote:
Hi,
THis must be a naive question. I have a time axis running from 1:84 and an average
of every three values need to be computed(not a running mean but mean of first 3 values then second 3 values so on).
I tried with a few ways like t=1:84:3@ave, changing
the axis to real time axis like one starting from 1-jan-1900. The problem is FERRET computes
the average but the first value is the average of the first two values not the first three values
@sum also gives sum of first two values with @ngd showing 2 for the first block.
here are few outputs
yes? sh grid p
GRID GIN1
name axis # pts start end
normal X
normal Y
normal Z
TAX1 T 84 r 1 84
is the interval is missing here?
list/l=1:6 p
VARIABLE : P
FILENAME : p.cdf
SUBSET : 6 points (T)
1 / 1: 0.2661
2 / 2: 0.3101
3 / 3: 0.3174
4 / 4: -0.3617
5 / 5: -0.1323
6 / 6: -0.0020
list/l=1:2 p[t=1:84:3@ave]
VARIABLE : P
regrid: 3 delta on T@AVE
FILENAME : p.cdf
SUBSET : 2 points (T)
1 / 1: 0.2881
4 / 2: -0.0589
here the fist value is the sum of the first two values 0.2661 and 0.3101
output of @ngd is this
list/l=1:2 p[t=1:84:3@ngd]
VARIABLE : P (# of points)
regrid: 3 delta on T@NGD
FILENAME : p.cdf
SUBSET : 2 points (T)
1 / 1: 2.000
4 / 2: 3.000
Why the FERRET is not taking first three values for the first average.
Nuncio Murukesh, Ph.D
Research Scientist.
National Centre for Antarctic and Ocean Research
Headland Sada, Vasco Da Gama
Goa, 403804
India.
Ph: Cell-91 9890357423
off- 91 832 2525428
|