Skip to content

Commit 3067d6e

Browse files
committed
Minor optimizations
1 parent 945fcc8 commit 3067d6e

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

seismic/receiver_fn/rf_ccp_util.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -612,10 +612,9 @@ def _interpolate(self):
612612
np.fabs((self._grid[i, 0] - ER))) < self._dz]
613613

614614
if (len(indices) == 0): continue
615-
d = np.zeros(len(indices))
616615

617616
# compute distance of kdtree nodes from current node in swath
618-
d[:] = np.sqrt(np.sum(np.power(sxyz[i] - data[indices, :3], 2), axis=1))
617+
d = np.sqrt(np.sum(np.power(sxyz[i] - data[indices, :3], 2), axis=1))
619618

620619
# filter out nodes outside a cone, defined as current_radius = current depth;
621620
# this is done to avoid lateral smearing at shallow depths, where piercing
@@ -627,7 +626,6 @@ def _interpolate(self):
627626

628627
# compute IDW weights
629628
idwIndices = indices
630-
idw = np.zeros(d.shape)
631629
idw = 1. / np.power(d, p)
632630

633631
# compute mean instantaneous phase weight

0 commit comments

Comments
 (0)