2 Staggered derivatives and interpolations, corresponding to the ones used in the stagger2 3 solver in the DISPATCH code 5 from numpy
import roll, log, exp
8 return (f+roll(f,1,0))*0.5
10 return (f+roll(f,1,1))*0.5
12 return (f+roll(f,1,2))*0.5
14 return (f+roll(f,-1,0))*0.5
16 return (f+roll(f,-1,1))*0.5
18 return (f+roll(f,-1,2))*0.5
22 return (f-roll(f,1,0))*c
25 return (f-roll(f,1,1))*c
28 return (f-roll(f,1,2))*c
32 return (roll(f,-1,0)-f)*c
35 return (roll(f,-1,1)-f)*c
38 return (roll(f,-1,2)-f)*c
42 return (roll(f,-1,0)-roll(f,1,0))*c
45 return (roll(f,-1,1)-roll(f,1,1))*c
48 return (roll(f,-1,2)-roll(f,1,2))*c
52 return xup(f.px/exp(xdn(log(f.d))))
54 return yup(f.py/exp(ydn(log(f.d))))
56 return zup(f.pz/exp(zdn(log(f.d))))