[rename] AutoPickPara ---> PylotPara

This commit is contained in:
Marcel Paffrath 2017-06-22 11:18:55 +02:00
parent f91e1cde6f
commit 8e8b3e0462
8 changed files with 26 additions and 26 deletions

View File

@ -57,7 +57,7 @@ from matplotlib.figure import Figure
from pylot.core.analysis.magnitude import LocalMagnitude, MomentMagnitude
from pylot.core.io.data import Data
from pylot.core.io.inputs import FilterOptions, AutoPickParameter
from pylot.core.io.inputs import FilterOptions, PylotParameter
from autoPyLoT import autoPyLoT
from pylot.core.pick.compare import Comparison
from pylot.core.pick.utils import symmetrize_error
@ -73,7 +73,7 @@ from pylot.core.util.utils import fnConstructor, getLogin, \
from pylot.core.io.location import create_creation_info, create_event
from pylot.core.util.widgets import FilterOptionsDialog, NewEventDlg, \
WaveformWidget, WaveformWidgetPG, PropertiesDlg, HelpForm, createAction, PickDlg, \
getDataType, ComparisonDialog, TuneAutopicker, AutoPickParaBox
getDataType, ComparisonDialog, TuneAutopicker, PylotParaBox
from pylot.core.util.map_projection import map_projection
from pylot.core.util.structure import DATASTRUCTURE
from pylot.core.util.thread import AutoPickThread, Thread
@ -103,7 +103,7 @@ class MainWindow(QMainWindow):
self.infile = infile[0]
else:
self.infile = infile
self._inputs = AutoPickParameter(infile)
self._inputs = PylotParameter(infile)
self._props = None
self.dirty = False
@ -2331,7 +2331,7 @@ class MainWindow(QMainWindow):
def setParameter(self, show=True):
if not self.paraBox:
self.paraBox = AutoPickParaBox(self._inputs)
self.paraBox = PylotParaBox(self._inputs)
self.paraBox._apply.clicked.connect(self._setDirty)
self.paraBox._okay.clicked.connect(self._setDirty)
if show:

View File

