From 17585f93813bde0173cb6194c58cda7396d7b02b Mon Sep 17 00:00:00 2001 From: Sebastianw Wehling-Benatelli Date: Mon, 19 Sep 2016 11:29:33 +0200 Subject: [PATCH] [rename] renaming getGlobalTimes for consistency and introduction of similar new function in future commit --- QtPyLoT.py | 4 ++-- pylot/core/active/seismicshot.py | 4 ++-- pylot/core/io/data.py | 4 ++-- pylot/core/io/phases.py | 4 ++-- pylot/core/util/utils.py | 2 +- pylot/core/util/widgets.py | 6 +++--- 6 files changed, 12 insertions(+), 12 deletions(-) diff --git a/QtPyLoT.py b/QtPyLoT.py index 524643c6..00f4850a 100755 --- a/QtPyLoT.py +++ b/QtPyLoT.py @@ -55,7 +55,7 @@ from pylot.core.util.errors import FormatError, DatastructureError, \ OverwriteError from pylot.core.util.connection import checkurl from pylot.core.util.utils import fnConstructor, getLogin, \ - getGlobalTimes + full_range from pylot.core.io.location import create_creation_info, create_event from pylot.core.util.widgets import FilterOptionsDialog, NewEventDlg, \ WaveformWidget, PropertiesDlg, HelpForm, createAction, PickDlg, \ @@ -643,7 +643,7 @@ class MainWindow(QMainWindow): ans = self.data.setWFData(self.getWFFnames()) else: ans = False - self._stime = getGlobalTimes(self.get_data().getWFData())[0] + self._stime = full_range(self.get_data().getWFData())[0] if ans: self.plotWaveformData() return ans diff --git a/pylot/core/active/seismicshot.py b/pylot/core/active/seismicshot.py index 9f270c76..e74ecaed 100644 --- a/pylot/core/active/seismicshot.py +++ b/pylot/core/active/seismicshot.py @@ -740,11 +740,11 @@ class SeismicShot(object): self._drawCFs(traceID, folm) def _drawStream(self, traceID, refresh=False, ax=None): - from pylot.core.util.utils import getGlobalTimes + from pylot.core.util.utils import full_range from pylot.core.util.utils import prepTimeAxis stream = self.getSingleStream(traceID) - stime = getGlobalTimes(stream)[0] + stime = full_range(stream)[0] timeaxis = prepTimeAxis(stime, stream[0]) timeaxis -= stime diff --git a/pylot/core/io/data.py b/pylot/core/io/data.py index 0b49230f..c3ca8b85 100644 --- a/pylot/core/io/data.py +++ b/pylot/core/io/data.py @@ -10,7 +10,7 @@ from obspy.core.event import Event from pylot.core.io.phases import readPILOTEvent, picks_from_picksdict, \ picksdict_from_pilot, merge_picks from pylot.core.util.errors import FormatError, OverwriteError -from pylot.core.util.utils import fnConstructor, getGlobalTimes +from pylot.core.util.utils import fnConstructor, full_range class Data(object): @@ -133,7 +133,7 @@ class Data(object): """ - self.cuttimes = getGlobalTimes(self.getWFData()) + self.cuttimes = full_range(self.getWFData()) def getEventFileName(self): """ diff --git a/pylot/core/io/phases.py b/pylot/core/io/phases.py index bd255b34..d3064f6f 100644 --- a/pylot/core/io/phases.py +++ b/pylot/core/io/phases.py @@ -12,7 +12,7 @@ from pylot.core.io.inputs import AutoPickParameter from pylot.core.io.location import create_arrival, create_event, \ create_magnitude, create_origin, create_pick from pylot.core.pick.utils import select_for_phase -from pylot.core.util.utils import getOwner, getGlobalTimes, four_digits +from pylot.core.util.utils import getOwner, full_range, four_digits def readPILOTEvent(phasfn=None, locfn=None, authority_id='RUB', **kwargs): @@ -325,7 +325,7 @@ def reassess_pilot_event(root_dir, db_dir, event_id, out_dir=None, fn_param=None msg = 'no waveform data found for station {station}'.format(station=station) warnings.warn(msg, RuntimeWarning) continue - stime, etime = getGlobalTimes(sel_st) + stime, etime = full_range(sel_st) rel_pick = mpp - stime epp, lpp, spe = earllatepicker(sel_st, default.get('nfac{0}'.format(phase)), diff --git a/pylot/core/util/utils.py b/pylot/core/util/utils.py index 225b276e..db9a3888 100644 --- a/pylot/core/util/utils.py +++ b/pylot/core/util/utils.py @@ -205,7 +205,7 @@ def four_digits(year): return year -def getGlobalTimes(stream): +def full_range(stream): ''' takes a stream object and returns the latest end and the earliest start time of all contained trace objects diff --git a/pylot/core/util/widgets.py b/pylot/core/util/widgets.py index 0139e457..4d3e3d16 100644 --- a/pylot/core/util/widgets.py +++ b/pylot/core/util/widgets.py @@ -32,7 +32,7 @@ from pylot.core.pick.utils import getSNR, earllatepicker, getnoisewin, \ from pylot.core.pick.compare import Comparison from pylot.core.util.defaults import OUTPUTFORMATS, FILTERDEFAULTS, LOCTOOLS, \ COMPPOSITION_MAP -from pylot.core.util.utils import prepTimeAxis, getGlobalTimes, scaleWFData, \ +from pylot.core.util.utils import prepTimeAxis, full_range, scaleWFData, \ demeanTrace, isSorted, findComboBoxIndex, clims @@ -425,7 +425,7 @@ class WaveformWidget(FigureCanvas): noiselevel=None, scaleddata=False, mapping=True): self.getAxes().cla() self.clearPlotDict() - wfstart, wfend = getGlobalTimes(wfdata) + wfstart, wfend = full_range(wfdata) nmax = 0 for n, trace in enumerate(wfdata): channel = trace.stats.channel @@ -539,7 +539,7 @@ class PickDlg(QDialog): else: self.data = data - self.stime, self.etime = getGlobalTimes(self.getWFData()) + self.stime, self.etime = full_range(self.getWFData()) # initialize plotting widget self.multicompfig = WaveformWidget(self)