def plot_stations(self, gsac): figStation = py.figure('SeismoStations', figsize=(16, 12)) figStation.suptitle('Seismic Stations', fontsize=20) # lower-left/upper-right corners for the cascades domain. minLat, minLon, maxLat, maxLon = self.bounding_rectangle() # Central lat/lon coordinates. centerLat = 0.5 * (minLat + maxLat) centerLon = 0.5 * (minLon + maxLon) qLat = min(abs(minLat), abs(maxLat)) h = 1.2 * 6370997. * np.radians(maxLat - minLat) w = 1.1 * 6370997. * np.radians(maxLon - minLon) * np.cos( np.radians(qLat)) #make the basemap if basemapthere: #ax = Basemap(llcrnrlon=minLon, llcrnrlat=minLat, # urcrnrlon=maxLon, urcrnrlat= maxLat, ax = Basemap(width=w, height=h, resolution='i', area_thresh=1000., projection='lcc', lat_0=centerLat, lon_0=centerLon) ax.drawstates() ax.drawcountries() ax.drawcoastlines() py.xlabel( 'Black triangles: deleted stations\n Red Points: selected stations' ) else: simplexmin = minLon - 1. simplexmax = maxLon + 1. simpleymin = minLat - 1. simpleymax = maxLat + 1. ax = figStation.add_subplot(111) ax.axis([simplexmin, simplexmax, simpleymin, simpleymax]) py.xlabel( 'Black triangles: deleted stations\n Red Points: selected stations\n No coastline because Basemap module not found' ) py.title(self.plotname) # plot stations if hasattr(gsac, 'delay_times'): self.plot_selected_stations_color_delay_times(ax, gsac.delay_times) else: self.plot_selected_stations(ax) self.plot_deleted_stations(ax) figStation.canvas.mpl_connect('pick_event', self.show_station_name) self.figStation = figStation self.ax = ax py.show()
def plot_stations(self, gsac): figStation = plt.figure('SeismoStations', figsize=(16, 12)) figStation.suptitle('Seismic Stations', fontsize=20) # lower-left/upper-right corners for the cascades domain. minLat, minLon, maxLat, maxLon = self.bounding_rectangle() # Central lat/lon coordinates. centerLat = 0.5 * (minLat + maxLat) centerLon = 0.5 * (minLon + maxLon) qLat = min(abs(minLat),abs(maxLat)) h = 1.2*6370997.*np.radians(maxLat-minLat) w = 1.1*6370997.*np.radians(maxLon-minLon)*np.cos(np.radians(qLat)) #make the basemap if basemapthere: #ax = Basemap(llcrnrlon=minLon, llcrnrlat=minLat, # urcrnrlon=maxLon, urcrnrlat= maxLat, ax = Basemap(width=w, height=h, resolution='i', area_thresh=1000., projection='lcc', lat_0=centerLat, lon_0=centerLon) ax.drawstates() ax.drawcountries() ax.drawcoastlines() plt.xlabel('Black triangles: deleted stations\n Red Points: selected stations') else: simplexmin = minLon-1. simplexmax = maxLon+1. simpleymin = minLat-1. simpleymax = maxLat+1. ax = figStation.add_subplot(111) ax.axis([simplexmin, simplexmax, simpleymin, simpleymax]) plt.xlabel('Black triangles: deleted stations\n Red Points: selected stations\n No coastline because Basemap module not found') plt.title(self.plotname) # plot stations if hasattr(gsac, 'delay_times'): self.plot_selected_stations_color_delay_times(ax, gsac.delay_times) else: self.plot_selected_stations(ax) self.plot_deleted_stations(ax) figStation.canvas.mpl_connect('pick_event', self.show_station_name) self.figStation = figStation self.ax = ax plt.show()