Skip to content

Commit

Permalink
upd to PyQt5 imports
Browse files Browse the repository at this point in the history
Conflicts:
	audio.py
  • Loading branch information
miili authored and Marius Kriegerowski committed Sep 11, 2017
1 parent 1b9b971 commit 73dfd33
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 14 deletions.
2 changes: 1 addition & 1 deletion ahfullgreen.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import math
import os

from PyQt4.QtCore import *
from PyQt5.QtCore import *
from pyrocko import moment_tensor, model, trace
from pyrocko.gui.snuffling import Snuffling, Param, Choice, Switch, EventMarker
from pyrocko import gf
Expand Down
13 changes: 7 additions & 6 deletions audio.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
from __future__ import print_function

from PyQt4.QtCore import QThread, SIGNAL, QTimer
from pyrocko.gui.snuffling import Snuffling, Param, Choice, Switch, NoTracesSelected
from PyQt5.QtCore import QThread, QTimer
from pyrocko.snuffling import (Snuffling, Param, Choice, Switch,
NoTracesSelected)
import pyrocko.trace as trace
from pyrocko.trace import CosFader
from scipy.io.wavfile import write, read
Expand All @@ -11,7 +12,7 @@


try:
from PyQt4.phonon import Phonon
from PyQt5.phonon import Phonon
no_phonon = False
except ImportError:
no_phonon = True
Expand All @@ -27,7 +28,7 @@ def __init__(self, *args, **kwargs):
self.speed_up = 1.
self.timer = QTimer(self)
self.timer.setInterval(100)
self.connect(self.timer, SIGNAL('timeout()'), self.check_and_update)
self.timer.timeout.connect(self.check_and_update)
self.previous_state = Phonon.StoppedState
self.t_stretch = 1.
self.time_range = (0., 0.)
Expand Down Expand Up @@ -61,7 +62,7 @@ def check_and_update(self):
self.time_range = (self.marker.tmin, self.marker.tmax)
self.viewer.add_marker(self.marker)
self._factor = self.speed_up/(1-self.t_stretch)
if self.speed_up<0.:
if self.speed_up < 0.:
self._start_at = self.time_range[1]
else:
self._start_at = self.time_range[0]
Expand Down Expand Up @@ -89,7 +90,7 @@ class SeiSound(Snuffling):
<body>
<p>
Mark a time range you would like to listen to with an extended marker and press 'Run'.<br>
Mark a time range you would like to listen to with an extended markerand press 'Run'.<br>
Use the scroll bar to <b>fast forward</b> the recording by the chosen factor.<br>
Click <b>Apply Main Control Filter</b> if you want to adopt the main<br>
control filter settings or choose a different setting using the scroll bars.
Expand Down
20 changes: 13 additions & 7 deletions cc_matrix/similarity.py
Original file line number Diff line number Diff line change
@@ -1,16 +1,23 @@
from pyrocko import trace, model
from pyrocko.guts import *
from pyrocko.guts import Object, Int, Float, List, String
from pyrocko.gf import SeismosizerTrace, Target


class Similarity(Object):
'''CC result of one event pair at one target.'''
ievent = Int.T(help='Event identifier')
jevent = Int.T(help='Event identifier')
itarget = Int.T(help='Target identifier')
ievent = Int.T(
help='Event identifier')
jevent = Int.T(
help='Event identifier')
itarget = Int.T(
help='Target identifier')
cross_correlation = Float.T()
cross_correlation_trace = SeismosizerTrace.T(optional=True)
relative_amplitude = Float.T(help='Relative amplitude with reference to ievent.')
time_lag = Float.T(help='Time lag at maximum of cross correlation')
relative_amplitude = Float.T(
help='Relative amplitude with reference to ievent.')
time_lag = Float.T(
help='Time lag at maximum of cross correlation')


class SimilarityMatrix(Object):
''' A container class to store a list of :py:class:`Similarity` instances
Expand All @@ -23,4 +30,3 @@ class SimilarityMatrix(Object):
windowing_method = String.T()
vmin = Float.T()
vmax = Float.T()

0 comments on commit 73dfd33

Please sign in to comment.