Skip to content

Commit

Permalink
flake8
Browse files Browse the repository at this point in the history
  • Loading branch information
megies committed Oct 9, 2019
1 parent b7c3fc3 commit c185823
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 13 deletions.
20 changes: 10 additions & 10 deletions obspy/signal/spectral_estimation.py
Original file line number Diff line number Diff line change
Expand Up @@ -1850,13 +1850,13 @@ def plot(self, filename=None, show_coverage=True, show_histogram=True,
like in [ClintonHeaton2002]_ and [CauzziClinton2013]_. Disabled by
default (``None``). Specify ranges (minimum and maximum) for
magnitude and distance of earthquake models given as four floats,
e.g. ``(0, 5, 0, 99)`` for magnitude 1.5 - 4.5 at a epicentral
distance of 10 km. Note only 10, 100 and 3000 km distances and
e.g. ``(0, 5, 0, 99)`` for magnitude 1.5 - 4.5 at a epicentral
distance of 10 km. Note only 10, 100 and 3000 km distances and
magnitudes 1.5 to 7.5 are available. Alternatively, a distance can
be specified in last float of a tuple of three, e.g. ``(0, 5, 10)``
for 10 km distance, or magnitude and distance can be specified in
a tuple of two floats, e.g. ``(5.5, 10)`` for magnitude 5.5 at 10 km
distance.
be specified in last float of a tuple of three, e.g. ``(0, 5, 10)``
for 10 km distance, or magnitude and distance can be specified in
a tuple of two floats, e.g. ``(5.5, 10)`` for magnitude 5.5 at 10
km distance.
:type grid: bool, optional
:param grid: Enable/disable grid in histogram plot.
:type show: bool, optional
Expand Down Expand Up @@ -1948,19 +1948,19 @@ def plot(self, filename=None, show_coverage=True, show_histogram=True,
if show_earthquakes is not None:
if len(show_earthquakes) == 2:
show_earthquakes = (show_earthquakes[0],
show_earthquakes[0]+0.1,
show_earthquakes[0] + 0.1,
show_earthquakes[1],
show_earthquakes[1]+1)
show_earthquakes[1] + 1)
if len(show_earthquakes) == 3:
show_earthquakes += (show_earthquakes[-1]+1, )
show_earthquakes += (show_earthquakes[-1] + 1, )
min_mag, max_mag, min_dist, max_dist = show_earthquakes
for key, data in earthquake_models.items():
magnitude, distance = key
frequencies, accelerations = data
accelerations = np.array(accelerations)
frequencies = np.array(frequencies)
periods = 1.0 / frequencies
# Eq.1 from Clinton and Cauzzi (2013) converts
# Eq.1 from Clinton and Cauzzi (2013) converts
# power to density
ydata = accelerations / (periods ** (-.5))
ydata = 20 * np.log10(ydata / 2)
Expand Down
6 changes: 3 additions & 3 deletions obspy/signal/tests/test_spectral_estimation.py
Original file line number Diff line number Diff line change
Expand Up @@ -550,9 +550,9 @@ def test_earthquake_models(self):
test_magnitudes = [3.5, 2.5, 1.5]
for magnitude in test_magnitudes:
key = (magnitude, 10)
fig = ppsd.plot(show_earthquakes=(magnitude-0.5, magnitude+0.5,
5, 15),
show_noise_models=False, show=False)
fig = ppsd.plot(
show_earthquakes=(magnitude - 0.5, magnitude + 0.5, 5, 15),
show_noise_models=False, show=False)
ax = fig.axes[0]
line = ax.lines[0]
frequencies, accelerations = earthquake_models[key]
Expand Down

0 comments on commit c185823

Please sign in to comment.