[add] namestrings for default parameters, filteroptions connected to parameters (WIP)

[change] layout of pylotparabox
This commit is contained in:
Marcel Paffrath 2017-07-04 14:39:10 +02:00
parent 1b3c29c47e
commit 097222a43d
4 changed files with 202 additions and 98 deletions

View File

@ -1569,6 +1569,17 @@ class MainWindow(QMainWindow):
self.project.filteroptions[self.getSeismicPhase()] = filterOptions self.project.filteroptions[self.getSeismicPhase()] = filterOptions
else: else:
self.project.filteroptions[seismicPhase] = filterOptions self.project.filteroptions[seismicPhase] = filterOptions
self._inputs.setParamKV('minfreq', float(filterOptions.getFreq()[0]))
self._inputs.setParamKV('maxfreq', float(filterOptions.getFreq()[1]))
self._inputs.setParamKV('filter_order', int(filterOptions.getOrder()))
self._inputs.setParamKV('filter_type', str(filterOptions.getFilterType()))
def filterOptionsFromParameter(self):
if not self.project:
return
self.project.filteroptions.setFreq([self._inputs['minfreq'], self._inputs['axfreq']])
self.project.filteroptions.setOrder(self._inputs['filter_order'])
self.project.filteroptions.setFilterType(self._inputs['filter_type'])
def updateFilterOptions(self): def updateFilterOptions(self):
try: try:
@ -2394,6 +2405,9 @@ class MainWindow(QMainWindow):
if hasattr(self.project, 'parameter'): if hasattr(self.project, 'parameter'):
if self.project.parameter: if self.project.parameter:
self._inputs = self.project.parameter self._inputs = self.project.parameter
if not hasattr(self.project, 'filteroptions'):
self.project.filteroptions = {'P': FilterOptions(),
'S': FilterOptions()}
self.tabs.setCurrentIndex(0) # implemented to prevent double-loading of waveform data self.tabs.setCurrentIndex(0) # implemented to prevent double-loading of waveform data
self.init_events(new=True) self.init_events(new=True)
self.setDirty(False) self.setDirty(False)
@ -2473,6 +2487,8 @@ class MainWindow(QMainWindow):
self.paraBox = PylotParaBox(self._inputs) self.paraBox = PylotParaBox(self._inputs)
self.paraBox._apply.clicked.connect(self._setDirty) self.paraBox._apply.clicked.connect(self._setDirty)
self.paraBox._okay.clicked.connect(self._setDirty) self.paraBox._okay.clicked.connect(self._setDirty)
self.paraBox._apply.clicked.connect(self.filterOptionsFromParameter)
self.paraBox._okay.clicked.connect(self.filterOptionsFromParameter)
if show: if show:
self.paraBox.show() self.paraBox.show()

View File

@ -3,305 +3,380 @@
defaults = {'rootpath': {'type': str, defaults = {'rootpath': {'type': str,
'tooltip': 'project path', 'tooltip': 'project path',
'value': ''}, 'value': '',
'namestring': 'Root path'},
'datapath': {'type': str, 'datapath': {'type': str,
'tooltip': 'data path', 'tooltip': 'data path',
'value': ''}, 'value': '',
'namestring': 'Data path'},
'database': {'type': str, 'database': {'type': str,
'tooltip': 'name of data base', 'tooltip': 'name of data base',
'value': ''}, 'value': '',
'namestring': 'Database path'},
'eventID': {'type': str, 'eventID': {'type': str,
'tooltip': 'event ID for single event processing (* for all events found in database)', 'tooltip': 'event ID for single event processing (* for all events found in database)',
'value': ''}, 'value': '',
'namestring': 'Event ID'},
'extent': {'type': str, 'extent': {'type': str,
'tooltip': 'extent of array ("local", "regional" or "global")', 'tooltip': 'extent of array ("local", "regional" or "global")',
'value': 'local'}, 'value': 'local',
'namestring': 'Array extent'},
'invdir': {'type': str, 'invdir': {'type': str,
'tooltip': 'full path to inventory or dataless-seed file', 'tooltip': 'full path to inventory or dataless-seed file',
'value': ''}, 'value': '',
'namestring': 'Inversion dir'},
'datastructure': {'type': str, 'datastructure': {'type': str,
'tooltip': 'choose data structure', 'tooltip': 'choose data structure',
'value': 'PILOT'}, 'value': 'PILOT',
'namestring': 'Datastructure'},
'apverbose': {'type': bool, 'apverbose': {'type': bool,
'tooltip': "choose 'True' or 'False' for terminal output", 'tooltip': "choose 'True' or 'False' for terminal output",
'value': True}, 'value': True,
'namestring': 'App. verbosity'},
'nllocbin': {'type': str, 'nllocbin': {'type': str,
'tooltip': 'path to NLLoc executable', 'tooltip': 'path to NLLoc executable',
'value': ''}, 'value': '',
'namestring': 'NLLoc bin path'},
'nllocroot': {'type': str, 'nllocroot': {'type': str,
'tooltip': 'root of NLLoc-processing directory', 'tooltip': 'root of NLLoc-processing directory',
'value': ''}, 'value': '',
'namestring': 'NLLoc root path'},
'phasefile': {'type': str, 'phasefile': {'type': str,
'tooltip': 'name of autoPyLoT-output phase file for NLLoc', 'tooltip': 'name of autoPyLoT-output phase file for NLLoc',
'value': 'AUTOPHASES.obs'}, 'value': 'AUTOPHASES.obs',
'namestring': 'Phase filename'},
'ctrfile': {'type': str, 'ctrfile': {'type': str,
'tooltip': 'name of autoPyLoT-output control file for NLLoc', 'tooltip': 'name of autoPyLoT-output control file for NLLoc',
'value': 'Insheim_min1d2015_auto.in'}, 'value': 'Insheim_min1d2015_auto.in',
'namestring': 'Control filename'},
'ttpatter': {'type': str, 'ttpatter': {'type': str,
'tooltip': 'pattern of NLLoc ttimes from grid', 'tooltip': 'pattern of NLLoc ttimes from grid',
'value': 'ttime'}, 'value': 'ttime',
'namestring': 'Traveltime pattern'},
'outpatter': {'type': str, 'outpatter': {'type': str,
'tooltip': 'pattern of NLLoc-output file', 'tooltip': 'pattern of NLLoc-output file',
'value': 'AUTOLOC_nlloc'}, 'value': 'AUTOLOC_nlloc',
'namestring': 'NLLoc output pattern'},
'vp': {'type': float, 'vp': {'type': float,
'tooltip': 'average P-wave velocity', 'tooltip': 'average P-wave velocity',
'value': 3530.}, 'value': 3530.,
'namestring': 'P-velocity'},
'rho': {'type': float, 'rho': {'type': float,
'tooltip': 'average rock density [kg/m^3]', 'tooltip': 'average rock density [kg/m^3]',
'value': 2500.}, 'value': 2500.,
'namestring': 'Density'},
'Qp': {'type': (float, float), 'Qp': {'type': (float, float),
'tooltip': 'quality factor for P waves (Qp*f^a); list(Qp, a)', 'tooltip': 'quality factor for P waves (Qp*f^a); list(Qp, a)',
'value': (300., 0.8)}, 'value': (300., 0.8),
'namestring': ('Quality factor', 'Qp1', 'Qp2')},
'pstart': {'type': float, 'pstart': {'type': float,
'tooltip': 'start time [s] for calculating CF for P-picking', 'tooltip': 'start time [s] for calculating CF for P-picking',
'value': 15.0}, 'value': 15.0,
'namestring': 'P start'},
'pstop': {'type': float, 'pstop': {'type': float,
'tooltip': 'end time [s] for calculating CF for P-picking', 'tooltip': 'end time [s] for calculating CF for P-picking',
'value': 60.0}, 'value': 60.0,
'namestring': 'P stop'},
'sstart': {'type': float, 'sstart': {'type': float,
'tooltip': 'start time [s] relative to P-onset for calculating CF for S-picking', 'tooltip': 'start time [s] relative to P-onset for calculating CF for S-picking',
'value': -1.0}, 'value': -1.0,
'namestring': 'S start'},
'sstop': {'type': float, 'sstop': {'type': float,
'tooltip': 'end time [s] after P-onset for calculating CF for S-picking', 'tooltip': 'end time [s] after P-onset for calculating CF for S-picking',
'value': 10.0}, 'value': 10.0,
'namestring': 'S stop'},
'bpz1': {'type': (float, float), 'bpz1': {'type': (float, float),
'tooltip': 'lower/upper corner freq. of first band pass filter Z-comp. [Hz]', 'tooltip': 'lower/upper corner freq. of first band pass filter Z-comp. [Hz]',
'value': (2, 20)}, 'value': (2, 20),
'namestring': ('Z-bandpass 1', 'Lower', 'Upper')},
'bpz2': {'type': (float, float), 'bpz2': {'type': (float, float),
'tooltip': 'lower/upper corner freq. of second band pass filter Z-comp. [Hz]', 'tooltip': 'lower/upper corner freq. of second band pass filter Z-comp. [Hz]',
'value': (2, 30)}, 'value': (2, 30),
'namestring': ('Z-bandpass 2', '', '')},
'bph1': {'type': (float, float), 'bph1': {'type': (float, float),
'tooltip': 'lower/upper corner freq. of first band pass filter H-comp. [Hz]', 'tooltip': 'lower/upper corner freq. of first band pass filter H-comp. [Hz]',
'value': (2, 15)}, 'value': (2, 15),
'namestring': ('H-bandpass 1', 'Lower', 'Upper')},
'bph2': {'type': (float, float), 'bph2': {'type': (float, float),
'tooltip': 'lower/upper corner freq. of second band pass filter z-comp. [Hz]', 'tooltip': 'lower/upper corner freq. of second band pass filter z-comp. [Hz]',
'value': (2, 20)}, 'value': (2, 20),
'namestring': ('H-bandpass 2', '', '')},
'algoP': {'type': str, 'algoP': {'type': str,
'tooltip': 'choose algorithm for P-onset determination (HOS, ARZ, or AR3)', 'tooltip': 'choose algorithm for P-onset determination (HOS, ARZ, or AR3)',
'value': 'HOS'}, 'value': 'HOS',
'namestring': 'P algorithm'},
'tlta': {'type': float, 'tlta': {'type': float,
'tooltip': 'for HOS-/AR-AIC-picker, length of LTA window [s]', 'tooltip': 'for HOS-/AR-AIC-picker, length of LTA window [s]',
'value': 7.0}, 'value': 7.0,
'namestring': 'LTA window'},
'hosorder': {'type': int, 'hosorder': {'type': int,
'tooltip': 'for HOS-picker, order of Higher Order Statistics', 'tooltip': 'for HOS-picker, order of Higher Order Statistics',
'value': 4}, 'value': 4,
'namestring': 'HOS order'},
'Parorder': {'type': int, 'Parorder': {'type': int,
'tooltip': 'for AR-picker, order of AR process of Z-component', 'tooltip': 'for AR-picker, order of AR process of Z-component',
'value': 2}, 'value': 2,
'namestring': 'AR order P'},
'tdet1z': {'type': float, 'tdet1z': {'type': float,
'tooltip': 'for AR-picker, length of AR determination window [s] for Z-component, 1st pick', 'tooltip': 'for AR-picker, length of AR determination window [s] for Z-component, 1st pick',
'value': 1.2}, 'value': 1.2,
'namestring': 'AR det. window Z 1'},
'tpred1z': {'type': float, 'tpred1z': {'type': float,
'tooltip': 'for AR-picker, length of AR prediction window [s] for Z-component, 1st pick', 'tooltip': 'for AR-picker, length of AR prediction window [s] for Z-component, 1st pick',
'value': 0.4}, 'value': 0.4,
'namestring': 'AR pred. window Z 1'},
'tdet2z': {'type': float, 'tdet2z': {'type': float,
'tooltip': 'for AR-picker, length of AR determination window [s] for Z-component, 2nd pick', 'tooltip': 'for AR-picker, length of AR determination window [s] for Z-component, 2nd pick',
'value': 0.6}, 'value': 0.6,
'namestring': 'AR det. window Z 2'},
'tpred2z': {'type': float, 'tpred2z': {'type': float,
'tooltip': 'for AR-picker, length of AR prediction window [s] for Z-component, 2nd pick', 'tooltip': 'for AR-picker, length of AR prediction window [s] for Z-component, 2nd pick',
'value': 0.2}, 'value': 0.2,
'namestring': 'AR pred. window Z 2'},
'addnoise': {'type': float, 'addnoise': {'type': float,
'tooltip': 'add noise to seismogram for stable AR prediction', 'tooltip': 'add noise to seismogram for stable AR prediction',
'value': 0.001}, 'value': 0.001,
'namestring': 'Add noise'},
'tsnrz': {'type': (float, float, float, float), 'tsnrz': {'type': (float, float, float, float),
'tooltip': 'for HOS/AR, window lengths for SNR-and slope estimation [tnoise, tsafetey, tsignal, tslope] [s]', 'tooltip': 'for HOS/AR, window lengths for SNR-and slope estimation [tnoise, tsafetey, tsignal, tslope] [s]',
'value': (3, 0.1, 0.5, 1.0)}, 'value': (3, 0.1, 0.5, 1.0),
'namestring': ('SNR windows P', 'Noise', 'Safety', 'Signal', 'Slope')},
'pickwinP': {'type': float, 'pickwinP': {'type': float,
'tooltip': 'for initial AIC pick, length of P-pick window [s]', 'tooltip': 'for initial AIC pick, length of P-pick window [s]',
'value': 3.0}, 'value': 3.0,
'namestring': 'AIC window P'},
'Precalcwin': {'type': float, 'Precalcwin': {'type': float,
'tooltip': 'for HOS/AR, window length [s] for recalculation of CF (relative to 1st pick)', 'tooltip': 'for HOS/AR, window length [s] for recalculation of CF (relative to 1st pick)',
'value': 6.0}, 'value': 6.0,
'namestring': 'Recal. window P'},
'aictsmooth': {'type': float, 'aictsmooth': {'type': float,
'tooltip': 'for HOS/AR, take average of samples for smoothing of AIC-function [s]', 'tooltip': 'for HOS/AR, take average of samples for smoothing of AIC-function [s]',
'value': 0.2}, 'value': 0.2,
'namestring': 'AIC smooth P'},
'tsmoothP': {'type': float, 'tsmoothP': {'type': float,
'tooltip': 'for HOS/AR, take average of samples for smoothing CF [s]', 'tooltip': 'for HOS/AR, take average of samples for smoothing CF [s]',
'value': 0.1}, 'value': 0.1,
'namestring': 'CF smooth P'},
'ausP': {'type': float, 'ausP': {'type': float,
'tooltip': 'for HOS/AR, artificial uplift of samples (aus) of CF (P)', 'tooltip': 'for HOS/AR, artificial uplift of samples (aus) of CF (P)',
'value': 0.001}, 'value': 0.001,
'namestring': 'Artificial uplift P'},
'nfacP': {'type': float, 'nfacP': {'type': float,
'tooltip': 'for HOS/AR, noise factor for noise level determination (P)', 'tooltip': 'for HOS/AR, noise factor for noise level determination (P)',
'value': 1.3}, 'value': 1.3,
'namestring': 'Noise factor P'},
'algoS': {'type': str, 'algoS': {'type': str,
'tooltip': 'choose algorithm for S-onset determination (ARH or AR3)', 'tooltip': 'choose algorithm for S-onset determination (ARH or AR3)',
'value': 'ARH'}, 'value': 'ARH',
'namestring': 'S algorithm'},
'tdet1h': {'type': float, 'tdet1h': {'type': float,
'tooltip': 'for HOS/AR, length of AR-determination window [s], H-components, 1st pick', 'tooltip': 'for HOS/AR, length of AR-determination window [s], H-components, 1st pick',
'value': 0.8}, 'value': 0.8,
'namestring': 'AR det. window H 1'},
'tpred1h': {'type': float, 'tpred1h': {'type': float,
'tooltip': 'for HOS/AR, length of AR-prediction window [s], H-components, 1st pick', 'tooltip': 'for HOS/AR, length of AR-prediction window [s], H-components, 1st pick',
'value': 0.4}, 'value': 0.4,
'namestring': 'AR pred. window H 1'},
'tdet2h': {'type': float, 'tdet2h': {'type': float,
'tooltip': 'for HOS/AR, length of AR-determinaton window [s], H-components, 2nd pick', 'tooltip': 'for HOS/AR, length of AR-determinaton window [s], H-components, 2nd pick',
'value': 0.6}, 'value': 0.6,
'namestring': 'AR det. window H 2'},
'tpred2h': {'type': float, 'tpred2h': {'type': float,
'tooltip': 'for HOS/AR, length of AR-prediction window [s], H-components, 2nd pick', 'tooltip': 'for HOS/AR, length of AR-prediction window [s], H-components, 2nd pick',
'value': 0.3}, 'value': 0.3,
'namestring': 'AR pred. window H 2'},
'Sarorder': {'type': int, 'Sarorder': {'type': int,
'tooltip': 'for AR-picker, order of AR process of H-components', 'tooltip': 'for AR-picker, order of AR process of H-components',
'value': 4}, 'value': 4,
'namestring': 'AR order S'},
'Srecalcwin': {'type': float, 'Srecalcwin': {'type': float,
'tooltip': 'for AR-picker, window length [s] for recalculation of CF (2nd pick) (H)', 'tooltip': 'for AR-picker, window length [s] for recalculation of CF (2nd pick) (H)',
'value': 5.0}, 'value': 5.0,
'namestring': 'Recal. window S'},
'pickwinS': {'type': float, 'pickwinS': {'type': float,
'tooltip': 'for initial AIC pick, length of S-pick window [s]', 'tooltip': 'for initial AIC pick, length of S-pick window [s]',
'value': 3.0}, 'value': 3.0,
'namestring': 'AIC window S'},
'tsnrh': {'type': (float, float, float, float), 'tsnrh': {'type': (float, float, float, float),
'tooltip': 'for ARH/AR3, window lengths for SNR-and slope estimation [tnoise, tsafetey, tsignal, tslope] [s]', 'tooltip': 'for ARH/AR3, window lengths for SNR-and slope estimation [tnoise, tsafetey, tsignal, tslope] [s]',
'value': (2, 0.2, 1.5, 0.5)}, 'value': (2, 0.2, 1.5, 0.5),
'namestring': ('SNR windows S', 'Noise', 'Safety', 'Signal', 'Slope')},
'aictsmoothS': {'type': float, 'aictsmoothS': {'type': float,
'tooltip': 'for AIC-picker, take average of samples for smoothing of AIC-function [s]', 'tooltip': 'for AIC-picker, take average of samples for smoothing of AIC-function [s]',
'value': 0.5}, 'value': 0.5,
'namestring': 'AIC smooth S'},
'tsmoothS': {'type': float, 'tsmoothS': {'type': float,
'tooltip': 'for AR-picker, take average of samples for smoothing CF [s] (S)', 'tooltip': 'for AR-picker, take average of samples for smoothing CF [s] (S)',
'value': 0.7}, 'value': 0.7,
'namestring': 'CF smooth S'},
'ausS': {'type': float, 'ausS': {'type': float,
'tooltip': 'for HOS/AR, artificial uplift of samples (aus) of CF (S)', 'tooltip': 'for HOS/AR, artificial uplift of samples (aus) of CF (S)',
'value': 0.9}, 'value': 0.9,
'namestring': 'Artificial uplift S'},
'nfacS': {'type': float, 'nfacS': {'type': float,
'tooltip': 'for AR-picker, noise factor for noise level determination (S)', 'tooltip': 'for AR-picker, noise factor for noise level determination (S)',
'value': 1.5}, 'value': 1.5,
'namestring': 'Noise factor S'},
'minfmweight': {'type': int, 'minfmweight': {'type': int,
'tooltip': 'minimum required P weight for first-motion determination', 'tooltip': 'minimum required P weight for first-motion determination',
'value': 1}, 'value': 1,
'namestring': 'Min. P weight'},
'minFMSNR': {'type': float, 'minFMSNR': {'type': float,
'tooltip': 'miniumum required SNR for first-motion determination', 'tooltip': 'miniumum required SNR for first-motion determination',
'value': 2.}, 'value': 2.,
'namestring': 'Min SNR'},
'fmpickwin': {'type': float, 'fmpickwin': {'type': float,
'tooltip': 'pick window around P onset for calculating zero crossings', 'tooltip': 'pick window around P onset for calculating zero crossings',
'value': 0.2}, 'value': 0.2,
'namestring': 'Zero crossings window'},
'timeerrorsP': {'type': (float, float, float, float), 'timeerrorsP': {'type': (float, float, float, float),
'tooltip': 'discrete time errors [s] corresponding to picking weights [0 1 2 3] for P', 'tooltip': 'discrete time errors [s] corresponding to picking weights [0 1 2 3] for P',
'value': (0.01, 0.02, 0.04, 0.08)}, 'value': (0.01, 0.02, 0.04, 0.08),
'namestring': ('Time errors P', '0', '1', '2', '3')},
'timeerrorsS': {'type': (float, float, float, float), 'timeerrorsS': {'type': (float, float, float, float),
'tooltip': 'discrete time errors [s] corresponding to picking weights [0 1 2 3] for S', 'tooltip': 'discrete time errors [s] corresponding to picking weights [0 1 2 3] for S',
'value': (0.04, 0.08, 0.16, 0.32)}, 'value': (0.04, 0.08, 0.16, 0.32),
'namestring': ('Time errors S', '0', '1', '2', '3')},
'minAICPslope': {'type': float, 'minAICPslope': {'type': float,
'tooltip': 'below this slope [counts/s] the initial P pick is rejected', 'tooltip': 'below this slope [counts/s] the initial P pick is rejected',
'value': 0.8}, 'value': 0.8,
'namestring': 'Min. slope P'},
'minAICPSNR': {'type': float, 'minAICPSNR': {'type': float,
'tooltip': 'below this SNR the initial P pick is rejected', 'tooltip': 'below this SNR the initial P pick is rejected',
'value': 1.1}, 'value': 1.1,
'namestring': 'Min. SNR P'},
'minAICSslope': {'type': float, 'minAICSslope': {'type': float,
'tooltip': 'below this slope [counts/s] the initial S pick is rejected', 'tooltip': 'below this slope [counts/s] the initial S pick is rejected',
'value': 1.}, 'value': 1.,
'namestring': 'Min. slope S'},
'minAICSSNR': {'type': float, 'minAICSSNR': {'type': float,
'tooltip': 'below this SNR the initial S pick is rejected', 'tooltip': 'below this SNR the initial S pick is rejected',
'value': 1.5}, 'value': 1.5,
'namestring': 'Min. SNR S'},
'minsiglength': {'type': float, 'minsiglength': {'type': float,
'tooltip': 'length of signal part for which amplitudes must exceed noiselevel [s]', 'tooltip': 'length of signal part for which amplitudes must exceed noiselevel [s]',
'value': 1.}, 'value': 1.,
'namestring': 'Min. signal length'},
'noisefactor': {'type': float, 'noisefactor': {'type': float,
'tooltip': 'noiselevel*noisefactor=threshold', 'tooltip': 'noiselevel*noisefactor=threshold',
'value': 1.0}, 'value': 1.0,
'namestring': 'Noise factor'},
'minpercent': {'type': float, 'minpercent': {'type': float,
'tooltip': 'required percentage of amplitudes exceeding threshold', 'tooltip': 'required percentage of amplitudes exceeding threshold',
'value': 10.}, 'value': 10.,
'namestring': 'Min amplitude [%]'},
'zfac': {'type': float, 'zfac': {'type': float,
'tooltip': 'P-amplitude must exceed at least zfac times RMS-S amplitude', 'tooltip': 'P-amplitude must exceed at least zfac times RMS-S amplitude',
'value': 1.5}, 'value': 1.5,
'namestring': 'Z factor'},
'mdttolerance': {'type': float, 'mdttolerance': {'type': float,
'tooltip': 'maximum allowed deviation of P picks from median [s]', 'tooltip': 'maximum allowed deviation of P picks from median [s]',
'value': 6.0}, 'value': 6.0,
'namestring': 'Median tolerance'},
'wdttolerance': {'type': float, 'wdttolerance': {'type': float,
'tooltip': 'maximum allowed deviation from Wadati-diagram', 'tooltip': 'maximum allowed deviation from Wadati-diagram',
'value': 1.0}, 'value': 1.0,
'namestring': 'Wadati tolerance'},
'WAscaling': {'type': (float, float, float), 'WAscaling': {'type': (float, float, float),
'tooltip': 'Scaling relation (log(Ao)+Alog(r)+Br+C) of Wood-Anderson amplitude Ao [nm] \ 'tooltip': 'Scaling relation (log(Ao)+Alog(r)+Br+C) of Wood-Anderson amplitude Ao [nm] \
If zeros are set, original Richter magnitude is calculated!', If zeros are set, original Richter magnitude is calculated!',
'value': (0., 0., 0.)}, 'value': (0., 0., 0.),
'namestring': ('Wood-Anderson scaling', '', '', '')},
'magscaling': {'type': (float, float), 'magscaling': {'type': (float, float),
'tooltip': 'Scaling relation for derived local magnitude [a*Ml+b]. \ 'tooltip': 'Scaling relation for derived local magnitude [a*Ml+b]. \
If zeros are set, no scaling of network magnitude is applied!', If zeros are set, no scaling of network magnitude is applied!',
'value': (0., 0.)}, 'value': (0., 0.),
'namestring': ('Local mag. scaling', '', '')},
'minfreq': {'type': float, 'minfreq': {'type': (float, float),
'tooltip': 'Lower filter frequency', 'tooltip': 'Lower filter frequency [P, S]',
'value': 1.0}, 'value': (1.0, 1.0),
'namestring': ('Lower freq.', 'P', 'S')},
'maxfreq': {'type': float, 'maxfreq': {'type': (float, float),
'tooltip': 'Upper filter frequency', 'tooltip': 'Upper filter frequency [P, S]',
'value': 10.0}, 'value': (10.0, 10.0),
'namestring': ('Upper freq.', '', '')},
'filter_order': {'type': int, 'filter_order': {'type': (int, int),
'tooltip': 'filter order', 'tooltip': 'filter order [P, S]',
'value': 2}, 'value': (2, 2),
'namestring': ('Order', '', '')},
'filter_type': {'type': str, 'filter_type': {'type': (str, str),
'tooltip': 'filter type (bandpass, bandstop, lowpass, highpass)', 'tooltip': 'filter type (bandpass, bandstop, lowpass, highpass) [P, S]',
'value': None} 'value': ('bandpass' , 'bandpass'),
'namestring': ('Type', '', '')}
} }
settings_main={ settings_main={

View File

@ -209,7 +209,10 @@ class PylotParameter(object):
vallist = value.strip().split(' ') vallist = value.strip().split(' ')
val = [] val = []
for val0 in vallist: for val0 in vallist:
try:
val0 = float(val0) val0 = float(val0)
except:
pass
val.append(val0) val.append(val0)
else: else:
val = str(value.strip()) val = str(value.strip())

View File

@ -2082,7 +2082,7 @@ class TuneAutopicker(QWidget):
class PylotParaBox(QtGui.QWidget): class PylotParaBox(QtGui.QWidget):
def __init__(self, parameter, parent=None): def __init__(self, parameter, parent=None):
''' '''
Generate Widget containing parameters for automatic picking algorithm. Generate Widget containing parameters for PyLoT.
:param: parameter :param: parameter
:type: PylotParameter (object) :type: PylotParameter (object)
@ -2183,8 +2183,6 @@ class PylotParaBox(QtGui.QWidget):
grid = QtGui.QGridLayout() grid = QtGui.QGridLayout()
for index1, name in enumerate(parameter_names): for index1, name in enumerate(parameter_names):
text = name + ' [?]'
label = QtGui.QLabel(text)
default_item = self.parameter.get_defaults()[name] default_item = self.parameter.get_defaults()[name]
tooltip = default_item['tooltip'] tooltip = default_item['tooltip']
tooltip += ' | type: {}'.format(default_item['type']) tooltip += ' | type: {}'.format(default_item['type'])
@ -2192,14 +2190,19 @@ class PylotParaBox(QtGui.QWidget):
typ = default_item['type'] typ = default_item['type']
box = self.create_box(typ, tooltip) box = self.create_box(typ, tooltip)
self.boxes[name] = box self.boxes[name] = box
namestring = default_item['namestring']
elif type(default_item['type']) == tuple: elif type(default_item['type']) == tuple:
boxes = [] boxes = []
values = self.parameter[name] values = self.parameter[name]
for index2, val in enumerate(values): for index2, val in enumerate(values):
typ = default_item['type'][index2] typ = default_item['type'][index2]
boxes.append(self.create_box(typ, tooltip)) boxes.append(self.create_box(typ, tooltip))
box = self.create_multi_box(boxes) headline = default_item['namestring'][1:]
box, lower = self.create_multi_box(boxes, headline)
self.boxes[name] = boxes self.boxes[name] = boxes
namestring = default_item['namestring'][0]
text = namestring + ' [?]'
label = QtGui.QLabel(text)
self.labels[name] = label self.labels[name] = label
label.setToolTip(tooltip) label.setToolTip(tooltip)
grid.addWidget(label, index1, 1) grid.addWidget(label, index1, 1)
@ -2211,8 +2214,8 @@ class PylotParaBox(QtGui.QWidget):
box = QtGui.QLineEdit() box = QtGui.QLineEdit()
elif typ == float: elif typ == float:
box = QtGui.QDoubleSpinBox() box = QtGui.QDoubleSpinBox()
box.setDecimals(5) box.setDecimals(4)
box.setRange(-10e5, 10e5) box.setRange(-10e4, 10e4)
elif typ == int: elif typ == int:
box = QtGui.QSpinBox() box = QtGui.QSpinBox()
elif typ == bool: elif typ == bool:
@ -2221,13 +2224,20 @@ class PylotParaBox(QtGui.QWidget):
raise TypeError('Unrecognized type {}'.format(typ)) raise TypeError('Unrecognized type {}'.format(typ))
return box return box
def create_multi_box(self, boxes): def create_multi_box(self, boxes, headline=None):
box = QtGui.QWidget() box = QtGui.QWidget()
hl = QtGui.QVBoxLayout() gl = QtGui.QGridLayout()
for b in boxes: row = 0
hl.addWidget(b) if headline:
box.setLayout(hl) for index, item in enumerate(headline):
return box if not item:
continue
gl.addWidget(QtGui.QLabel(item), 0, index, 4)
row = 1
for index, b in enumerate(boxes):
gl.addWidget(b, row, index)
box.setLayout(gl)
return box, row
def add_tab(self, layout, name): def add_tab(self, layout, name):
widget = QtGui.QWidget() widget = QtGui.QWidget()