-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Finalized first version of notebooks
- Loading branch information
Showing
7 changed files
with
634 additions
and
867 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,23 @@ | ||
import numpy as np | ||
import matplotlib.pyplot as plt | ||
from scipy.ndimage import gaussian_filter | ||
from scipy.signal import filtfilt | ||
|
||
|
||
def timespace_mask(arrival, nt, dt, toff=0., smooth=5): | ||
"""Design time-space mask based on arrival time | ||
def timespace_mask(arrival, nt, dt, toff=0., nsmooth=None): | ||
"""Design time-space mask based on arrival times | ||
""" | ||
ns, nr = arrival.shape | ||
|
||
# create mask based on arrival times | ||
mask = np.zeros((ns, nr, nt)) | ||
for isrc in range(ns): | ||
for irec in range(nr): | ||
it = np.round((arrival[isrc, irec] + toff) / dt).astype('int') | ||
mask[isrc, irec, it:] = 1. | ||
|
||
# smooth mask along time axis | ||
if nsmooth is not None: | ||
mask = filtfilt(np.ones(nsmooth) / nsmooth, 1, mask, axis=-1) | ||
|
||
return mask |
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.