Uploaded by Abe Madey

map3

advertisement
import matplotlib.ticker as mticker
import numpy as np
from datetime import datetime
import cartopy
import cartopy.crs as ccrs
from cartopy.feature.nightshade import Nightshade
import matplotlib.pyplot as plt
from matplotlib.colors import LinearSegmentedColormap
from cartopy.mpl.gridliner import LONGITUDE_FORMATTER, LATITUDE_FORMATTER
# basemap
from mpl_toolkits.basemap import Basemap
def main():
fig = plt.figure(figsize=[10, 10])
# We choose to plot in an Orthographic projection as it looks natural
# and the distortion is relatively small around the poles where
# the aurora is most likely.
# ax1 for Northern Hemisphere
map_proj=ccrs.Orthographic(central_longitude=-75, central_latitude=0.1)
ax = fig.add_subplot(1, 1, 1, projection=map_proj)
# ax2 for Southern Hemisphere
#ax2 = fig.add_subplot(1, 2, 2, projection=ccrs.Orthographic(180, -90))
#
img, crs, extent, origin, dt = aurora_forecast()
ax.add_feature(cartopy.feature.LAND, linewidth=0, edgecolor='white',
facecolor='white')
ax.add_feature(cartopy.feature.OCEAN, facecolor=(.93,.93,.93))
ax.add_feature(cartopy.feature.COASTLINE, alpha=.6, linewidth=.3, zorder=3)
ax.coastlines(zorder=3)
ax.set_global()
gl=ax.gridlines(linewidth=.5,)
gl.xlines=False
gl.ylocator= mticker.FixedLocator([-60, -30, 0.0, 30, 60])
plt.show()
if __name__ == '__main__':
main()
Download