Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
W
WRFotron
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
MBEES
WRFotron
Commits
94d5d61b
Commit
94d5d61b
authored
2 years ago
by
Christoph Knote
Browse files
Options
Downloads
Patches
Plain Diff
Lines
parent
a231c34d
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
blueprints/operational_chemistry/pp/plotting/maps/plots.py
+2
-4
2 additions, 4 deletions
blueprints/operational_chemistry/pp/plotting/maps/plots.py
blueprints/operational_chemistry/pp/plotting/maps/run.py
+20
-6
20 additions, 6 deletions
blueprints/operational_chemistry/pp/plotting/maps/run.py
with
22 additions
and
10 deletions
blueprints/operational_chemistry/pp/plotting/maps/plots.py
+
2
−
4
View file @
94d5d61b
...
...
@@ -129,7 +129,7 @@ def plevel_map(t, nc, output_path, plevel, phi_contour_intervals=np.arange(400,
plt
.
savefig
(
output_path
,
bbox_inches
=
'
tight
'
,
pad_inches
=
0.1
)
plt
.
close
()
def
sfc_map
(
t
,
nc
,
get_var_fun
,
levels
,
ticks
,
label
,
pois
,
output_path
,
cmap
=
"
viridis
"
,
extend
=
'
both
'
):
def
sfc_map
(
t
,
nc
,
get_var_fun
,
levels
,
ticks
,
label
,
pois
,
lois_function
,
output_path
,
cmap
=
"
viridis
"
,
extend
=
'
both
'
):
#
var
=
get_var_fun
(
nc
)
u
,
v
=
getvar
(
nc
,
'
uvmet10
'
)
...
...
@@ -157,9 +157,7 @@ def sfc_map(t, nc, get_var_fun, levels, ticks, label, pois, output_path, cmap="v
transform
=
ccrs
.
PlateCarree
())
plt
.
clabel
(
cs
,
fmt
=
'
%1.0f
'
,
fontsize
=
8
)
#
ax
.
coastlines
(
linewidth
=
0.3
,
zorder
=
2
)
countries
=
cfeature
.
NaturalEarthFeature
(
category
=
'
cultural
'
,
name
=
'
admin_0_countries
'
,
scale
=
'
50m
'
)
ax
.
add_feature
(
countries
,
facecolor
=
'
none
'
,
edgecolor
=
'
black
'
,
linewidth
=
0.3
,
zorder
=
3
)
lois_function
(
ax
)
#
nb
=
10
brsb
=
ax
.
barbs
(
to_np
(
lons
[::
nb
,::
nb
]),
to_np
(
lats
[::
nb
,::
nb
]),
...
...
This diff is collapsed.
Click to expand it.
blueprints/operational_chemistry/pp/plotting/maps/run.py
+
20
−
6
View file @
94d5d61b
...
...
@@ -22,12 +22,26 @@ import pois
import
netCDF4
from
wrf
import
getvar
import
numpy
as
np
import
cartopy.feature
as
cfeature
times
=
[
args
.
date
+
datetime
.
timedelta
(
hours
=
t
)
for
t
in
range
(
0
,
args
.
fcst_time_hours
,
args
.
interval_hours
)
]
# for calculating delta precip
prec_prev
=
None
def
lois_function_europe
(
ax
,
cfeature
):
ax
.
coastlines
(
linewidth
=
0.3
,
zorder
=
2
)
countries
=
cfeature
.
NaturalEarthFeature
(
category
=
'
cultural
'
,
name
=
'
admin_0_countries
'
,
scale
=
'
50m
'
)
ax
.
add_feature
(
countries
,
facecolor
=
'
none
'
,
edgecolor
=
'
black
'
,
linewidth
=
0.3
,
zorder
=
3
)
def
lois_function_southern_germany
(
ax
,
cfeature
):
ax
.
coastlines
(
linewidth
=
0.3
,
zorder
=
2
)
countries
=
cfeature
.
NaturalEarthFeature
(
category
=
'
cultural
'
,
name
=
'
admin_0_countries
'
,
scale
=
'
10m
'
)
ax
.
add_feature
(
countries
,
facecolor
=
'
none
'
,
edgecolor
=
'
black
'
,
linewidth
=
0.3
,
zorder
=
3
)
regions
=
cfeature
.
NaturalEarthFeature
(
category
=
'
cultural
'
,
name
=
'
admin_1_countries
'
,
scale
=
'
10m
'
)
ax
.
add_feature
(
countries
,
facecolor
=
'
none
'
,
edgecolor
=
'
black
'
,
linewidth
=
0.1
,
zorder
=
3
)
for
t
in
times
:
input_path_d01
=
t
.
strftime
(
args
.
wrf_data_fpath_pattern
).
format
(
domain
=
1
)
input_path_d02
=
t
.
strftime
(
args
.
wrf_data_fpath_pattern
).
format
(
domain
=
2
)
...
...
@@ -54,18 +68,18 @@ for t in times:
# output_path=t.strftime(args.plot_fpath_pattern).format(plot='T', domain=1))
# Ozone
for
domain
,
nc_d
,
poilist
in
zip
([
1
,
2
],[
nc_d01
,
nc_d02
],
[
pois
.
capitals
,
pois
.
southern_germany
]):
for
domain
,
nc_d
,
poilist
,
loifun
in
zip
([
1
,
2
],[
nc_d01
,
nc_d02
],
[
pois
.
capitals
,
pois
.
southern_germany
]
,
[
lois_function_europe
,
lois_function_southern_germany
]
):
sfc_map
(
t
,
nc_d
,
lambda
nc
:
getvar
(
nc
,
'
o3
'
)[
0
,:,:]
*
1e3
,
levels
=
range
(
0
,
160
,
10
),
ticks
=
range
(
0
,
150
,
20
),
label
=
"
Ozone (ground level) [ppbv]
"
,
pois
=
poilist
,
label
=
"
Ozone (ground level) [ppbv]
"
,
pois
=
poilist
,
lois_function
=
loifun
,
output_path
=
t
.
strftime
(
args
.
plot_fpath_pattern
).
format
(
plot
=
'
O3
'
,
domain
=
domain
),
extend
=
'
max
'
)
# NO2
sfc_map
(
t
,
nc_d
,
lambda
nc
:
getvar
(
nc
,
'
no2
'
)[
0
,:,:]
*
1e3
,
levels
=
range
(
0
,
110
,
10
),
ticks
=
range
(
0
,
110
,
20
),
label
=
"
NO$_2$ (ground level) [ppbv]
"
,
pois
=
poilist
,
label
=
"
NO$_2$ (ground level) [ppbv]
"
,
pois
=
poilist
,
lois_function
=
loifun
,
output_path
=
t
.
strftime
(
args
.
plot_fpath_pattern
).
format
(
plot
=
'
NO2
'
,
domain
=
domain
),
extend
=
'
max
'
)
# PM
...
...
@@ -78,19 +92,19 @@ for t in times:
# sfc_map(t, nc_d, lambda nc: get_pm(nc, bins=[1]),
# levels=range(0, 130, 10),
# ticks=range(0, 130, 20),
# label="UFP (ground level) [$\mu$g m$^{{-3}}$]", pois=poilist,
# label="UFP (ground level) [$\mu$g m$^{{-3}}$]", pois=poilist,
lois_function=loifun,
# output_path=t.strftime(args.plot_fpath_pattern).format(plot='UFP', domain=domain),
# extend='max')
sfc_map
(
t
,
nc_d
,
lambda
nc
:
get_pm
(
nc
,
bins
=
[
1
,
2
,
3
]),
levels
=
range
(
0
,
130
,
10
),
ticks
=
range
(
0
,
130
,
20
),
label
=
"
PM$_{{2.5}}$ (ground level) [$\mu$g m$^{{-3}}$]
"
,
pois
=
poilist
,
label
=
"
PM$_{{2.5}}$ (ground level) [$\mu$g m$^{{-3}}$]
"
,
pois
=
poilist
,
lois_function
=
loifun
,
output_path
=
t
.
strftime
(
args
.
plot_fpath_pattern
).
format
(
plot
=
'
PM2_5
'
,
domain
=
domain
),
extend
=
'
max
'
)
sfc_map
(
t
,
nc_d
,
lambda
nc
:
get_pm
(
nc
,
bins
=
[
1
,
2
,
3
,
4
]),
levels
=
range
(
0
,
130
,
10
),
ticks
=
range
(
0
,
130
,
20
),
label
=
"
PM$_{{10}}$ (ground level) [$\mu$g m$^{{-3}}$]
"
,
pois
=
poilist
,
label
=
"
PM$_{{10}}$ (ground level) [$\mu$g m$^{{-3}}$]
"
,
pois
=
poilist
,
lois_function
=
loifun
,
output_path
=
t
.
strftime
(
args
.
plot_fpath_pattern
).
format
(
plot
=
'
PM10
'
,
domain
=
domain
),
extend
=
'
max
'
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment