diff --git a/wetb/hawc2/tests/test_files/hawc2io/hawc2ascii_chantest_1.sel b/wetb/hawc2/tests/test_files/hawc2io/hawc2ascii_chantest_1.sel index d308e5fc7fd23d4cb1ee3780c923e37ad34df6c1..f7fb5e595aae1ac2f18e4890838e0fff236df537 100755 --- a/wetb/hawc2/tests/test_files/hawc2io/hawc2ascii_chantest_1.sel +++ b/wetb/hawc2/tests/test_files/hawc2io/hawc2ascii_chantest_1.sel @@ -6,7 +6,7 @@ ________________________________________________________________________________ Result file : res/dlc12_wsp07_wdir000_s1004.dat ________________________________________________________________________________________________________________________ Scans Channels Time [sec] Format - 25000 422 500.000 ASCII + 25000 425 500.000 ASCII Channel Variable Description @@ -432,4 +432,7 @@ ________________________________________________________________________________ 420 Cl, R= 75.5 deg Cl of blade 1 at radius 74.64 421 Cl, R= 80.4 deg Cl of blade 1 at radius 80.30 422 qwerty is azerty + 423 wake 1 gl. pos pos_x m Wake pos_x of source 1, Met. coo. + 424 wake 2 gl. pos pos_y m Wake pos_y of source 2, Met. coo. + 425 wake 5 gl. pos pos_z m Wake pos_z of source 5, Met. coo. ________________________________________________________________________________________________________________________ diff --git a/wetb/prepost/tests/test_windIO.py b/wetb/prepost/tests/test_windIO.py index 5c2a9bec3cfd73d0edf35e376580e3ff958d9664..e73f02ff0bf54ed246f674dd11c77a0121449aef 100644 --- a/wetb/prepost/tests/test_windIO.py +++ b/wetb/prepost/tests/test_windIO.py @@ -198,7 +198,7 @@ class TestsLoadResults(unittest.TestCase): # --------------------------------------------------------------------- res = windIO.LoadResults(self.respath, self.f1_chant, readdata=False) self.assertFalse(hasattr(res, 'sig')) - np.testing.assert_array_equal(res.ch_df.index.values, np.arange(0,422)) + np.testing.assert_array_equal(res.ch_df.index.values, np.arange(0,425)) self.assertEqual(res.ch_df.unique_ch_name.values[0], 'Time') df = res.ch_df self.assertEqual(2, len(df[df['bearing_name']=='shaft_rot'])) @@ -209,7 +209,10 @@ class TestsLoadResults(unittest.TestCase): [200, 'blade2-blade2-node-017-momentvec-z', 'kNm'], [296, 'blade1-blade1-node-008-forcevec-z', 'kN'], [415, 'Cl-1-54.82', 'deg'], - [421, 'qwerty-is-azerty', 'is'] + [421, 'qwerty-is-azerty', 'is'], + [422, 'wind_wake-wake_pos_x_1', 'm'], + [423, 'wind_wake-wake_pos_y_2', 'm'], + [424, 'wind_wake-wake_pos_z_5', 'm'], ] for k in exp: self.assertEqual(df.loc[k[0], 'unique_ch_name'], k[1]) diff --git a/wetb/prepost/windIO.py b/wetb/prepost/windIO.py index ec154351105a5ba1dbabd000dd459cc12c723c20..557da7527e45bdf117378f6f281af101f1b0ff2b 100755 --- a/wetb/prepost/windIO.py +++ b/wetb/prepost/windIO.py @@ -540,7 +540,7 @@ class LoadResults(ReadHawc2): cols = set(['bearing_name', 'sensortag', 'bodyname', 'chi', 'component', 'pos', 'coord', 'sensortype', 'radius', 'blade_nr', 'units', 'output_type', 'io_nr', 'io', 'dll', 'azimuth', 'flap_nr', - 'direction']) + 'direction', 'wake_source_nr']) # start with reading the .sel file, containing the info regarding # how to read the binary file and the channel information @@ -1291,6 +1291,22 @@ class LoadResults(ReadHawc2): channelinfo['sensortype'] = 'aero' tag = 'aero-induc_a_norm' + # wake 1 gl. pos pos_z // Wake pos_z of source 1, Met. coo. + elif self.ch_details[ch, 0][:4] == 'wake': + wake_nr = re.search(r'\d+', self.ch_details[ch,0]).group() + comp = re.search(r'pos_([xyz])', self.ch_details[ch,0]).group(1) + + channelinfo = {} + channelinfo['output_type'] = 'wake_pos' + channelinfo['sensortype'] = 'wind_wake' + channelinfo['component'] = comp + channelinfo['units'] = self.ch_details[ch, 1].strip() + channelinfo['chi'] = ch + channelinfo['wake_source_nr'] = int(wake_nr) + channelinfo['coord'] = 'met' + + tag = 'wind_wake-wake_pos_%s_%s' % (comp, wake_nr) + # ----------------------------------------------------------------- # If all this fails, just combine channel name and description else: