Go to the documentation of this file.
38 if np.isscalar(t_out):
41 posi = np.zeros((nlines,3))
42 veli = np.zeros((nlines,3))
43 orbfl = np.zeros(nlines)
46 ind = np.searchsorted(torb,t_out)-1
47 ind_invalid = np.where((ind<0 )| (ind>norb-2))
51 ind_direct = np.where(t_out[:,
None] == torb[
None, :])
52 if np.size(ind_direct)>0:
53 posi[ind_direct[0],:] = p[ind_direct[1],:]
54 veli[ind_direct[0],:] = v[ind_direct[1],:]
55 orbfl[ind_direct[0]] = 0
58 dt = torb[ind+1] - torb[ind]
60 a1 = v[ind,:]*dt[:,
None]
61 a2 = 3.0*p[ind+1,:] - 3.0*p[ind,:] - 2.0*v[ind,:]*dt[:,
None] - v[ind+1,:]*dt[:,
None]
62 a3 = 2.0*p[ind,:] - 2.0*p[ind+1,:] + v[ind,:]*dt[:,
None] + v[ind+1,:]*dt[:,
None]
64 x = (t_out - torb[ind])/dt
67 posi = a0 + a1*x[:,
None] + a2*x2[:,
None] + a3*x3[:,
None]
68 veli = (a1 + 2.0*a2*x[:,
None] + 3.0*a3*x2[:,
None])/dt[:,
None]
70 posi[ind_invalid,:] = 0.0
71 veli[ind_invalid,:] = 0.0
72 orbfl[ind_invalid] = 1
74 return (posi,veli,orbfl)
def orb_interp(torb, p, v, t_out)