feature/port-to-py3 #11
@ -104,8 +104,6 @@ class Array_map(QtWidgets.QWidget):
|
|||||||
self.plotWidget = FigureCanvas(self.canvas.fig)
|
self.plotWidget = FigureCanvas(self.canvas.fig)
|
||||||
else:
|
else:
|
||||||
self.canvas = MplCanvas(self, extern_axes=self.extern_plot_axes)
|
self.canvas = MplCanvas(self, extern_axes=self.extern_plot_axes)
|
||||||
#self.canvas.axes = self.extern_plot_axes
|
|
||||||
#self.canvas.fig = self.extern_plot_axes.figure
|
|
||||||
self.plotWidget = FigureCanvas(self.canvas.fig)
|
self.plotWidget = FigureCanvas(self.canvas.fig)
|
||||||
|
|
||||||
kaan marked this conversation as resolved
Outdated
|
|||||||
# initialize GUI elements
|
# initialize GUI elements
|
||||||
@ -153,9 +151,7 @@ class Array_map(QtWidgets.QWidget):
|
|||||||
self.top_row.addWidget(self.refresh_button)
|
self.top_row.addWidget(self.refresh_button)
|
||||||
|
|
||||||
self.main_box.addWidget(self.plotWidget, 1)
|
self.main_box.addWidget(self.plotWidget, 1)
|
||||||
# self.main_box.addWidget(self.map_reset_button, 0)
|
|
||||||
# self.main_box.addWidget(NavigationToolbar(self.plotWidget, self), 0)
|
# self.main_box.addWidget(NavigationToolbar(self.plotWidget, self), 0)
|
||||||
# self.main_box.addWidget(self.status_label, 0)
|
|
||||||
|
|
||||||
self.bot_row = QtWidgets.QHBoxLayout()
|
self.bot_row = QtWidgets.QHBoxLayout()
|
||||||
self.main_box.addLayout(self.bot_row, 0.3)
|
self.main_box.addLayout(self.bot_row, 0.3)
|
||||||
@ -163,7 +159,6 @@ class Array_map(QtWidgets.QWidget):
|
|||||||
self.bot_row.addWidget(self.go2eq_button)
|
self.bot_row.addWidget(self.go2eq_button)
|
||||||
self.bot_row.addWidget(self.save_map_button)
|
self.bot_row.addWidget(self.save_map_button)
|
||||||
self.bot_row.addWidget(self.status_label)
|
self.bot_row.addWidget(self.status_label)
|
||||||
# self.connectSignals()
|
|
||||||
|
|
||||||
def init_colormap(self):
|
def init_colormap(self):
|
||||||
self.init_lat_lon_dimensions()
|
self.init_lat_lon_dimensions()
|
||||||
@ -187,7 +182,7 @@ class Array_map(QtWidgets.QWidget):
|
|||||||
# self.plotWidget.draw_idle()
|
# self.plotWidget.draw_idle()
|
||||||
|
|
||||||
def add_merid_paral(self):
|
def add_merid_paral(self):
|
||||||
self.gridlines = self.canvas.axes.gridlines(draw_labels=False, alpha=0.8, color='dimgray', linewidth=self.linewidth, zorder=7)
|
self.gridlines = self.canvas.axes.gridlines(draw_labels=False, alpha=0.8, color='gray', linewidth=self.linewidth/2, zorder=7)
|
||||||
# current cartopy version does not support label removal. Devs are working on it.
|
# current cartopy version does not support label removal. Devs are working on it.
|
||||||
# Should be fixed with next cartopy version
|
# Should be fixed with next cartopy version
|
||||||
# self.gridlines.xformatter = LONGITUDE_FORMATTER
|
# self.gridlines.xformatter = LONGITUDE_FORMATTER
|
||||||
@ -526,22 +521,18 @@ class Array_map(QtWidgets.QWidget):
|
|||||||
print(message, e)
|
print(message, e)
|
||||||
print(traceback.format_exc())
|
print(traceback.format_exc())
|
||||||
|
|
||||||
def draw_contour_filled(self, nlevel=100):
|
def draw_contour_filled(self, nlevel=50):
|
||||||
# self.test_gradient()
|
|
||||||
|
|
||||||
levels = np.linspace(self.get_min_from_picks(), self.get_max_from_picks(), nlevel)
|
levels = np.linspace(self.get_min_from_picks(), self.get_max_from_picks(), nlevel)
|
||||||
|
|
||||||
self.contourf = self.canvas.axes.contourf(self.longrid, self.latgrid, self.picksgrid_active, levels,
|
self.contourf = self.canvas.axes.contourf(self.longrid, self.latgrid, self.picksgrid_active, levels,
|
||||||
linewidths=self.linewidth, transform=ccrs.PlateCarree(),
|
linewidths=self.linewidth*4, transform=ccrs.PlateCarree(),
|
||||||
alpha=0.7, zorder=8, cmap=self.get_colormap())
|
alpha=0.4, zorder=8, cmap=self.get_colormap())
|
||||||
|
|
||||||
def get_colormap(self):
|
def get_colormap(self):
|
||||||
return plt.get_cmap(self.cmaps_box.currentText())
|
return plt.get_cmap(self.cmaps_box.currentText())
|
||||||
|
|
||||||
def scatter_all_stations(self):
|
def scatter_all_stations(self):
|
||||||
stations, lats, lons = self.get_st_lat_lon_for_plot()
|
stations, lats, lons = self.get_st_lat_lon_for_plot()
|
||||||
# self.sc = self.basemap.scatter(lons, lats, s=self.pointsize, facecolor='none', latlon=True, marker='.',
|
|
||||||
# zorder=10, picker=True, edgecolor='0.5', label='Not Picked')
|
|
||||||
|
|
||||||
self.sc = self.canvas.axes.scatter(lons, lats, s=self.pointsize * 3, facecolor='none', marker='.',
|
self.sc = self.canvas.axes.scatter(lons, lats, s=self.pointsize * 3, facecolor='none', marker='.',
|
||||||
zorder=10, picker=True, edgecolor='0.5', label='Not Picked',
|
zorder=10, picker=True, edgecolor='0.5', label='Not Picked',
|
||||||
@ -593,6 +584,7 @@ class Array_map(QtWidgets.QWidget):
|
|||||||
linewidth=self.pointsize / 15., foreground='k')]))
|
linewidth=self.pointsize / 15., foreground='k')]))
|
||||||
|
|
||||||
self.legend = self.canvas.axes.legend(loc=1, framealpha=1)
|
self.legend = self.canvas.axes.legend(loc=1, framealpha=1)
|
||||||
|
self.legend.set_zorder(100)
|
||||||
self.legend.get_frame().set_facecolor((1, 1, 1, 0.95))
|
self.legend.get_frame().set_facecolor((1, 1, 1, 0.95))
|
||||||
|
|
||||||
def add_cbar(self, label):
|
def add_cbar(self, label):
|
||||||
|
@ -79,11 +79,9 @@ if __name__ == '__main__':
|
|||||||
cl = argparse.ArgumentParser()
|
cl = argparse.ArgumentParser()
|
||||||
cl.add_argument('--dataroot', help='Directory containing the PyLoT .plp file', type=str)
|
cl.add_argument('--dataroot', help='Directory containing the PyLoT .plp file', type=str)
|
||||||
cl.add_argument('--infiles', help='.plp files to use', nargs='+')
|
cl.add_argument('--infiles', help='.plp files to use', nargs='+')
|
||||||
|
cl.add_argument('--ncores', hepl='Specify number of parallel processes', type=int, default=1)
|
||||||
args = cl.parse_args()
|
args = cl.parse_args()
|
||||||
#dataroot = '/home/kaan/master_thesis/waveformData/dmt_dir_proj'
|
|
||||||
#infiles = ['mag_8_sym_proj.plp']
|
|
||||||
|
|
||||||
for infile in args.infiles:
|
for infile in args.infiles:
|
||||||
main(os.path.join(args.dataroot, infile), f_ext='_correlated_0.03-0.1', ncores=1)
|
main(os.path.join(args.dataroot, infile), f_ext='_correlated_0.03-0.1', ncores=args.ncores)
|
||||||
# main('E:\Shared\AlpArray\\test_aa.plp', f_ext='_correlated_0.5Hz', ncores=1)
|
|
||||||
# main('/home/marcel/alparray_m6.5-6.9_mantle_correlated_v3.plp', f_ext='_correlated_0.5Hz')
|
|
||||||
|
@ -1988,6 +1988,7 @@ class PickDlg(QDialog):
|
|||||||
settings = QtCore.QSettings()
|
settings = QtCore.QSettings()
|
||||||
p_phases = settings.value('p_phases')
|
p_phases = settings.value('p_phases')
|
||||||
s_phases = settings.value('s_phases')
|
s_phases = settings.value('s_phases')
|
||||||
|
phases = ''
|
||||||
if not p_phases and not s_phases:
|
if not p_phases and not s_phases:
|
||||||
print('No phases for TauPy selected in Preferences.')
|
print('No phases for TauPy selected in Preferences.')
|
||||||
if p_phases and s_phases:
|
if p_phases and s_phases:
|
||||||
|
Loading…
Reference in New Issue
Block a user
see above, commented code