[Thread Prev][Thread Next][Index]

shift or extend data



Hello,

I have again a question to submit to you.
Let's have a variable 'var' with 12 values corresponding to each 2 hours of a day. They are 0 always, except at noon where it equals 4.
1: 0h: 0
2: 2h: 0
3: 4h: 0
4: 6h: 0
5: 8h: 0
6: 10h: 0
7: 12h: 4
8: 14h: 0
9: 16h: 0
10: 18h: 0
11: 20h: 0
12: 22h: 0

I would like to extend my non-zero value to all other time steps, except some:
0h: 0
2h: 0
4h: 4
6h: 4
8h: 4
10h: 4
12h: 4
14h: 4
16h: 4
18h: 4
20h: 4
22h: 0

At present, the only way I found is:
let var_1 = var[L=@shf:-1]
let var_2 = var[L=@shf:-2]
...
and then:
let varA = if MOD(L+5,12) eq 1 then var_1 else var
let varB = if MOD(L+5,12) eq 2 then var_2 else varA
...

Is there no other way to "fill" a variable with specified values ?
Thanks for any suggestion!

Emilie

____________________________________________________________
Emilie VANVYVE
Physicist, PhD student

Université catholique de Louvain (UCL)
Institut d'astronomie et de géophysique G. Lemaître (ASTR)
Chemin du Cyclotron, 2
1348 Louvain-la-Neuve (Belgium)
Phone : +32-(0)10-473300
Fax : +32-(0)10-474722
E-mail : vanvyve@astr.ucl.ac.be
Web : www.astr.ucl.ac.be

[Thread Prev][Thread Next][Index]

Dept of Commerce / NOAA / OAR / PMEL / TMAP

Contact Us | Privacy Policy | Disclaimer | Accessibility Statement