[Thread Prev][Thread Next][Index]

Re: [ferret_users] anomaly and climatology



> Hi Ferret users,
>
> I have a grid(x,y) monthly time-series data of an anomaly variable, say
> : pa  (n values)
> I have a grid(x,y)  monthly climatological variable, say pc (12 values)
>
> Now I would like to build a time series data of the real variable p, on
> the same time-axis as pa
> such as : (in the following, the index corresponds to L index according
> to ferret  definition)
>
> p(1) = pa(1) + pc(1)
> p(2) = pa(2) + pc(2)
> p(12) = pa(12) + pc(12)
> .....
> p(13) = pa(13) + pc(1)
> p(14) = pa(14) + pc(2)
> .....
> p(n) = pa(n) + pc(12)
>
> What is the best way for doing that operation ?

Hi Francois,

A solution is to regrid your variable on a modulo time axis.
Here is an example with 2 time variables pa(l=1:6) and pc (l=1:4)

!===========================================
def axis/t=1:4:1/modulo taxis   ! define a modulo axis

let pc0=tsequence({1,2,3,4})  ! create a dummy variable pc
let pc=pc0[gt=taxis@asn]      ! regrid on the modulo axis
show grid pc  ! note the m for modulo
list pc
list/l=1:10 pc  ! note the repetition

!===========================================
let pa=tsequence({10,20,30,40,50,60}) ! create a dummy variable pa
list pa

!===========================================
let p=pa+pc  ! define the variable p

list/l=1:6 p, pa, pc    ! check the result

Hope that will help you
Patrick


[Thread Prev][Thread Next][Index]

Dept of Commerce / NOAA / OAR / PMEL / TMAP

Contact Us | Privacy Policy | Disclaimer | Accessibility Statement