add save data method

This commit is contained in:
Sebastian Wehling-Benatelli 2014-12-18 13:49:16 +01:00
parent f0d60de745
commit 1d61b4936c
2 changed files with 6 additions and 4 deletions

View File

@ -2,6 +2,7 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
import os import os
import numpy as np
from PySide.QtGui import QMessageBox from PySide.QtGui import QMessageBox
from obspy.core import (read, Stream) from obspy.core import (read, Stream)
from obspy import readEvents from obspy import readEvents
@ -93,7 +94,8 @@ class Data(object):
not implemented: {1}'''.format(evtformat, e)) not implemented: {1}'''.format(evtformat, e))
def plotData(self, widget): def plotData(self, widget):
pass #axes = widget.axes time_ax = np.arange(0, len(self.wfdata[0].data)/self.wfdata[0].stats.sampling_rate, self.wfdata[0].stats.delta)
widget.axes.plot(time_ax, self.wfdata[0].data)
def getID(self): def getID(self):
try: try:

View File

@ -11,7 +11,7 @@ matplotlib.use('Qt4Agg')
matplotlib.rcParams['backend.qt4'] = 'PySide' matplotlib.rcParams['backend.qt4'] = 'PySide'
from matplotlib.figure import Figure from matplotlib.figure import Figure
from matplotlib.backends.backend_qt4agg import FigureCanvasQTAgg from matplotlib.backends.backend_qt4agg import FigureCanvasQTAgg as FigureCanvas
from PySide.QtGui import (QAction, from PySide.QtGui import (QAction,
QApplication, QApplication,
QComboBox, QComboBox,
@ -41,14 +41,14 @@ from pylot.core.read import FilterOptions
from pylot.core.util.defaults import OUTPUTFORMATS from pylot.core.util.defaults import OUTPUTFORMATS
class MPLWidget(FigureCanvasQTAgg): class MPLWidget(FigureCanvas):
def __init__(self, parent=None, xlabel='x', ylabel='y', title='Title'): def __init__(self, parent=None, xlabel='x', ylabel='y', title='Title'):
super(MPLWidget, self).__init__(Figure()) super(MPLWidget, self).__init__(Figure())
self.setParent(parent) self.setParent(parent)
self.figure = Figure() self.figure = Figure()
self.canvas = FigureCanvasQTAgg(self.figure) self.canvas = FigureCanvas(self.figure)
self.axes = self.figure.add_subplot(111) self.axes = self.figure.add_subplot(111)
self.axes.set_xlabel(xlabel) self.axes.set_xlabel(xlabel)