diff --git a/pylot/core/read/data.py b/pylot/core/read/data.py index 56eb6f52..b11aea34 100644 --- a/pylot/core/read/data.py +++ b/pylot/core/read/data.py @@ -10,8 +10,7 @@ from pylot.core.util import fnConstructor class Data(object): ''' - Data container class providing ObSpy-Stream and -Event instances as - variables. + Data container with attributes wfdata holding ~obspy.core.stream. :type parent: PySide.QtGui.QWidget object, optional :param parent: A PySide.QtGui.QWidget object utilized when @@ -75,6 +74,12 @@ class Data(object): pass #axes = widget.axes + def getEventID(self): + try: + return self.evtdata.get('resource_id').id + except: + return 'smi:bug/pylot/1234' + class GenericDataStructure(object): ''' @@ -104,7 +109,7 @@ class GenericDataStructure(object): class SeiscompDataStructure(object): ''' - Dictionary containing the data acces information for an SDS data archive: + Dictionary containing the data access information for an SDS data archive: :param str dataType: Desired data type. Default: ``'waveform'`` :param sdate, edate: Either date string or an instance of diff --git a/pylot/core/util/layouts.py b/pylot/core/util/layouts.py index 7f7cf7a5..632c2473 100644 --- a/pylot/core/util/layouts.py +++ b/pylot/core/util/layouts.py @@ -13,11 +13,15 @@ from PySide.QtGui import (QVBoxLayout, def layoutStationButtons(data, comp): layout = QVBoxLayout() stationButtons = [] - st = data.select(component=comp) - numStations = len(st) - for n in range(numStations): - stationButtons[n] = QPushButton('%s'.format( - st[n].stats.station)) - layout.addWidget(stationButtons) - + try: + st = data.select(component=comp) + numStations = len(st) + for n in range(numStations): + stat = st[n].stats.station + stationButtons.append(QPushButton('%s'.format(stat))) + except: + for n in range(5): + stationButtons.append(QPushButton('ST%02d'.format(n))) + for button in stationButtons: + layout.addWidget(button) return layout \ No newline at end of file