Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Docker-in-Docker (DinD) capabilities of public runners deactivated.
More info
Open sidebar
IPSL
LMD
InTro
Multiscale Transport
Commits
c9c3891a
Commit
c9c3891a
authored
Oct 20, 2021
by
Thomas Dubos
Browse files
Fix concentration maps
parent
c3c4743d
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
9 deletions
+10
-9
metrics/half_plume.py
metrics/half_plume.py
+10
-9
No files found.
metrics/half_plume.py
View file @
c9c3891a
...
...
@@ -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
()
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment