Browse Source

upd to PyQt5 imports

Conflicts:
	audio.py
python3
miili 3 years ago
committed by Marius Kriegerowski
parent
commit
73dfd33cf9
3 changed files with 21 additions and 14 deletions
  1. +1
    -1
      ahfullgreen.py
  2. +7
    -6
      audio.py
  3. +13
    -7
      cc_matrix/similarity.py

+ 1
- 1
ahfullgreen.py View File

@ -2,7 +2,7 @@ import numpy as num
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


+ 7
- 6
audio.py View File

@ -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
@ -11,7 +12,7 @@ import tempfile
try:
from PyQt4.phonon import Phonon
from PyQt5.phonon import Phonon
no_phonon = False
except ImportError:
no_phonon = True
@ -27,7 +28,7 @@ class MarkerThread(QThread):
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.)
@ -61,7 +62,7 @@ class MarkerThread(QThread):
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]
@ -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.


+ 13
- 7
cc_matrix/similarity.py View File

@ -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
@ -23,4 +30,3 @@ class SimilarityMatrix(Object):
windowing_method = String.T()
vmin = Float.T()
vmax = Float.T()

Loading…
Cancel
Save