From 25900dbb4d5a31c8aca99718a449a13fdb4ff223 Mon Sep 17 00:00:00 2001 From: dzalkind Date: Wed, 3 Jan 2024 14:27:18 -0700 Subject: [PATCH] Fix more paths --- Examples/02_ccblade.py | 2 +- Examples/04_simple_sim.py | 6 +++--- Examples/07_openfast_outputs.py | 4 ++-- Examples/08_run_turbsim.py | 2 +- Examples/09_distributed_aero.py | 5 +++-- Examples/10_linear_params.py | 13 ++++++++----- Examples/11_robust_tuning.py | 4 ++-- Examples/12_tune_ipc.py | 3 +-- Examples/14_open_loop_control.py | 12 +++++++----- Examples/15_pass_through.py | 2 +- Examples/16_external_dll.py | 10 +++++----- Examples/18_pitch_offsets.py | 2 +- Examples/19_update_discon_version.py | 2 +- Examples/20_active_wake_control.py | 10 +++++----- Examples/21_optional_inputs.py | 6 +++--- Examples/22_cable_control.py | 4 ++-- Examples/23_structural_control.py | 4 ++-- Examples/24_floating_feedback.py | 8 ++++---- Examples/25_rotor_position_control.py | 8 ++++---- Examples/26_marine_hydro.py | 2 +- Examples/27_power_ref_control.py | 8 ++++---- Examples/28_tower_resonance.py | 4 ++-- rosco/toolbox/control_interface.py | 2 +- 23 files changed, 64 insertions(+), 59 deletions(-) diff --git a/Examples/02_ccblade.py b/Examples/02_ccblade.py index 4343448a..581603d7 100644 --- a/Examples/02_ccblade.py +++ b/Examples/02_ccblade.py @@ -37,7 +37,7 @@ turbine = ROSCO_turbine.Turbine(turbine_params) turbine.load_from_fast( path_params['FAST_InputFile'], - os.path.join(this_dir,path_params['FAST_directory']), + os.path.join(tune_dir,path_params['FAST_directory']), rot_source='cc-blade', txt_filename=None) diff --git a/Examples/04_simple_sim.py b/Examples/04_simple_sim.py index 23cdfa7b..b35d4312 100644 --- a/Examples/04_simple_sim.py +++ b/Examples/04_simple_sim.py @@ -43,11 +43,11 @@ os.makedirs(example_out_dir) if platform.system() == 'Windows': - lib_name = os.path.join(this_dir, '../ROSCO/build/libdiscon.dll') + lib_name = os.path.join(this_dir, '../rosco/controller/build/libdiscon.dll') elif platform.system() == 'Darwin': - lib_name = os.path.join(this_dir, '../ROSCO/build/libdiscon.dylib') + lib_name = os.path.join(this_dir, '../rosco/controller/build/libdiscon.dylib') else: - lib_name = os.path.join(this_dir, '../ROSCO/build/libdiscon.so') + lib_name = os.path.join(this_dir, '../rosco/controller/build/libdiscon.so') # # Load turbine model from saved pickle turbine = ROSCO_turbine.Turbine diff --git a/Examples/07_openfast_outputs.py b/Examples/07_openfast_outputs.py index 046007aa..7d34c041 100644 --- a/Examples/07_openfast_outputs.py +++ b/Examples/07_openfast_outputs.py @@ -8,7 +8,7 @@ - Trim the time series - Plot some available channels -Note: need to run openfast model in '../Test_Cases/5MW_Land_DLL_WTurb/' to plot +Note: need to run openfast model in 'Test_Cases/5MW_Land_DLL_WTurb/' to plot ''' # Python Modules @@ -24,7 +24,7 @@ os.makedirs(example_out_dir) # Define openfast output filenames -filenames = ["../Test_Cases/IEA-15-240-RWT-UMaineSemi/IEA-15-240-RWT-UMaineSemi.outb"] +filenames = ["Test_Cases/IEA-15-240-RWT-UMaineSemi/IEA-15-240-RWT-UMaineSemi.outb"] # ---- Note: Could load and plot multiple cases, textfiles, and binaries... # filenames = ["../Test_Cases/NREL-5MW/NREL-5MW.outb", # "../Test_Cases/NREL-5MW/NREL-5MW_ex8.outb"] diff --git a/Examples/08_run_turbsim.py b/Examples/08_run_turbsim.py index 15be9fd9..bbacb93e 100644 --- a/Examples/08_run_turbsim.py +++ b/Examples/08_run_turbsim.py @@ -14,7 +14,7 @@ this_dir = os.path.dirname(os.path.abspath(__file__)) # Define openfast output filenames -wind_directory = os.path.join(this_dir,'../Test_Cases/Wind/') +wind_directory = os.path.join(this_dir,'Test_Cases/Wind/') turbsim_infile = '90m_12mps_twr.inp' run_openfast(wind_directory, fastcall='turbsim', diff --git a/Examples/09_distributed_aero.py b/Examples/09_distributed_aero.py index c8c8f213..810de3f2 100644 --- a/Examples/09_distributed_aero.py +++ b/Examples/09_distributed_aero.py @@ -24,9 +24,10 @@ this_dir = os.path.dirname(os.path.abspath(__file__)) +tune_dir = os.path.join(this_dir,'Tune_Cases') # Load yaml file -parameter_filename = os.path.join(os.path.dirname(this_dir),'Tune_Cases/BAR.yaml') +parameter_filename = os.path.join(tune_dir,'BAR.yaml') inps = load_rosco_yaml(parameter_filename) path_params = inps['path_params'] turbine_params = inps['turbine_params'] @@ -36,7 +37,7 @@ turbine = ROSCO_turbine.Turbine(turbine_params) turbine.load_from_fast( path_params['FAST_InputFile'], - os.path.join(this_dir,path_params['FAST_directory']) + os.path.join(tune_dir,path_params['FAST_directory']) ) # Tune controller diff --git a/Examples/10_linear_params.py b/Examples/10_linear_params.py index 302e4f87..dc09aba6 100644 --- a/Examples/10_linear_params.py +++ b/Examples/10_linear_params.py @@ -19,16 +19,20 @@ import numpy as np +this_dir = os.path.dirname(os.path.abspath(__file__)) +tune_dir = os.path.join(this_dir,'Tune_Cases') + # Load yaml file -parameter_filename = os.path.join( os.path.dirname( os.path.dirname( os.path.realpath(__file__) )), - 'Tune_Cases', 'IEA15MW.yaml') +parameter_filename = os.path.join( tune_dir, 'IEA15MW.yaml') inps = load_rosco_yaml(parameter_filename) path_params = inps['path_params'] turbine_params = inps['turbine_params'] controller_params = inps['controller_params'] # Linear file output -this_dir = os.path.dirname(os.path.abspath(__file__)) + + +os.path.join(this_dir,path_params['FAST_directory']) example_out_dir = os.path.join(this_dir,'examples_out') if not os.path.isdir(example_out_dir): os.makedirs(example_out_dir) @@ -40,10 +44,9 @@ controller = ROSCO_controller.Controller(controller_params) # Load turbine data from OpenFAST and rotor performance text file -tune_dir = os.path.join(this_dir,'Tune_Cases') turbine.load_from_fast( path_params['FAST_InputFile'], - os.path.join(this_dir,path_params['FAST_directory']), + os.path.join(tune_dir,path_params['FAST_directory']), rot_source='txt', txt_filename=os.path.join(tune_dir,path_params['rotor_performance_filename']) ) diff --git a/Examples/11_robust_tuning.py b/Examples/11_robust_tuning.py index b3086895..14e238d8 100644 --- a/Examples/11_robust_tuning.py +++ b/Examples/11_robust_tuning.py @@ -28,7 +28,7 @@ def run_example(): # Shorthand directories this_dir = os.path.dirname(os.path.abspath(__file__)) tune_dir = os.path.join(this_dir, 'Tune_Cases') - test_dir = os.path.join(this_dir, '../Test_Cases') + test_dir = os.path.join(this_dir, 'Test_Cases') # ROSCO options parameter_filename = os.path.join(tune_dir, 'IEA15MW_robust.yaml') @@ -81,7 +81,7 @@ def run_example(): options['path_options'] = path_options options['opt_options'] = opt_options - options['linturb_options']['linfile_path'] = os.path.join(this_dir, options['linturb_options']['linfile_path']) + options['linturb_options']['linfile_path'] = os.path.join(tune_dir, options['linturb_options']['linfile_path']) # Run robust scheduling sd = rsched_driver(options) diff --git a/Examples/12_tune_ipc.py b/Examples/12_tune_ipc.py index 41c5ba15..f334720d 100644 --- a/Examples/12_tune_ipc.py +++ b/Examples/12_tune_ipc.py @@ -26,12 +26,11 @@ def main(): run_dir = os.path.join(example_out_dir, example_name) # Load yaml file (Open Loop Case) - parameter_filename = os.path.join(rosco_dir,'Tune_Cases/NREL2p8.yaml') + parameter_filename = os.path.join(this_dir,'Tune_Cases/NREL2p8.yaml') case_inputs = {} case_inputs[('ServoDyn','Ptch_Cntrl')] = {'vals': [1], 'group': 0} case_inputs[('DISCON_in','IPC_SatMode')] = {'vals': [0,1,2,3], 'group': 1} - # simulation set up diff --git a/Examples/14_open_loop_control.py b/Examples/14_open_loop_control.py index 663a8eb8..970ce99b 100644 --- a/Examples/14_open_loop_control.py +++ b/Examples/14_open_loop_control.py @@ -28,6 +28,8 @@ this_dir = os.path.dirname(os.path.abspath(__file__)) +tune_dir = os.path.join(this_dir,'Tune_Cases') + rosco_dir = os.path.dirname(this_dir) example_out_dir = os.path.join(this_dir,'examples_out') example_out_dir = os.path.join(this_dir,'examples_out') @@ -35,7 +37,7 @@ os.makedirs(example_out_dir) # Load yaml file (Open Loop Case) -parameter_filename = os.path.join(rosco_dir,'Tune_Cases/IEA15MW_OL.yaml') +parameter_filename = os.path.join(tune_dir, 'IEA15MW_OL.yaml') inps = load_rosco_yaml(parameter_filename) path_params = inps['path_params'] @@ -75,9 +77,9 @@ # Load turbine data from OpenFAST and rotor performance text file turbine.load_from_fast(path_params['FAST_InputFile'], \ - os.path.join(this_dir,path_params['FAST_directory']), \ + os.path.join(tune_dir,path_params['FAST_directory']), \ rot_source='txt',\ - txt_filename=os.path.join(this_dir,path_params['rotor_performance_filename'])) + txt_filename=os.path.join(tune_dir,path_params['rotor_performance_filename'])) # Tune controller controller.tune_controller(turbine) @@ -103,7 +105,7 @@ discon_vt = ROSCO_utilities.DISCON_dict( turbine, controller, -txt_filename=os.path.join(this_dir,path_params['FAST_directory'],path_params['rotor_performance_filename']) +txt_filename=os.path.join(tune_dir,path_params['FAST_directory'],path_params['rotor_performance_filename']) ) for discon_input in discon_vt: case_inputs[('DISCON_in',discon_input)] = {'vals': [discon_vt[discon_input]], 'group': 0} @@ -124,7 +126,7 @@ # Run FAST cases fastBatch = runFAST_pywrapper_batch() -fastBatch.FAST_directory = os.path.realpath(os.path.join(rosco_dir,'Tune_Cases',path_params['FAST_directory'])) +fastBatch.FAST_directory = os.path.realpath(os.path.join(tune_dir,path_params['FAST_directory'])) fastBatch.FAST_InputFile = path_params['FAST_InputFile'] fastBatch.channels = channels fastBatch.FAST_runDirectory = run_dir diff --git a/Examples/15_pass_through.py b/Examples/15_pass_through.py index a58a3c9b..c0b7916d 100644 --- a/Examples/15_pass_through.py +++ b/Examples/15_pass_through.py @@ -24,7 +24,7 @@ def main(): # Simulation config r = run_FAST_ROSCO() - parameter_filename = os.path.join(rosco_dir,'Tune_Cases/NREL5MW_PassThrough.yaml') + parameter_filename = os.path.join(this_dir,'Tune_Cases/NREL5MW_PassThrough.yaml') run_dir = os.path.join(example_out_dir,'15_PassThrough') os.makedirs(run_dir,exist_ok=True) diff --git a/Examples/16_external_dll.py b/Examples/16_external_dll.py index a6c774d9..162694bb 100644 --- a/Examples/16_external_dll.py +++ b/Examples/16_external_dll.py @@ -20,11 +20,11 @@ os.makedirs(example_out_dir,exist_ok=True) if platform.system() == 'Windows': - lib_name = os.path.realpath(os.path.join(this_dir, '../ROSCO/build/libdiscon.dll')) + lib_name = os.path.realpath(os.path.join(this_dir, '../rosco/controller/build/libdiscon.dll')) elif platform.system() == 'Darwin': - lib_name = os.path.realpath(os.path.join(this_dir, '../ROSCO/build/libdiscon.dylib')) + lib_name = os.path.realpath(os.path.join(this_dir, '../rosco/controller/build/libdiscon.dylib')) else: - lib_name = os.path.realpath(os.path.join(this_dir, '../ROSCO/build/libdiscon.so')) + lib_name = os.path.realpath(os.path.join(this_dir, '../rosco/controller/build/libdiscon.so')) def main(): @@ -36,7 +36,7 @@ def main(): # Ensure external control paths are okay - parameter_filename = os.path.join(rosco_dir,'Tune_Cases/IEA15MW_ExtInterface.yaml') + parameter_filename = os.path.join(this_dir,'Tune_Cases/IEA15MW_ExtInterface.yaml') run_dir = os.path.join(example_out_dir,'16_ExtInterface') os.makedirs(run_dir,exist_ok=True) @@ -44,7 +44,7 @@ def main(): controller_params = {} controller_params['DISCON'] = {} controller_params['DISCON']['DLL_FileName'] = copy_lib - controller_params['DISCON']['DLL_InFile'] = os.path.join(rosco_dir,'Test_Cases/NREL-5MW/DISCON.IN') + controller_params['DISCON']['DLL_InFile'] = os.path.join(this_dir,'Test_Cases/NREL-5MW/DISCON.IN') controller_params['DISCON']['DLL_ProcName'] = 'DISCON' # simulation set up diff --git a/Examples/18_pitch_offsets.py b/Examples/18_pitch_offsets.py index 8b76176e..a30628f1 100644 --- a/Examples/18_pitch_offsets.py +++ b/Examples/18_pitch_offsets.py @@ -31,7 +31,7 @@ def main(): # Input yaml and output directory - parameter_filename = os.path.join(rosco_dir,'Tune_Cases/IEA15MW.yaml') + parameter_filename = os.path.join(this_dir,'Tune_Cases/IEA15MW.yaml') run_dir = os.path.join(example_out_dir,'18_PitchFaults') os.makedirs(run_dir,exist_ok=True) diff --git a/Examples/19_update_discon_version.py b/Examples/19_update_discon_version.py index 66659ea4..e4cd2960 100644 --- a/Examples/19_update_discon_version.py +++ b/Examples/19_update_discon_version.py @@ -16,7 +16,7 @@ def main(): old_discon_filename = os.path.join(this_dir,'example_inputs','DISCON_v2.2.0.IN') # An IEA-15MW input # Tuning yaml can be anything, does not have to correspond to old discon - tuning_yaml = os.path.join(rosco_dir,'Tune_Cases','NREL5MW.yaml') # dummy for now + tuning_yaml = os.path.join(this_dir,'Tune_Cases','NREL5MW.yaml') # dummy for now update_discon_version( old_discon_filename, tuning_yaml, diff --git a/Examples/20_active_wake_control.py b/Examples/20_active_wake_control.py index 4405ee46..795955aa 100644 --- a/Examples/20_active_wake_control.py +++ b/Examples/20_active_wake_control.py @@ -170,22 +170,22 @@ os.makedirs(example_out_dir,exist_ok=True) if platform.system() == 'Windows': - lib_name = os.path.realpath(os.path.join(this_dir, '../ROSCO/build/libdiscon.dll')) + lib_name = os.path.realpath(os.path.join(this_dir, '../rosco/controller/build/libdiscon.dll')) elif platform.system() == 'Darwin': - lib_name = os.path.realpath(os.path.join(this_dir, '../ROSCO/build/libdiscon.dylib')) + lib_name = os.path.realpath(os.path.join(this_dir, '../rosco/controller/build/libdiscon.dylib')) else: - lib_name = os.path.realpath(os.path.join(this_dir, '../ROSCO/build/libdiscon.so')) + lib_name = os.path.realpath(os.path.join(this_dir, '../rosco/controller/build/libdiscon.so')) def main(): # Input yaml and output directory - parameter_filename = os.path.join(rosco_dir,'Tune_Cases/NREL2p8.yaml') # will be dummy and overwritten with SNL DISCON params + parameter_filename = os.path.join(this_dir,'Tune_Cases/NREL2p8.yaml') # will be dummy and overwritten with SNL DISCON params run_dir = os.path.join(example_out_dir,'20_active_wake_control/all_cases') os.makedirs(run_dir,exist_ok=True) # Read all DISCON inputs - rosco_vt = read_DISCON(os.path.join(rosco_dir,'Test_Cases','NREL_2p8_127/NREL-2p8-127_DISCON.IN')) + rosco_vt = read_DISCON(os.path.join(this_dir,'Test_Cases','NREL_2p8_127/NREL-2p8-127_DISCON.IN')) # Apply all discon variables as case inputs control_base_case = {} diff --git a/Examples/21_optional_inputs.py b/Examples/21_optional_inputs.py index 393f3bbc..84e2efc6 100644 --- a/Examples/21_optional_inputs.py +++ b/Examples/21_optional_inputs.py @@ -22,11 +22,11 @@ def main(): # Set up rosco_dll if platform.system() == 'Windows': - rosco_dll = os.path.join(rosco_dir, 'ROSCO/build/libdiscon.dll') + rosco_dll = os.path.join(rosco_dir, 'rosco/controller/build/libdiscon.dll') elif platform.system() == 'Darwin': - rosco_dll = os.path.join(rosco_dir, 'ROSCO/build/libdiscon.dylib') + rosco_dll = os.path.join(rosco_dir, 'rosco/controller/build/libdiscon.dylib') else: - rosco_dll = os.path.join(rosco_dir, 'ROSCO/build/libdiscon.so') + rosco_dll = os.path.join(rosco_dir, 'rosco/controller/build/libdiscon.so') # Load turbine model from saved pickle turbine = ROSCO_turbine.Turbine diff --git a/Examples/22_cable_control.py b/Examples/22_cable_control.py index 7b7c344b..c56ee9db 100644 --- a/Examples/22_cable_control.py +++ b/Examples/22_cable_control.py @@ -38,7 +38,7 @@ def main(): # Input yaml and output directory - parameter_filename = os.path.join(rosco_dir,'Tune_Cases/IEA15MW_cable.yaml') + parameter_filename = os.path.join(this_dir,'Tune_Cases/IEA15MW_cable.yaml') run_dir = os.path.join(example_out_dir,'22_cable_control') os.makedirs(run_dir,exist_ok=True) @@ -49,7 +49,7 @@ def main(): # Change inputs programatically, read first reader = InputReader_OpenFAST() reader.FAST_InputFile = path_params['FAST_InputFile'] - reader.FAST_directory = os.path.join(rosco_dir,'Tune_Cases',path_params['FAST_directory']) + reader.FAST_directory = os.path.join(this_dir,'Tune_Cases',path_params['FAST_directory']) reader.execute() # Set control line mapping (ChannelID -> Line(s)) diff --git a/Examples/23_structural_control.py b/Examples/23_structural_control.py index 5600d905..7e12a22d 100644 --- a/Examples/23_structural_control.py +++ b/Examples/23_structural_control.py @@ -46,7 +46,7 @@ def main(): # Input yaml and output directory - parameter_filename = os.path.join(rosco_dir,'Tune_Cases/IEA15MW_ballast.yaml') + parameter_filename = os.path.join(this_dir,'Tune_Cases/IEA15MW_ballast.yaml') run_dir = os.path.join(example_out_dir,'23_structural_control') os.makedirs(run_dir,exist_ok=True) @@ -57,7 +57,7 @@ def main(): # Change inputs programatically, read first reader = InputReader_OpenFAST() reader.FAST_InputFile = path_params['FAST_InputFile'] - reader.FAST_directory = os.path.join(rosco_dir,'Tune_Cases',path_params['FAST_directory']) + reader.FAST_directory = os.path.join(this_dir,'Tune_Cases',path_params['FAST_directory']) # reader.FAST_directory = '/Users/dzalkind/Tools/ROSCO1/Test_Cases/ptfm_control_archive/IEA-15-240-RWT-UMaineSemi_ballast' reader.execute() diff --git a/Examples/24_floating_feedback.py b/Examples/24_floating_feedback.py index 38b67056..6d802f93 100644 --- a/Examples/24_floating_feedback.py +++ b/Examples/24_floating_feedback.py @@ -34,17 +34,17 @@ os.makedirs(example_out_dir,exist_ok=True) if platform.system() == 'Windows': - lib_name = os.path.realpath(os.path.join(this_dir, '../ROSCO/build/libdiscon.dll')) + lib_name = os.path.realpath(os.path.join(this_dir, '../rosco/controller/build/libdiscon.dll')) elif platform.system() == 'Darwin': - lib_name = os.path.realpath(os.path.join(this_dir, '../ROSCO/build/libdiscon.dylib')) + lib_name = os.path.realpath(os.path.join(this_dir, '../rosco/controller/build/libdiscon.dylib')) else: - lib_name = os.path.realpath(os.path.join(this_dir, '../ROSCO/build/libdiscon.so')) + lib_name = os.path.realpath(os.path.join(this_dir, '../rosco/controller/build/libdiscon.so')) def main(): # Input yaml and output directory - parameter_filename = os.path.join(rosco_dir,'Tune_Cases/IEA15MW.yaml') + parameter_filename = os.path.join(this_dir,'Tune_Cases/IEA15MW.yaml') run_dir = os.path.join(example_out_dir,'24_floating_feedback') os.makedirs(run_dir,exist_ok=True) diff --git a/Examples/25_rotor_position_control.py b/Examples/25_rotor_position_control.py index 4b840767..fd0e0d2b 100644 --- a/Examples/25_rotor_position_control.py +++ b/Examples/25_rotor_position_control.py @@ -23,17 +23,17 @@ os.makedirs(example_out_dir,exist_ok=True) if platform.system() == 'Windows': - lib_name = os.path.realpath(os.path.join(this_dir, '../ROSCO/build/libdiscon.dll')) + lib_name = os.path.realpath(os.path.join(this_dir, '../rosco/controller/build/libdiscon.dll')) elif platform.system() == 'Darwin': - lib_name = os.path.realpath(os.path.join(this_dir, '../ROSCO/build/libdiscon.dylib')) + lib_name = os.path.realpath(os.path.join(this_dir, '../rosco/controller/build/libdiscon.dylib')) else: - lib_name = os.path.realpath(os.path.join(this_dir, '../ROSCO/build/libdiscon.so')) + lib_name = os.path.realpath(os.path.join(this_dir, '../rosco/controller/build/libdiscon.so')) def main(): # Set up paths - parameter_filename = os.path.join(rosco_dir,'Tune_Cases/NREL2p8.yaml') + parameter_filename = os.path.join(this_dir,'Tune_Cases/NREL2p8.yaml') run_dir = os.path.join(example_out_dir,'25_rotor_position_control') os.makedirs(run_dir,exist_ok=True) diff --git a/Examples/26_marine_hydro.py b/Examples/26_marine_hydro.py index 1aba1b57..595249bc 100644 --- a/Examples/26_marine_hydro.py +++ b/Examples/26_marine_hydro.py @@ -32,7 +32,7 @@ def main(): # Input yaml and output directory - parameter_filename = os.path.join(rosco_dir,'Tune_Cases/RM1_MHK.yaml') + parameter_filename = os.path.join(this_dir,'Tune_Cases/RM1_MHK.yaml') run_dir = os.path.join(example_out_dir,'26_MHK/0_baseline') os.makedirs(run_dir,exist_ok=True) diff --git a/Examples/27_power_ref_control.py b/Examples/27_power_ref_control.py index e5f0b1ba..73831607 100644 --- a/Examples/27_power_ref_control.py +++ b/Examples/27_power_ref_control.py @@ -31,17 +31,17 @@ os.makedirs(example_out_dir,exist_ok=True) if platform.system() == 'Windows': - lib_name = os.path.realpath(os.path.join(this_dir, '../ROSCO/build/libdiscon.dll')) + lib_name = os.path.realpath(os.path.join(this_dir, '../rosco/controller/build/libdiscon.dll')) elif platform.system() == 'Darwin': - lib_name = os.path.realpath(os.path.join(this_dir, '../ROSCO/build/libdiscon.dylib')) + lib_name = os.path.realpath(os.path.join(this_dir, '../rosco/controller/build/libdiscon.dylib')) else: - lib_name = os.path.realpath(os.path.join(this_dir, '../ROSCO/build/libdiscon.so')) + lib_name = os.path.realpath(os.path.join(this_dir, '../rosco/controller/build/libdiscon.so')) def main(): # Input yaml and output directory - parameter_filename = os.path.join(rosco_dir,'Tune_Cases/IEA15MW.yaml') + parameter_filename = os.path.join(this_dir,'Tune_Cases/IEA15MW.yaml') run_dir = os.path.join(example_out_dir,'27_PRC_0') os.makedirs(run_dir,exist_ok=True) diff --git a/Examples/28_tower_resonance.py b/Examples/28_tower_resonance.py index bfd2937d..b4fc3319 100644 --- a/Examples/28_tower_resonance.py +++ b/Examples/28_tower_resonance.py @@ -36,7 +36,7 @@ def main(): # Input yaml and output directory - parameter_filename = os.path.join(rosco_dir,'Tune_Cases/IEA15MW.yaml') + parameter_filename = os.path.join(this_dir,'Tune_Cases/IEA15MW.yaml') run_dir = os.path.join(example_out_dir,'28_TRA_Ramp_0') os.makedirs(run_dir,exist_ok=True) @@ -47,7 +47,7 @@ def main(): reader = InputReader_OpenFAST() reader.FAST_InputFile = path_params['FAST_InputFile'] - reader.FAST_directory = os.path.join(rosco_dir,'Tune_Cases',path_params['FAST_directory']) + reader.FAST_directory = os.path.join(this_dir,'Tune_Cases',path_params['FAST_directory']) # reader.FAST_directory = '/Users/dzalkind/Tools/ROSCO1/Test_Cases/ptfm_control_archive/IEA-15-240-RWT-UMaineSemi_ballast' reader.execute() diff --git a/rosco/toolbox/control_interface.py b/rosco/toolbox/control_interface.py index e2c83866..32cc709b 100644 --- a/rosco/toolbox/control_interface.py +++ b/rosco/toolbox/control_interface.py @@ -337,7 +337,7 @@ class wfc_zmq_server: # Read the interface file to obtain the structure of measurements and setpoints interface_file = os.path.realpath( os.path.join( - os.path.dirname(__file__), "../ROSCO/rosco_registry/wfc_interface.yaml" + os.path.dirname(__file__), "../controller/rosco_registry/wfc_interface.yaml" ) ) wfc_interface = load_yaml(interface_file)