@ -18,7 +18,7 @@ import pylot.core.loc.nll as nll
#from PySide.QtGui import QWidget, QInputDialog
from pylot.core.analysis.magnitude import MomentMagnitude, LocalMagnitude
from pylot.core.io.data import Data
from pylot.core.io.inputs import AutoPickParameter
from pylot.core.io.inputs import PylotParameter
from pylot.core.pick.autopick import autopickevent, iteratepicker
from pylot.core.util.dataprocessing import restitute_data, read_metadata, \
remove_underscores
@ -35,7 +35,7 @@ def autoPyLoT(input_dict=None, parameter=None, inputfile=None, fnames=None, even
:param inputfile: path to the input file containing all parameter
information for automatic picking (for formatting details, see.
`~pylot.core.io.inputs.AutoPickParameter`
`~pylot.core.io.inputs.PylotParameter`
:type inputfile: str
:return:
@ -71,13 +71,13 @@ def autoPyLoT(input_dict=None, parameter=None, inputfile=None, fnames=None, even
if not parameter:
if inputfile:
parameter = AutoPickParameter(inputfile)
parameter = PylotParameter(inputfile)
iplot = parameter['iplot']
else:
print('No parameters set and no input file given. Choose either of both.')
return
else:
if not type(parameter) == AutoPickParameter:
if not type(parameter) == PylotParameter:
print('Wrong input type for parameter: {}'.format(type(parameter)))
return
if inputfile:

View File

@ -1 +1 @@
2039-dirty
f91e1-dirty

View File

@ -4,9 +4,9 @@
from pylot.core.util.errors import ParameterError
import default_parameters
class AutoPickParameter(object):
class PylotParameter(object):
'''
AutoPickParameters is a parameter type object capable to read and/or write
PylotParameter is a parameter type object capable to read and/or write
parameter ASCII.
:param fn str: Filename of the input file
@ -78,7 +78,7 @@ class AutoPickParameter(object):
# String representation of the object
def __repr__(self):
return "AutoPickParameter('%s')" % self.__filename
return "PylotParameter('%s')" % self.__filename
# Boolean test
def __nonzero__(self):

View File

@ -8,7 +8,7 @@ import scipy.io as sio
import warnings
from obspy.core import UTCDateTime
from pylot.core.io.inputs import AutoPickParameter
from pylot.core.io.inputs import PylotParameter
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
@ -116,7 +116,7 @@ def picksdict_from_pilot(fn):
picks = dict()
phases_pilot = sio.loadmat(fn)
stations = stations_from_pilot(phases_pilot['stat'])
params = AutoPickParameter(TIMEERROR_DEFAULTS)
params = PylotParameter(TIMEERROR_DEFAULTS)
timeerrors = dict(P=params.get('timeerrorsP'),
S=params.get('timeerrorsS'))
for n, station in enumerate(stations):
@ -295,14 +295,14 @@ def reassess_pilot_db(root_dir, db_dir, out_dir=None, fn_param=None, verbosity=0
def reassess_pilot_event(root_dir, db_dir, event_id, out_dir=None, fn_param=None, verbosity=0):
from obspy import read
from pylot.core.io.inputs import AutoPickParameter
from pylot.core.io.inputs import PylotParameter
from pylot.core.pick.utils import earllatepicker
if fn_param is None:
import pylot.core.util.defaults as defaults
fn_param = defaults.AUTOMATIC_DEFAULTS
default = AutoPickParameter(fn_param, verbosity)
default = PylotParameter(fn_param, verbosity)
search_base = os.path.join(root_dir, db_dir, event_id)
phases_file = glob.glob(os.path.join(search_base, 'PHASES.mat'))

View File

@ -11,7 +11,7 @@ function conglomerate utils.
import matplotlib.pyplot as plt
import numpy as np
from pylot.core.io.inputs import AutoPickParameter
from pylot.core.io.inputs import PylotParameter
from pylot.core.pick.picker import AICPicker, PragPicker
from pylot.core.pick.charfuns import CharacteristicFunction
from pylot.core.pick.charfuns import HOScf, AICcf, ARZcf, ARHcf, AR3Ccf
@ -81,7 +81,7 @@ def autopickstation(wfstream, pickparam, verbose=False, iplot=0, fig_dict=None):
:param pickparam: container of picking parameters from input file,
usually autoPyLoT.in
:type pickparam: AutoPickParameter
:type pickparam: PylotParameter
:param verbose:
:type verbose: bool

View File

@ -10,7 +10,7 @@ import re
import warnings
import subprocess
from obspy import UTCDateTime, read
from pylot.core.io.inputs import AutoPickParameter
from pylot.core.io.inputs import PylotParameter
def _pickle_method(m):
@ -497,7 +497,7 @@ def which(program, infile=None):
bpath = os.path.join(os.path.expanduser('~'), '.pylot', infile)
if os.path.exists(bpath):
nllocpath = ":" + AutoPickParameter(bpath).get('nllocbin')
nllocpath = ":" + PylotParameter(bpath).get('nllocbin')
os.environ['PATH'] += nllocpath
except ImportError as e:
print(e.message)

View File

@ -36,7 +36,7 @@ from PySide.QtCore import QSettings, Qt, QUrl, Signal, Slot
from PySide.QtWebKit import QWebView
from obspy import Stream, UTCDateTime
from pylot.core.io.data import Data
from pylot.core.io.inputs import FilterOptions, AutoPickParameter
from pylot.core.io.inputs import FilterOptions, PylotParameter
from pylot.core.pick.utils import getSNR, earllatepicker, getnoisewin, \
getResolutionWindow
from pylot.core.pick.compare import Comparison
@ -1662,7 +1662,7 @@ class TuneAutopicker(QWidget):
self.stb_names = ['aicARHfig', 'refSpick', 'el_S1pick', 'el_S2pick']
def add_parameters(self):
self.paraBox = AutoPickParaBox(self.parameter)
self.paraBox = PylotParaBox(self.parameter)
self.paraBox.set_tune_mode(True)
self.update_eventID()
self.parameter_layout.addWidget(self.paraBox)
@ -1968,13 +1968,13 @@ class TuneAutopicker(QWidget):
self.qmb.show()
class AutoPickParaBox(QtGui.QWidget):
class PylotParaBox(QtGui.QWidget):
def __init__(self, parameter, parent=None):
'''
Generate Widget containing parameters for automatic picking algorithm.
:param: parameter
:type: AutoPickParameter (object)
:type: PylotParameter (object)
'''
QtGui.QWidget.__init__(self, parent)
@ -2521,7 +2521,7 @@ class InputsTab(PropTab):
return values
def resetValues(self, infile):
para = AutoPickParameter(infile)
para = PylotParameter(infile)
datstruct = para.get('datastructure')
if datstruct == 'SeisComp':
index = 0
@ -2777,7 +2777,7 @@ class LocalisationTab(PropTab):
return values
def resetValues(self, infile):
para = AutoPickParameter(infile)
para = PylotParameter(infile)
nllocroot = para.get('nllocroot')
nllocbin = para.get('nllocbin')
loctool = self.locToolComboBox.setCurrentIndex(3)