Skip to content

Commit

Permalink
update weight for dd data
Browse files Browse the repository at this point in the history
  • Loading branch information
xumi1993 committed Jun 17, 2024
1 parent d47d6ba commit 18633c9
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions pytomoatt/src_rec.py
Original file line number Diff line number Diff line change
Expand Up @@ -1056,6 +1056,7 @@ def _generate_cs(self, max_azi_gap, max_dist_gap):
stlos = rec_data['stlo'].values
stels = rec_data['stel'].values
tts = rec_data['tt'].values
weights = rec_data['weight'].values
for i in range(rec_data.shape[0]):
for j in range(i + 1, rec_data.shape[0]):
if abs(baz_values[i] - baz_values[j]) < max_azi_gap or \
Expand All @@ -1074,7 +1075,7 @@ def _generate_cs(self, max_azi_gap, max_dist_gap):
"stel2": stels[j],
"phase": "P,cs",
"tt": tts[i] - tts[j],
"weight": 1.0,
"weight": (weights[i] + weight[j])/2,
}
# set src_index to index
dd_data.append(data_row)
Expand All @@ -1090,13 +1091,12 @@ def _generate_cr(self, max_azi_gap, max_dist_gap):
rec_data = self.rec_points[self.rec_points["staname"] == rec["staname"]]
if rec_data.shape[0] < 2:
continue

baz_values = rec_data['baz'].values
dist_deg_values = rec_data['dist_deg'].values
rec_indices = rec_data['rec_index'].values
src_indices = rec_data['src_index'].values
rec_weights = rec_data['weight'].values
tts = rec_data['tt'].values

for i in range(rec_data.shape[0]):
for j in range(i + 1, rec_data.shape[0]):
if abs(baz_values[i] - baz_values[j]) < max_azi_gap or \
Expand All @@ -1114,7 +1114,7 @@ def _generate_cr(self, max_azi_gap, max_dist_gap):
"evdp2": self.src_points.loc[src_indices[j]]["evdp"],
"phase": "P,cr",
"tt": tts[i] - tts[j],
"weight": 1.0,
"weight": (self.src_points.loc[src_indices[j]]["weight"]+rec_weights[i])/2,
}
results.append(data_row)

Expand Down

0 comments on commit 18633c9

Please sign in to comment.