From 2cef6d92235a0b1053323c2c3f4a9a36a765aa6e Mon Sep 17 00:00:00 2001
From: David Robert Verelst <dave@dtu.dk>
Date: Wed, 3 May 2017 09:37:33 +0200
Subject: [PATCH] prepost.windIO: support harmonic channels for unique channel
 naming, fix bug in channel naming of flap angles

---
 wetb/prepost/windIO.py | 19 ++++++++++++++++++-
 1 file changed, 18 insertions(+), 1 deletion(-)

diff --git a/wetb/prepost/windIO.py b/wetb/prepost/windIO.py
index 03b8e9a2..742f242a 100755
--- a/wetb/prepost/windIO.py
+++ b/wetb/prepost/windIO.py
@@ -1215,7 +1215,6 @@ class LoadResults(ReadHawc2):
                 blade_nr = blade_nr.split(' ')[0].strip()
                 flap_nr = self.ch_details[ch, 2].split(' ')[-1].strip()
 
-                radius = radius.strip()
                 blade_nr = blade_nr.strip()
 
                 # and tag it
@@ -1228,6 +1227,24 @@ class LoadResults(ReadHawc2):
                 channelinfo['units'] = units
                 channelinfo['chi'] = ch
 
+            # harmonic channel output
+            # Harmonic
+            # Harmonic sinus function
+            elif self.ch_details[ch, 0][:7] == 'Harmoni':
+
+                func_name = ' '.join(self.ch_details[ch, 1].split(' ')[1:])
+
+                channelinfo = {}
+                channelinfo['output_type'] = func_name
+                channelinfo['sensortype'] = 'harmonic'
+                channelinfo['chi'] = ch
+
+                base = self.ch_details[ch,2].strip().lower().replace(' ', '_')
+                tag = base + '_0'
+                if tag in self.ch_dict:
+                    tag_nr = int(tag.split('_')[-1]) + 1
+                    tag = base + '_%i' % tag_nr
+
             # -----------------------------------------------------------------
             # ignore all the other cases we don't know how to deal with
             else:
-- 
GitLab