Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
MLAir
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
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
esde
machine-learning
MLAir
Commits
4d08afdc
Commit
4d08afdc
authored
4 years ago
by
Felix Kleinert
Browse files
Options
Downloads
Patches
Plain Diff
add run script for wrf dh
parent
8a70118d
Branches
Branches containing commit
Tags
Tags containing commit
1 merge request
!259
Draft: Resolve "WRF-Datahandler should inherit from SingleStationDatahandler"
Pipeline
#64880
passed with warnings
4 years ago
Stage: test
Stage: docs
Stage: pages
Stage: deploy
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
run_wrf_dh.py
+101
-0
101 additions, 0 deletions
run_wrf_dh.py
with
101 additions
and
0 deletions
run_wrf_dh.py
0 → 100644
+
101
−
0
View file @
4d08afdc
__author__
=
"
Lukas Leufen
"
__date__
=
'
2020-06-29
'
import
argparse
from
mlair.data_handler.data_handler_single_station
import
DataHandlerSingleStation
from
mlair.data_handler.data_handler_wrf_chem
import
DataHandlerSingleGridColumn
,
DataHandlerWRF
,
DataHandlerMainSectWRF
from
mlair.workflows
import
DefaultWorkflow
from
mlair.helpers
import
remove_items
from
mlair.configuration.defaults
import
DEFAULT_PLOT_LIST
import
os
def
load_stations
():
import
json
try
:
filename
=
'
supplement/station_list_north_german_plain_rural.json
'
with
open
(
filename
,
'
r
'
)
as
jfile
:
stations
=
json
.
load
(
jfile
)
except
FileNotFoundError
:
stations
=
None
return
stations
def
main
(
parser_args
):
plots
=
remove_items
(
DEFAULT_PLOT_LIST
,
"
PlotConditionalQuantiles
"
)
workflow
=
DefaultWorkflow
(
# stations=load_stations(),
# stations=["DEBW087","DEBW013", "DEBW107", "DEBW076"],
train_model
=
False
,
create_new_model
=
True
,
network
=
"
UBA
"
,
evaluate_bootstraps
=
False
,
# plot_list=["PlotCompetitiveSkillScore"],
competitors
=
[
"
test_model
"
,
"
test_model2
"
],
competitor_path
=
os
.
path
.
join
(
os
.
getcwd
(),
"
data
"
,
"
comp_test
"
),
train_min_length
=
1
,
val_min_length
=
1
,
test_min_length
=
1
,
# data_handler=DataHandlerSingleStation,
# data_handler=DataHandlerSingleGridColumn,
epochs
=
20
,
window_lead_time
=
2
,
window_history_size
=
6
,
stations
=
[
"
coords__50_7333__7_1000
"
,
"
coords__50_0000__0_0000
"
,
"
coords__48_7444__7_6000
"
,
"
coords__50_0000__1_0000
"
,
"
coords__52_7555__8_1000
"
,
"
coords__50_0000__2_0000
"
,
"
coords__51_7666__8_6000
"
,
"
coords__50_0000__3_0000
"
,
"
coords__45_7777__9_1000
"
,
"
coords__50_0000__4_0000
"
,
],
# data_handler=DataHandlerWRF,
data_handler
=
DataHandlerMainSectWRF
,
#,
data_path
=
'
/home/felix/Data/WRF-Chem/upload_aura_2021-02-24/2009/
'
,
time_dim
=
'
XTIME
'
,
external_coords_file
=
'
/home/felix/Data/WRF-Chem/upload_aura_2021-02-24/coords.nc
'
,
transformation
=
{
"
T2
"
:
{
"
method
"
:
"
standardise
"
},
"
Q2
"
:
{
"
method
"
:
"
standardise
"
},
"
PBLH
"
:
{
"
method
"
:
"
standardise
"
},
"
Ull
"
:
{
"
method
"
:
"
standardise
"
},
"
Vll
"
:
{
"
method
"
:
"
standardise
"
},
"
wdir10ll
"
:
{
"
method
"
:
"
min_max
"
,
"
min
"
:
0.
,
"
max
"
:
360.
},
"
wspd10ll
"
:
{
"
method
"
:
"
standardise
"
},
'
no
'
:
{
"
method
"
:
"
standardise
"
},
'
no2
'
:
{
"
method
"
:
"
standardise
"
},
'
co
'
:
{
"
method
"
:
"
standardise
"
},
'
PSFC
'
:
{
"
method
"
:
"
standardise
"
},
'
CLDFRA
'
:
{
"
method
"
:
"
min_max
"
},
},
variables
=
[
'
T2
'
,
'
o3
'
,
'
wdir10ll
'
,
'
wspd10ll
'
,
'
no
'
,
'
no2
'
,
'
co
'
,
'
PSFC
'
,
'
PBLH
'
,
'
CLDFRA
'
],
target_var
=
[
'
T2
'
],
statistics_per_var
=
{
'
T2
'
:
None
,
'
o3
'
:
None
,
'
wdir10ll
'
:
None
,
'
wspd10ll
'
:
None
,
'
no
'
:
None
,
'
no2
'
:
None
,
'
co
'
:
None
,
'
PSFC
'
:
None
,
'
PBLH
'
:
None
,
'
CLDFRA
'
:
None
,
},
# variables=['T2', 'Q2', 'PBLH', 'U10ll', 'V10ll', 'wdir10ll', 'wspd10ll'],
# target_var=["T2"],
# statistics_per_var={'T2': None, 'Q2': None, 'PBLH': None,
# 'U10ll': None, 'V10ll': None, 'wdir10ll': None, 'wspd10ll': None},
var_logical_z_coord_selector
=
0
,
targetvar_logical_z_coord_selector
=
0
,
aggregation_dim
=
'
bottom_top
'
,
radius
=
100
,
# km
start
=
'
2009-01-01
'
,
end
=
'
2009-01-04
'
,
train_start
=
'
2009-01-01
'
,
train_end
=
'
2009-01-02
'
,
val_start
=
'
2009-01-02
'
,
val_end
=
'
2009-01-03
'
,
test_start
=
'
2009-01-03
'
,
test_end
=
'
2009-01-04
'
,
sampling
=
'
hourly
'
,
**
parser_args
.
__dict__
)
workflow
.
run
()
if
__name__
==
"
__main__
"
:
parser
=
argparse
.
ArgumentParser
()
parser
.
add_argument
(
'
--experiment_date
'
,
metavar
=
'
--exp_date
'
,
type
=
str
,
default
=
"
testrun
"
,
help
=
"
set experiment date as string
"
)
args
=
parser
.
parse_args
()
main
(
args
)
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