Plotting global equal area maps with python, matplotlib/pylab and Basemap.
Sibiria 13,1 · 106 km² vs. china 9.7 · 106 km²
Maps thanks to Marble Desktop Globe and Open Street Map, available under CC by-sa and Open Data Commons Open Database License (ODbL).
m = map.Basemap(projection='cea', lat_ts=37.5) outfile = "hobo-dyer.png" pl.title("Hobo Dyer: Cylindric Equal Area at $37.5^\\circ N$")
m = map.Basemap(projection='hammer', lon_0=0) outfile = "hammer.png" pl.title("Hammer") # latex-test: $\frac{1}{2}$
m = map.Basemap(projection='mbtfpq', lon_0=0) outfile = "flatpolarquartic.png" pl.title("Flat Polar Quartic: parallels at $33^\\circ 45' N/S$")
To show regional fluxes and longitudinally constrained regions: Easy to spot on rectangular grid.
To show a global overview: Helps the understanding of global data because it appears most similar to a real earth while including the whole earth surface.
For mainly latitudinally constrained regions: Straight latitudinal lines and high latitudinal resolution near the poles.
# basemap, pylab and numpy for plotting import mpl_toolkits.basemap as map import pylab as pl import numpy as np # netcdf for reading the emission files import netCDF4 as nc
<<addmapfeatures>> <<addindicatrix>> try: <<addemissions>> <<addcolorbar>> except RuntimeError: # recover from missing fluxfile m.fillcontinents(color='coral',lake_color='aqua') pl.savefig(outfile) return "./" + outfile + ""
# add map lines m.drawcoastlines() # only fill continents if we do not plot emissions # m.fillcontinents(color='coral',lake_color='aqua') m.drawparallels(np.arange(-90.,120.,30.), labels=[False,True,True,False]) m.drawmeridians(np.arange(0.,420.,60.), labels=[True,False,False,True]) m.drawmapboundary(fill_color='aqua')
# draw tissot's indicatrix to show distortion. for y in np.linspace(m.ymax/20,19*m.ymax/20,9): for x in np.linspace(m.xmax/20,19*m.xmax/20,12): lon, lat = m(x,y,inverse=True) poly = m.tissot(lon,lat,4.0,100, facecolor='green', zorder=10,alpha=0.5)
# d = nc.Dataset("/run/media/arne/3TiB/CTDAS-2013-03-07-2years-base-data/" # "analysis/data_flux1x1_weekly/flux_1x1.nc") d = nc.Dataset("UNPUBLISHED") biocovmean = np.mean( d.variables["bio_flux_prior_cov"][:,:,:], axis=0) # projection: matplotlib.org/basemap/users/examples.html lons, lats = pl.meshgrid(range(-180, 180), range(-90, 90)) x, y = m(lons, lats) # choose my standard color range: vmin = -0.5*vmax vmax = max(abs(np.max(biocovmean)), 2 * abs(np.min(biocovmean))) vmin = -0.5*vmax m.pcolor(x, y, biocovmean, shading='flat', vmin=vmin, vmax=vmax) # pcolormesh is faster
pl.rcParams.update({"text.usetex": True, "text.latex.unicode": True}) colorbar = pl.colorbar(orientation="horizontal", format="%.2g") # scientific colorbar.set_label("$CO_{2}$ fluxes [$\\frac{mol}{m^2 s}$]")
Anhang | Größe |
---|---|
flatpolarquartic.png | 127.57 KB |
hobo-dyer.png | 139.26 KB |
hammer.png | 138.15 KB |
sibiria-china-flat.png | 1.14 MB |
sibiria-china-globe.png | 1.14 MB |
equal-area-map-projections.pdf | 3.06 MB |
equal-area-map-projections.org | 10.19 KB |
Use Node:
⚙ Babcom is trying to load the comments ⚙
This textbox will disappear when the comments have been loaded.
If the box below shows an error-page, you need to install Freenet with the Sone-Plugin or set the node-path to your freenet node and click the Reload Comments button (or return).
If you see something like Invalid key: java.net.MalformedURLException: There is no @ in that URI! (Sone/search.html)
, you need to setup Sone and the Web of Trust
If you had Javascript enabled, you would see comments for this page instead of the Sone page of the sites author.
Note: To make a comment which isn’t a reply visible to others here, include a link to this site somewhere in the text of your comment. It will then show up here. To ensure that I get notified of your comment, also include my Sone-ID.
Link to this site and my Sone ID: sone://6~ZDYdvAgMoUfG6M5Kwi7SQqyS-gTcyFeaNN1Pf3FvY
This spam-resistant comment-field is made with babcom.