diff --git a/docs/tutorials/1-creating-master-excel.md b/docs/tutorials/1-creating-master-excel.md index 75a6cdae40104c74d515e16cc22c648413224bad..4edf95f652a467ad148f7c9356b7ab14a95b9b57 100644 --- a/docs/tutorials/1-creating-master-excel.md +++ b/docs/tutorials/1-creating-master-excel.md @@ -86,13 +86,15 @@ Generate the master Excel file in a few easy steps: the Wind Energy Toolbox tutorials directory. 3. From a terminal/command window, run the code to generate the Excel file from a folder of text files: - * Windows: + * Windows (from the wetb tutorials folder): ```python ..\..\wetb\prepost\write_master.py --folder data\DLCs_onshore --filename DLCs_onshore.xlsx``` - * Mac/Linux: + * Mac/Linux (from the wetb tutorials folder): ```python ../../wetb/prepost/write_master.py --folder data/DLCs_onshore --filename DLCs_onshore.xlsx``` - * Gorm: - ```python /home/MET/repositories/toolbox/WindEnergyToolbox/wetb/prepost/write_master.py --folder /home/MET/repositories/toolbox/WindEnergyToolbox/wetb/docs/tutoria -ls/data/DLCs_onshore --filename DLCs_onshore.xlsx``` + * Gorm (from any folder that contains a subfolder with your text files. Note +you must activate the wetb environment (see Step 5 [here](https://gitlab.windenergy.dtu.dk/toolbox/WindEnergyToolbox/blob/master/docs/getting-started-with-dlbs.md) +) before this command will work. This command also assumes the folder with your +text files is called "DLCs_onshore" and is located in the working directory.): + ```python /home/MET/repositories/toolbox/WindEnergyToolbox/wetb/prepost/write_master.py --folder ./DLCs_onshore --filename ./DLCs_onshore.xlsx``` The master Excel file "DLCs_onshore.xlsx" should now be in the your current directory. diff --git a/wetb/prepost/dlcdefs.py b/wetb/prepost/dlcdefs.py index dc841db803f5528e97b207823fe2b6bfb2f80e70..06ff6d3b35c8c8047e011888a7d4ed0fbb241b1e 100644 --- a/wetb/prepost/dlcdefs.py +++ b/wetb/prepost/dlcdefs.py @@ -169,24 +169,32 @@ def vartag_excel_stabcon(master): return master print('creating hydro input file for: %s.inp\n' % mt['[hydro input name]']) + mt['[wdepth]'] = float(mt['[wdepth]']) mt['[Hs]'] = float(mt['[Hs]']) mt['[Tp]'] = float(mt['[Tp]']) - + + if '[wave_gamma]' not in mt or not mt['[wave_gamma]']: mt['[wave_gamma]'] = 3.3 + else: + mt['[wave_gamma]'] = float(mt['[wave_gamma]']) if '[wave_coef]' not in mt or not mt['[wave_coef]']: mt['[wave_coef]'] = 200 + else: + mt['[wave_coef]'] = int(mt['[wave_coef]']) if '[stretching]' not in mt or not mt['[stretching]']: mt['[stretching]'] = 1 - - if mt['[wave_seed]'] is not False: - mt['[wave_seed]'] = int(mt['[wave_seed]']) else: - mt['[wave_seed]'] = int(mt['[seed]']) + mt['[stretching]'] = int(mt['[stretching]']) + if '[wave_seed]' not in mt or not mt['[wave_seed]']: + mt['[wave_seed]'] = int(mt['[seed]']) + else: + mt['[wave_seed]'] = int(mt['[wave_seed]']) + try: embed_sf = float(master.tags['[embed_sf]']) embed_sf_t0 = int(master.tags['[t0]']) + 20