Skip to content
Snippets Groups Projects
Commit f94292c4 authored by Felix Kleinert's avatar Felix Kleinert
Browse files

update run_wrf for sectors

parent 78cc1006
Branches
Tags
1 merge request!259Draft: Resolve "WRF-Datahandler should inherit from SingleStationDatahandler"
Pipeline #65354 passed
...@@ -7,6 +7,8 @@ from mlair.data_handler.data_handler_wrf_chem import DataHandlerWRF, DataHandler ...@@ -7,6 +7,8 @@ from mlair.data_handler.data_handler_wrf_chem import DataHandlerWRF, DataHandler
from mlair.workflows import DefaultWorkflow from mlair.workflows import DefaultWorkflow
from mlair.helpers import remove_items from mlair.helpers import remove_items
from mlair.configuration.defaults import DEFAULT_PLOT_LIST from mlair.configuration.defaults import DEFAULT_PLOT_LIST
from mlair.model_modules.model_class import MyPaperModel, MyLSTMModel, MyCNNModel
import os import os
...@@ -28,25 +30,36 @@ def main(parser_args): ...@@ -28,25 +30,36 @@ def main(parser_args):
train_model=False, create_new_model=True, network="UBA", train_model=False, create_new_model=True, network="UBA",
evaluate_bootstraps=False, # plot_list=["PlotCompetitiveSkillScore"], evaluate_bootstraps=False, # plot_list=["PlotCompetitiveSkillScore"],
competitors=["test_model", "test_model2"], # competitors=["test_model", "test_model2"],
competitor_path=os.path.join(os.getcwd(), "data", "comp_test"), # competitor_path=os.path.join(os.getcwd(), "data", "comp_test"),
competitors=["baseline", "sector_baseline"],
competitor_path="/p/scratch/deepacf/kleinert1/IASS_proc_monthyl/competitors/o3",
train_min_length=1, val_min_length=1, test_min_length=1, train_min_length=1, val_min_length=1, test_min_length=1,
# data_handler=DataHandlerSingleStation, # data_handler=DataHandlerSingleStation,
# data_handler=DataHandlerSingleGridColumn, # data_handler=DataHandlerSingleGridColumn,
epochs=20, epochs=1000,
window_lead_time=2, window_lead_time=2,
window_history_size=6, window_history_size=6,
stations=["coords__50_7333__7_1000", "coords__50_0000__0_0000", stations=["coords__48_8479__10_0963", "coords__51_8376__14_1417",
# "coords__48_7444__7_6000", "coords__50_0000__1_0000", "coords__50_7536__7_0827", "coords__51_4070__6_9656",
"coords__49_8421__7_8662", "coords__49_7410__7_1935",
"coords__51_1566__11_8182", "coords__51_4065__6_9660",
# "coords__50_7333__7_1000", "coords__50_0000__8_0000",
# "coords__48_7444__7_6000", "coords__51_0000__11_0000",
# "coords__52_7555__8_1000", "coords__50_0000__2_0000", # "coords__52_7555__8_1000", "coords__50_0000__2_0000",
# "coords__51_7666__8_6000", "coords__50_0000__3_0000", # "coords__51_7666__8_6000", "coords__50_0000__3_0000",
# "coords__45_7777__9_1000", "coords__50_0000__4_0000", # "coords__45_7777__9_1000", "coords__50_0000__4_0000",
], ],
# data_handler=DataHandlerWRF, data_handler=DataHandlerWRF,
data_handler=DataHandlerMainSectWRF, #, # data_handler=DataHandlerMainSectWRF, #,
data_path="/p/project/deepacf/inbound_data/IASS_upload/20??", data_path="/p/scratch/deepacf/kleinert1/IASS_proc_monthyl",
#data_path="/p/scratch/deepacf/kleinert1/IASS_proc",
#data_path="/p/project/deepacf/intelliaq/kleinert1/DATA/WRF_CHEM_soft_ln_small_test",
common_file_starter="wrfout_d01",
date_format_of_nc_file="%Y-%m",
time_dim='XTIME', time_dim='XTIME',
external_coords_file='/p/project/deepacf/inbound_data/IASS_upload/coords.nc', #external_coords_file='/p/project/deepacf/inbound_data/IASS_upload/coords.nc',
external_coords_file="/p/scratch/deepacf/kleinert1/IASS_proc/coords.nc",
transformation={ transformation={
"T2": {"method": "standardise"}, "T2": {"method": "standardise"},
"Q2": {"method": "standardise"}, "Q2": {"method": "standardise"},
...@@ -62,7 +75,7 @@ def main(parser_args): ...@@ -62,7 +75,7 @@ def main(parser_args):
'CLDFRA': {"method": "min_max"}, 'CLDFRA': {"method": "min_max"},
}, },
variables=['T2', 'o3', 'wdir10ll', 'wspd10ll', 'no', 'no2', 'co', 'PSFC', 'PBLH', 'CLDFRA'], variables=['T2', 'o3', 'wdir10ll', 'wspd10ll', 'no', 'no2', 'co', 'PSFC', 'PBLH', 'CLDFRA'],
target_var=['T2'], target_var='o3',
statistics_per_var={'T2': None, 'o3': None, 'wdir10ll': None, 'wspd10ll': None, statistics_per_var={'T2': None, 'o3': None, 'wdir10ll': None, 'wspd10ll': None,
'no': None, 'no2': None, 'co': None, 'PSFC': None, 'PBLH': None, 'CLDFRA': None, }, 'no': None, 'no2': None, 'co': None, 'PSFC': None, 'PBLH': None, 'CLDFRA': None, },
# variables=['T2', 'Q2', 'PBLH', 'U10ll', 'V10ll', 'wdir10ll', 'wspd10ll'], # variables=['T2', 'Q2', 'PBLH', 'U10ll', 'V10ll', 'wdir10ll', 'wspd10ll'],
...@@ -77,19 +90,41 @@ def main(parser_args): ...@@ -77,19 +90,41 @@ def main(parser_args):
radius=100, # km radius=100, # km
start='2009-01-01', start='2009-01-01',
end='2009-01-04', #end='2009-01-04',
#end='2009-01-31',
end='2009-03-31',
#train_start='2009-01-01',
#train_end='2009-01-02',
train_start='2009-01-01', train_start='2009-01-01',
train_end='2009-01-02', #train_end='2009-01-15',
train_end='2009-02-28',
val_start='2009-01-02', #val_start='2009-01-02',
val_end='2009-01-03', #val_end='2009-01-03',
###################################
#val_start='2009-01-15',
#val_end='2009-01-22',
###################################
val_start='2009-03-01',
val_end='2009-03-14',
test_start='2009-01-03', #test_start='2009-01-03',
test_end='2009-01-04', #test_end='2009-01-04',
###################################
#test_start='2009-01-22',
#test_end='2009-01-31',
###################################
test_start='2009-03-15',
test_end='2009-03-31',
sampling='hourly', sampling='hourly',
use_multiprocessing=False, use_multiprocessing=True,
interpolation_limit=0,
# as_image_like_data_format=False,
# model=MyLSTMModel,
model=MyCNNModel,
**parser_args.__dict__) **parser_args.__dict__)
workflow.run() workflow.run()
......
__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 DataHandlerWRF, DataHandlerMainSectWRF
from mlair.workflows import DefaultWorkflow
from mlair.helpers import remove_items
from mlair.configuration.defaults import DEFAULT_PLOT_LIST
from mlair.model_modules.model_class import MyPaperModel, MyLSTMModel, MyCNNModel, MyCNNModelSect
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"),
competitors=["baseline", "sector_baseline"],
competitor_path="/p/scratch/deepacf/kleinert1/IASS_proc_monthyl/competitors/o3",
train_min_length=1, val_min_length=1, test_min_length=1,
# data_handler=DataHandlerSingleStation,
# data_handler=DataHandlerSingleGridColumn,
epochs=1000,
window_lead_time=2,
window_history_size=6,
stations=["coords__48_8479__10_0963", "coords__51_8376__14_1417",
"coords__50_7536__7_0827", "coords__51_4070__6_9656",
"coords__49_8421__7_8662", "coords__49_7410__7_1935",
"coords__51_1566__11_8182", "coords__51_4065__6_9660",
# "coords__50_7333__7_1000", "coords__50_0000__8_0000",
# "coords__48_7444__7_6000", "coords__51_0000__11_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="/p/scratch/deepacf/kleinert1/IASS_proc_monthyl",
#data_path="/p/scratch/deepacf/kleinert1/IASS_proc",
#data_path="/p/project/deepacf/intelliaq/kleinert1/DATA/WRF_CHEM_soft_ln_small_test",
common_file_starter="wrfout_d01",
date_format_of_nc_file="%Y-%m",
time_dim='XTIME',
#external_coords_file='/p/project/deepacf/inbound_data/IASS_upload/coords.nc',
external_coords_file="/p/scratch/deepacf/kleinert1/IASS_proc/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='o3',
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},
wind_sectors=['N', 'NE', 'E', 'SE', 'S', 'SW', 'W', 'NW'],
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',
#end='2009-01-31',
end='2009-03-31',
#train_start='2009-01-01',
#train_end='2009-01-02',
train_start='2009-01-01',
#train_end='2009-01-15',
train_end='2009-02-28',
#val_start='2009-01-02',
#val_end='2009-01-03',
###################################
#val_start='2009-01-15',
#val_end='2009-01-22',
###################################
val_start='2009-03-01',
val_end='2009-03-14',
#test_start='2009-01-03',
#test_end='2009-01-04',
###################################
#test_start='2009-01-22',
#test_end='2009-01-31',
###################################
test_start='2009-03-15',
test_end='2009-03-31',
sampling='hourly',
use_multiprocessing=True,
interpolation_limit=0,
# as_image_like_data_format=False,
# model=MyLSTMModel,
model=MyCNNModelSect,
**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)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment