Commit c9c3891a by Thomas Dubos

### Fix concentration maps

parent c3c4743d
 ... @@ -228,11 +228,15 @@ def amount(lon, lat, area, vol, dens): ... @@ -228,11 +228,15 @@ def amount(lon, lat, area, vol, dens): def concentration_map(read, level, day, filename): def concentration_map(read, level, day, filename): lon, lat, area, volume, density = read(day) lon, lat, area, volume, density = read(day) # density = density[level, :, :] if level>0: density = (volume*density).sum(axis=0) density = np.abs(density[level, :, :]) else: density = np.abs( (volume*density).sum(axis=0) ) density = density/density.max() plt.figure() plt.figure() m2 = Basemap(projection='spstere',boundinglat=-10,lon_0=90,resolution='h') m2 = Basemap(projection='spstere',boundinglat=-20,lon_0=-90,resolution='h') m2.drawcoastlines() m2.drawcoastlines() m2.fillcontinents(color='yellow',lake_color='dodgerblue') m2.fillcontinents(color='yellow',lake_color='dodgerblue') # draw parallels and meridians. # draw parallels and meridians. ... @@ -240,13 +244,10 @@ def concentration_map(read, level, day, filename): ... @@ -240,13 +244,10 @@ def concentration_map(read, level, day, filename): m2.drawmeridians(np.arange(-180.,181.,20.)) m2.drawmeridians(np.arange(-180.,181.,20.)) m2.drawmapboundary(fill_color='azure') m2.drawmapboundary(fill_color='azure') x = np.linspace(0, m2.urcrnrx, density.shape[1]) m2.contourf(lon, lat, density, zorder=2, alpha=0.5, latlon=True) y = np.linspace(0, m2.urcrnry, density.shape[0]) xx, yy = np.meshgrid(x, y) m2.pcolormesh(xx, yy, density, zorder=2, alpha=0.5) plt.colorbar(label='Sulfur dioxide density '+r'\$(kg/m^3)\$') # plt.colorbar(label='Sulfur dioxide density '+r'\$(kg/m^3)\$') plt.colorbar(label='Sulfur dioxide density (arb. units)') plt.savefig(filename%level, dpi=300) plt.savefig(filename%level, dpi=300) plt.close() plt.close() ... ...
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!