Skip to content

Commit

Permalink
debug cpara
Browse files Browse the repository at this point in the history
  • Loading branch information
xumi1993 committed Dec 21, 2023
1 parent fc3542b commit be2faff
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions seispy/rf2depth_makedata.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ def __init__(self, cpara:CCPPara, log=setuplog(),
self._test_comp()

def _test_comp(self):
rfpath = join(cpara.rfpath, self.sta_info.station[0])
rfpath = join(self.cpara.rfpath, self.sta_info.station[0])
self.prime_comp = ''
for comp in ['R', 'Q', 'L', 'Z']:
if glob.glob(join(rfpath, '*{}.sac')):
Expand All @@ -92,7 +92,7 @@ def _test_comp(self):

def makedata(self):
for i in range(self.sta_info.stla.shape[0]):
rfpath = join(cpara.rfpath, self.sta_info.station[i])
rfpath = join(self.cpara.rfpath, self.sta_info.station[i])
stadatar = RFStation(rfpath, only_r=True, prime_comp=self.prime_comp)
stadatar.stel = self.sta_info.stel[i]
stadatar.stla = self.sta_info.stla[i]
Expand All @@ -106,27 +106,27 @@ def makedata(self):
if self.modfolder1d is not None:
velmod = _load_mod(self.modfolder1d, self.sta_info.station[i])
else:
velmod = cpara.velmod
ps_rfdepth, end_index, x_s, _ = psrf2depth(stadatar, cpara.depth_axis,
velmod=velmod, srayp=cpara.rayp_lib, sphere=sphere, phase=stadatar.prime_phase)
velmod = self.cpara.velmod
ps_rfdepth, end_index, x_s, _ = psrf2depth(stadatar, self.cpara.depth_axis,
velmod=velmod, srayp=self.cpara.rayp_lib, sphere=sphere, phase=stadatar.prime_phase)
piercelat, piercelon = latlon_from(self.sta_info.stla[i], self.sta_info.stlo[i],
stadatar.bazi, rad2deg(x_s))
else:
if self.raytracing3d:
pplat_s, pplon_s, pplat_p, pplon_p, newtpds = psrf_3D_raytracing(stadatar, cpara.depth_axis, self.mod3d, srayp=self.srayp, sphere=sphere)
pplat_s, pplon_s, pplat_p, pplon_p, newtpds = psrf_3D_raytracing(stadatar, self.cpara.depth_axis, self.mod3d, srayp=self.srayp, sphere=sphere)
else:
pplat_s, pplon_s, pplat_p, pplon_p, raylength_s, raylength_p, tps = psrf_1D_raytracing(
stadatar, cpara.depth_axis, srayp=self.srayp, sphere=sphere, phase=stadatar.prime_phase)
stadatar, self.cpara.depth_axis, srayp=self.srayp, sphere=sphere, phase=stadatar.prime_phase)
newtpds = psrf_3D_migration(pplat_s, pplon_s, pplat_p, pplon_p, raylength_s, raylength_p,
tps, cpara.depth_axis, self.mod3d)
tps, self.cpara.depth_axis, self.mod3d)
if stadatar.prime_phase == 'P':
piercelat, piercelon = pplat_s, pplon_s
else:
piercelat, piercelon = pplat_p, pplon_p
ps_rfdepth, end_index = time2depth(stadatar, cpara.depth_axis, newtpds)
ps_rfdepth, end_index = time2depth(stadatar, self.cpara.depth_axis, newtpds)
rfdep = self._write_rfdep(stadatar, ps_rfdepth, piercelat, piercelon, end_index)
self.rfdepth.append(rfdep)
np.save(cpara.depthdat, self.rfdepth)
np.save(self.cpara.depthdat, self.rfdepth)

def _write_rfdep(self, stadata, amp, pplat, pplon, end_index):
rfdep = {}
Expand Down

0 comments on commit be2faff

Please sign in to comment.