map beautification
This commit is contained in:
parent
ba56bfbd25
commit
22eb46999c
11
QtPyLoT.py
11
QtPyLoT.py
@ -1496,6 +1496,14 @@ class MainWindow(QMainWindow):
|
||||
self.get_data().applyEVTData(self.calc_magnitude(), type='event')
|
||||
|
||||
def init_array_tab(self):
|
||||
if hasattr(self, 'metadata_widget'):
|
||||
if self.metadata_widget:
|
||||
self.metadata_widget.setParent(None)
|
||||
self.array_layout.removeWidget(self.metadata_widget)
|
||||
if hasattr(self, 'array_map'):
|
||||
if self.array_map:
|
||||
self.array_map.setParent(None)
|
||||
self.array_layout.removeWidget(self.array_map)
|
||||
self.metadata_widget = QWidget(self)
|
||||
grid_layout = QGridLayout()
|
||||
grid_layout.setColumnStretch(0, 1)
|
||||
@ -1510,6 +1518,7 @@ class MainWindow(QMainWindow):
|
||||
grid_layout.addWidget(label, 1, 1)
|
||||
grid_layout.addWidget(new_inv_button, 2, 1)
|
||||
|
||||
self.metadata = None
|
||||
self.metadata_widget.setLayout(grid_layout)
|
||||
self.array_layout.addWidget(self.metadata_widget)
|
||||
|
||||
@ -1823,6 +1832,8 @@ class MainWindow(QMainWindow):
|
||||
self.init_events(new=True)
|
||||
if hasattr(self.project, 'metadata'):
|
||||
self.init_array_map(index=0)
|
||||
else:
|
||||
self.init_array_tab()
|
||||
|
||||
def saveProject(self):
|
||||
if self.project:
|
||||
|
@ -1 +1 @@
|
||||
a3fbe-dirty
|
||||
ba56b-dirty
|
||||
|
@ -24,12 +24,12 @@ class map_projection(QtGui.QWidget):
|
||||
self.picks_dict = None
|
||||
self.figure = figure
|
||||
self.init_graphics()
|
||||
self.init_basemap(projection='mill', resolution='l')
|
||||
self.init_stations()
|
||||
self.init_basemap(resolution='l')
|
||||
self.init_map()
|
||||
#self.show()
|
||||
|
||||
def init_map(self):
|
||||
self.init_stations()
|
||||
self.init_lat_lon_dimensions()
|
||||
self.init_lat_lon_grid()
|
||||
self.init_x_y_dimensions()
|
||||
@ -196,13 +196,19 @@ class map_projection(QtGui.QWidget):
|
||||
self.x, self.y = self.basemap(self.lon, self.lat)
|
||||
self.xdim, self.ydim = get_x_y_dim(self.x, self.y)
|
||||
|
||||
def init_basemap(self, projection, resolution='l'):
|
||||
basemap = Basemap(projection=projection, resolution = resolution, ax=self.main_ax)
|
||||
basemap.drawmapboundary(fill_color='darkblue')
|
||||
basemap.drawcountries()
|
||||
basemap.drawstates()
|
||||
basemap.fillcontinents(color='grey', lake_color='aqua')
|
||||
basemap.drawcoastlines()
|
||||
def init_basemap(self, resolution='l'):
|
||||
#basemap = Basemap(projection=projection, resolution = resolution, ax=self.main_ax)
|
||||
basemap = Basemap(projection='lcc', resolution = resolution, ax=self.main_ax,
|
||||
width=5e6, height=2e6,
|
||||
lat_0=(min(self.lat)+max(self.lat))/2.,
|
||||
lon_0=(min(self.lon)+max(self.lon))/2.)
|
||||
|
||||
#basemap.fillcontinents(color=None, lake_color='aqua',zorder=1)
|
||||
basemap.drawmapboundary(zorder=2)#fill_color='darkblue')
|
||||
basemap.shadedrelief(zorder=3)
|
||||
basemap.drawcountries(zorder=4)
|
||||
basemap.drawstates(zorder=5)
|
||||
basemap.drawcoastlines(zorder=6)
|
||||
self.basemap = basemap
|
||||
self.figure.tight_layout()
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user