Docker-in-Docker (DinD) capabilities of public runners deactivated. More info

Commit c9c3891a authored by Thomas Dubos's avatar Thomas Dubos
Browse files

Fix concentration maps

parent c3c4743d
......@@ -228,11 +228,15 @@ def amount(lon, lat, area, vol, dens):
def concentration_map(read, level, day, filename):
lon, lat, area, volume, density = read(day)
# density = density[level, :, :]
density = (volume*density).sum(axis=0)
if level>0:
density = np.abs(density[level, :, :])
else:
density = np.abs( (volume*density).sum(axis=0) )
density = density/density.max()
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.fillcontinents(color='yellow',lake_color='dodgerblue')
# draw parallels and meridians.
......@@ -240,13 +244,10 @@ def concentration_map(read, level, day, filename):
m2.drawmeridians(np.arange(-180.,181.,20.))
m2.drawmapboundary(fill_color='azure')
x = np.linspace(0, m2.urcrnrx, density.shape[1])
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)
m2.contourf(lon, lat, density, zorder=2, alpha=0.5, latlon=True)
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.close()
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment