[bugfix] contourf plot not shown in station map. min() max() was not working when nan in list

This commit is contained in:
Marcel Paffrath 2017-06-06 13:49:40 +02:00
parent 86c76c6f61
commit 4077ec207c
2 changed files with 4 additions and 4 deletions

View File

@ -1 +1 @@
530a-dirty 86c7-dirty

View File

@ -51,7 +51,7 @@ class map_projection(QtGui.QWidget):
picks=self._parent.get_current_event().getPick(station), picks=self._parent.get_current_event().getPick(station),
autopicks=self._parent.get_current_event().getAutopick(station)) autopicks=self._parent.get_current_event().getAutopick(station))
except Exception as e: except Exception as e:
message = 'Could not generate Plot for station {st}.\n{er}'.format(st=station, er=e) message = 'Could not generate Plot for station {st}.\n {er}'.format(st=station, er=e)
self._warn(message) self._warn(message)
print(message, e) print(message, e)
return return
@ -234,9 +234,9 @@ class map_projection(QtGui.QWidget):
self.picks_no_nan, (self.latgrid, self.longrid), method='linear') ################## self.picks_no_nan, (self.latgrid, self.longrid), method='linear') ##################
def draw_contour_filled(self, nlevel='50'): def draw_contour_filled(self, nlevel='50'):
levels = np.linspace(min(self.picks_rel), max(self.picks_rel), nlevel) levels = np.linspace(min(self.picks_no_nan), max(self.picks_no_nan), nlevel)
self.contourf = self.basemap.contourf(self.longrid, self.latgrid, self.picksgrid_no_nan, self.contourf = self.basemap.contourf(self.longrid, self.latgrid, self.picksgrid_no_nan,
levels, latlon=True, zorder=9) levels, latlon=True, zorder=9, alpha=0.5)
def scatter_all_stations(self): def scatter_all_stations(self):
self.sc = self.basemap.scatter(self.lon, self.lat, s=50, facecolor='none', latlon=True, self.sc = self.basemap.scatter(self.lon, self.lat, s=50, facecolor='none', latlon=True,