Skip to content
This repository has been archived by the owner on Nov 15, 2023. It is now read-only.

Commit

Permalink
Small bugfixes
Browse files Browse the repository at this point in the history
  • Loading branch information
kdeyev committed Aug 26, 2017
1 parent a87c762 commit 54e896f
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions seismic.py
Original file line number Diff line number Diff line change
Expand Up @@ -243,8 +243,11 @@ def xlabel(self):
def ylabel(self):
return self.dimensions[-1]

def spectrum(self, signal, fs):
windowed = signal * np.blackman(len(signal))
@staticmethod
def spectrum(signal, fs, taper = True):
windowed = signal
if taper:
windowed = windowed * np.blackman(len(windowed))
a = abs(np.fft.rfft(windowed))
f = np.fft.rfftfreq(len(signal), 1/fs)

Expand Down Expand Up @@ -305,7 +308,7 @@ def plot_spectrum(self,

spec = np.nanmean(np.dstack(specs), axis=-1)
spec = np.squeeze(spec)
db = 20 * np.log10(amp)
db = 20 * np.log10(spec)
db = db - np.amax(db)
f_peak = np.mean(peaks)
f_min = np.amin(mis)
Expand Down Expand Up @@ -377,6 +380,8 @@ def wiggle_plot(self, l=1, direction='i',
if ax is None:
fig = plt.figure(figsize=(16, 8))
ax = fig.add_subplot(111)

plt.gca().invert_yaxis()

data = self.get_data(l, direction)
rgba = list(rgb) + [alpha]
Expand All @@ -398,8 +403,6 @@ def wiggle_plot(self, l=1, direction='i',
facecolor=rgba,
lw=0,
)
ax.set_xlim(self.olines[0], self.olines[-1])

return ax

def plot(self, slc=None):
Expand Down

0 comments on commit 54e896f

Please sign in to comment.