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

add run script for wrf dh

parent 8a70118d
No related branches found
No related tags found
1 merge request!259Draft: Resolve "WRF-Datahandler should inherit from SingleStationDatahandler"
Pipeline #64880 passed with warnings
__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)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment