Merge branch 'tightlayout_tuneauto' into develop

This commit is contained in:
Darius Arnold 2017-09-15 14:12:33 +02:00
commit c8affae0c2
4 changed files with 16 additions and 0 deletions

View File

@ -477,6 +477,7 @@ def autopickstation(wfstream, pickparam, verbose=False,
else:
fig = None
linecolor = 'k'
fig._tight = True
epickP, lpickP, Perror = earllatepicker(z_copy, nfacP, tsnrz,
mpickP, iplot, fig=fig,
linecolor=linecolor)
@ -512,6 +513,7 @@ def autopickstation(wfstream, pickparam, verbose=False,
linecolor = fig_dict['plot_style']['linecolor']['rgba_mpl']
else:
fig = None
fig._tight = True
FM = fmpicker(zdat, z_copy, fmpickwin, mpickP, iplot, fig, linecolor)
else:
FM = fmpicker(zdat, z_copy, fmpickwin, mpickP, iplot)
@ -725,6 +727,7 @@ def autopickstation(wfstream, pickparam, verbose=False,
else:
fig = None
linecolor = 'k'
fig._tight = True
refSpick = PragPicker(arhcf2, tsnrh, pickwinS, iplot, ausS,
tsmoothS, aicarhpick.getpick(), fig, linecolor)
mpickS = refSpick.getpick()
@ -740,6 +743,7 @@ def autopickstation(wfstream, pickparam, verbose=False,
else:
fig = None
linecolor = 'k'
fig._tight = True
epickS1, lpickS1, Serror1 = earllatepicker(h_copy, nfacS,
tsnrh,
mpickS, iplot,
@ -758,6 +762,7 @@ def autopickstation(wfstream, pickparam, verbose=False,
else:
fig = None
linecolor = ''
fig._tight = True
epickS2, lpickS2, Serror2 = earllatepicker(h_copy, nfacS,
tsnrh,
mpickS, iplot,
@ -875,6 +880,7 @@ def autopickstation(wfstream, pickparam, verbose=False,
else:
fig = fig_dict['mainFig']
linecolor = fig_dict['plot_style']['linecolor']['rgba_mpl']
fig._tight = True
ax1 = fig.add_subplot(311)
tdata = np.arange(0, zdat[0].stats.npts / tr_filt.stats.sampling_rate,
tr_filt.stats.delta)

View File

@ -309,6 +309,7 @@ class AICPicker(AutoPicker):
plt_flag = 1
else:
fig = self.fig
fig._tight = True
ax1 = fig.add_subplot(211)
x = self.Data[0].data
if len(self.Tcf) > len(self.Data[0].data): # why? LK
@ -478,6 +479,7 @@ class PragPicker(AutoPicker):
plt_flag = 1
else:
fig = self.fig
fig._tight = True
ax = fig.add_subplot(111)
ax.plot(Tcfpick, cfipick, color=self._linecolor, linewidth=0.7, label='CF')
ax.plot(Tcfpick, cfsmoothipick, 'r', label='Smoothed CF')

View File

@ -795,6 +795,7 @@ def checksignallength(X, pick, TSNR, minsiglength, nfac, minpercent, iplot=0, fi
fig = plt.figure() # iplot)
plt_flag = 1
ax = fig.add_subplot(111)
fig._tight = True
ax.plot(t, rms, color=linecolor, linewidth=0.7, label='RMS Data')
ax.axvspan(t[inoise[0]], t[inoise[-1]], color='y', alpha=0.2, lw=0, label='Noise Window')
ax.axvspan(t[isignal[0]], t[isignal[-1]], color='b', alpha=0.2, lw=0, label='Signal Window')
@ -1119,6 +1120,7 @@ def checkZ4S(X, pick, zfac, checkwin, iplot, fig=None, linecolor='k'):
fig = plt.figure() # self.iplot) ### WHY? MP MP
plt_flag = 1
ax = fig.add_subplot(3, 1, i + 1, sharex=ax1)
fig._tight = True
ax.plot(t, abs(trace.data), color='b', label='abs')
ax.plot(t, trace.data, color=linecolor, linewidth=0.7)
name = str(trace.stats.channel) + ': {}'.format(rms)

View File

@ -2469,6 +2469,12 @@ class TuneAutopicker(QWidget):
# self.setWindowModality(QtCore.Qt.WindowModality.ApplicationModal)
# self.setWindowFlags(self.windowFlags() | QtCore.Qt.WindowStaysOnTopHint)
def set_fig_dict(self, fig_dict):
for key, value in fig_dict.items():
if key is not 'mainFig':
value._tight = True
self.fig_dict = fig_dict
def init_main_layouts(self):
self.main_layout = QtGui.QVBoxLayout()
self.tune_layout = QtGui.QHBoxLayout()