Skip to content

Commit

Permalink
fixed new balfrin paths + added RFO models as alias in rf_train.py
Browse files Browse the repository at this point in the history
  • Loading branch information
wolfidan committed Nov 7, 2024
1 parent 4735d92 commit 972dd73
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 8 deletions.
14 changes: 7 additions & 7 deletions rainforest/common/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -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])
Expand Down
17 changes: 16 additions & 1 deletion rainforest/ml/rf_train.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")

Expand Down Expand Up @@ -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)

Expand Down

0 comments on commit 972dd73

Please sign in to comment.