diff --git a/wetb/hawc2/hawc2_simulation.py b/wetb/hawc2/hawc2_simulation.py index 84b24285d0dd0d68ab96f5593bafffc7d5a76c92..f9b3f194b74828f5d533a04bf22d3541597cae86 100644 --- a/wetb/hawc2/hawc2_simulation.py +++ b/wetb/hawc2/hawc2_simulation.py @@ -493,9 +493,6 @@ class Hawc2_Simulation(object): if self.htcf is None: raise Exception('There is no simulation to load results from') - # Change to the htc directory - os.chdir(self.write_directory) - # load the results # Check if we need to load_dummy_results if force_load_dummy_results: @@ -532,6 +529,10 @@ class Hawc2_Simulation(object): self.results.load_dummy_data(sc_cnt,ch_cnt) self.using_dummy_results = True else: + + # Change to the htc directory + os.chdir(self.write_directory) + #print('MIMC about to load REAL results') file_name = self.htcf['output.filename.0'] self.results = ReadHawc2(file_name) diff --git a/wetb/hawc2/htc_contents.py b/wetb/hawc2/htc_contents.py index e635619862cd768760d5df1a2c3eac3800b62348..b19eb78a4b5a6c225b5ca3243b6abd971303d80a 100644 --- a/wetb/hawc2/htc_contents.py +++ b/wetb/hawc2/htc_contents.py @@ -1019,6 +1019,8 @@ class HTCSensor(HTCLine): return 5 elif self.sensor in ('state_at', 'state_at2'): return 7 + elif self.sensor in ('statevec_new'): + return 8 else: msg='Sensor "'+str(self.sns_type)+' '+str(self.sensor)+' ..." has not been defined in the parameter count function' raise Exception(msg) @@ -1147,7 +1149,7 @@ class HTCSensor(HTCLine): def has_only_option(self): if self.sns_type == 'mbdy': - if self.sensor in ('forcevec', 'momentvec', 'state', 'state_at', 'state_at2', 'state_rot'): + if self.sensor in ('forcevec', 'momentvec', 'state', 'state_at', 'state_at2', 'state_rot', 'statevec_new'): return True else: msg='Sensor "'+str(self.sns_type)+' '+str(self.sensor)+' ..." has not been defined in the has only option function' @@ -1218,6 +1220,8 @@ class HTCSensor(HTCLine): else: msg='Sensor "'+str(self.sns_type)+' '+str(self.sensor)+' '+str(self.values[0])+' ..." has not been defined in the sensor size function' raise Exception(msg) + elif self.sensor == 'statevec_new': + return 6 else: msg='Sensor "'+str(self.sns_type)+' '+str(self.sensor)+' ..." has not been defined in the sensor size function' raise Exception(msg) diff --git a/wetb/prepost/hawcstab2.py b/wetb/prepost/hawcstab2.py index 62f812f4b2002e50b1e6e6aa65af506da77611de..0112cdb3cb014775e6bf187f06ccf101cea64c9a 100644 --- a/wetb/prepost/hawcstab2.py +++ b/wetb/prepost/hawcstab2.py @@ -470,7 +470,7 @@ class ReadControlTuning(object): arr = np.loadtxt(fpath, skiprows=17) columns = ['theta', 'dq/dtheta', 'dq/dtheta_fit', 'dq/domega', 'dq/domega_fit'] - self.aero_gains = pd.DataFrame(arr, columns=columns) + self.aero_gains = pd.DataFrame(arr, columns=columns[:arr.shape[1]]) # set some parameters to zero for the linear case, or when aerodynamic # gain scheduling is not used diff --git a/wetb/prepost/misc.py b/wetb/prepost/misc.py index b6129907304a3cb7c58fef4cf63f0368315312eb..60ce298100b48891367038d4a66a1dbf8912c31a 100644 --- a/wetb/prepost/misc.py +++ b/wetb/prepost/misc.py @@ -741,7 +741,7 @@ def read_excel_files(proot, fext='xlsx', pignore=None, sheet=0, if fext == 'csv': df = pd.read_csv(f_target) else: - df = pd.read_excel(f_target, sheetname=sheet) + df = pd.read_excel(f_target, sheet_name=sheet) df_list[f_target.replace('.'+fext, '')] = df if not silent: print(': sucesfully included %i case(s)' % len(df))