import os sys import numpy as np import pandas as pd def ttime z2p2 np

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
import os, sys
import numpy as np
import pandas as pd
def ttime(x,y,z,p):
z2p2 = np.sqrt((1/z**2) - (p**2))
print("z2p2", z2p2)
y2p2 = np.sqrt((1/y**2) - (p**2))
print("y2p2", y2p2)
spt = 2 * x * ( z2p2 - y2p2 )
print("s", spt)
sppt = 2 * x * ( z2p2 + y2p2 )
print("q", sppt)
pmpt = 2 * x * ( y2p2 )
print("p", pmpt)
return (spt, sppt, pmpt)
x=np.loadtxt('xrpt.txt')
y=np.loadtxt('yrpt.txt')
z=np.loadtxt('zrpt.txt')
p=np.loadtxt('slowrpt.txt')
res = ttime(x,y,z,p)
print(res)