From 972dd73474475acf5d945441dd8e0bbfb609a2d0 Mon Sep 17 00:00:00 2001 From: Daniel Wolfensberger Date: Thu, 7 Nov 2024 11:09:47 +0100 Subject: [PATCH] fixed new balfrin paths + added RFO models as alias in rf_train.py --- rainforest/common/constants.py | 14 +++++++------- rainforest/ml/rf_train.py | 17 ++++++++++++++++- 2 files changed, 23 insertions(+), 8 deletions(-) diff --git a/rainforest/common/constants.py b/rainforest/common/constants.py index fd9a83a..e48213b 100644 --- a/rainforest/common/constants.py +++ b/rainforest/common/constants.py @@ -254,20 +254,20 @@ if ('lom' in socket.gethostname()) or ('meteoswiss' in socket.gethostname()): FOLDER_RADAR = '/srn/data/' FOLDER_ISO0 = '/srn/data/HZT/' -elif 'tsa' in socket.gethostname(): - FOLDER_DATABASE = '/store/msrad/radar/radar_database/' - FOLDER_RADAR = '/store/msrad/radar/swiss/data/' - FOLDER_RADARH = '/store/msrad/radar/polarHR/data/' - FOLDER_CPCCV = '/store/msrad/radar/cpc_validation/daily/' +elif 'balfrin' in socket.gethostname(): + FOLDER_DATABASE = '/store_new/mch/msrad/radar/radar_database/' + FOLDER_RADAR = '/store_new/mch/msrad/radar/swiss/data/' + FOLDER_RADARH = '/store_new/mch/msrad/radar/polarHR/data/' + FOLDER_CPCCV = '/store_new/mch/msrad/radar/cpc_validation/daily/' - FOLDER_ISO0 = '/store/msrad/radar/swiss/data/' + FOLDER_ISO0 = '/store_new/mch/msrad/radar/swiss/data/' COSMO1_START = datetime.datetime(2015,10,1) COSMO1E_START = datetime.datetime(2019,7,2) FOLDER_COSMO1 = '/store/s83/owm/COSMO-1/' FOLDER_COSMO1E = '/store/s83/osm/KENDA-1/' FOLDER_COSMO1_T = '/store/s83/owm/COSMO-1/ORDERS/MDR/' FOLDER_COSMO1E_T = '/store/s83/osm/COSMO-1E/ORDERS/MDR/' - FOLDER_COSMO2_T = '/store/msrad/cosmo/cosmo2/data/' + FOLDER_COSMO2_T = '/store_new/mch/msrad/cosmo/cosmo2/data/' FILES_COSMO1_T = sorted(glob.glob(FOLDER_COSMO1_T + '*.nc')) TIMES_COSMO1_T = np.array([datetime.datetime.strptime(f[-13:-3],'%Y%m%d%H') for f in FILES_COSMO1_T]) diff --git a/rainforest/ml/rf_train.py b/rainforest/ml/rf_train.py index 9bea46d..1b13e86 100755 --- a/rainforest/ml/rf_train.py +++ b/rainforest/ml/rf_train.py @@ -59,10 +59,13 @@ def main(): ', for example \'{"RF_dualpol": ["RADAR", "zh_VISIB_mean", "zv_VISIB_mean","KDP_mean","RHOHV_mean","T", "HEIGHT","VISIB_mean"]}\'' + ', please note the double and single quotes, which are required' + 'IMPORTANT: if no model is provided only the ml input data will be recomputed from the database, but no model will be computed'+ - 'To simplify three aliases are proposed: ' + + 'To simplify six aliases are proposed: ' + '"dualpol_default" = \'{"RF_dualpol": ["RADAR", "zh_VISIB_mean", "zv_VISIB_mean","KDP_mean","RHOHV_mean","SW_mean", "T", "HEIGHT","VISIB_mean"]}\'' + '"vpol_default" = \'{"RF_vpol": ["RADAR", "zv_VISIB_mean","SW_mean", "T", "HEIGHT","VISIB_mean"]}\'' + '"hpol_default" = \'{"RF_hpol": ["RADAR", "zh_VISIB_mean","SW_mean", "T", "HEIGHT","VISIB_mean"]}\'' + + '"RFO" = \'{"RF_dualpol": ["RADAR", "zh_VISIB_mean", "zv_VISIB_mean","KDP_mean","RHOHV_mean","SW_mean", "HISO", "HEIGHT","VISIB_mean"]}\'' + + '"RFO_vpol" = \'{"RF_vpol": ["RADAR", "zv_VISIB_mean","SW_mean", "HISO", "HEIGHT","VISIB_mean"]}\'' + + '"RFO_hpol" = \'{"RF_hpol": ["RADAR", "zh_VISIB_mean","SW_mean", "HISO", "HEIGHT","VISIB_mean"]}\'' + 'You can combine them for example "vpol_default, hpol_default, dualpol_default, will compute all three"', metavar="MODELS") @@ -116,6 +119,18 @@ def main(): elif opt == 'vpol_default': dic_models['RF_hpol'] = ["RADAR", "zv_VISIB_mean","SW_mean","T", "HEIGHT","VISIB_mean"] + elif opt == 'RFO': + dic_models['RFO'] = ["RADAR", "zh_VISIB_mean", + "zv_VISIB_mean","KDP_mean", + "RHOHV_mean","SW_mean","HISO", + "HEIGHT","VISIB_mean"] + elif opt == 'RFO_hpol': + dic_models['RFO_hpol'] = ["RADAR", "zh_VISIB_mean","SW_mean","HISO", + "HEIGHT","VISIB_mean"] + elif opt == 'RFO_vpol': + dic_models['RFO_hpol'] = ["RADAR", "zv_VISIB_mean","SW_mean","HISO", + "HEIGHT","VISIB_mean"] + else: dic_models = json.loads(options.models)