The problem occur at line 'tmp = self.ch_details[ch, 2].split('pos')[1]' in windIO.py when we use new wind output at body (e.g. mbdy wind body_name el_number relative_dist global x_offset y_offset).
There is no 'pos' anymore in 'ch_details[ch, 2]' with new output channel.
Designs
Child items ...
Show closed items
Linked items 0
Link issues together to show that they're related.
Learn more.
# WIND SPEED # WSP gl. coo.,Vx # Free wind speed Vx, gl. coo, of gl. pos 0.00, 0.00, -6.00 LABEL elif (self.ch_details[ch, 0].startswith('WSP gl.') and len(self.ch_details[ch, 2].split('pos'))> 1): units = self.ch_details[ch, 1] direction = self.ch_details[ch, 0].split(',')[1] tmp = self.ch_details[ch, 2].split('pos')[1] x, y, z = tmp.split(',') x, y, z = x.strip(), y.strip(), z.strip() tmp = z.split(' ') sensortag = '' if len(tmp) == 2: z, sensortag = tmp elif len(tmp) == 1: z = tmp[0] # and tag it tag = 'windspeed-global-%s-%s-%s-%s' % (direction, x, y, z) # save all info in the dict channelinfo = {} channelinfo['coord'] = 'global' channelinfo['pos'] = (float(x), float(y), float(z)) channelinfo['units'] = units channelinfo['chi'] = ch channelinfo['sensortag'] = sensortag # FIXME: direction is the same as component, right? channelinfo['direction'] = direction channelinfo['sensortype'] = 'wsp-global' # ----------------------------------------------------------------- # WIND SPEED at body output # WSP gl. coo.,Vx # Global wind speed Vx, at body body_name LABEL elif (self.ch_details[ch, 0].startswith('WSP gl.') and len(self.ch_details[ch, 2].split('body'))> 1): units = self.ch_details[ch, 1] direction = self.ch_details[ch, 0].split(',')[1] tmp = self.ch_details[ch, 2].split('body')[1].split(' ') sensortag = '' if len(tmp) == 2: z, sensortag = tmp elif len(tmp) == 1: z = tmp[0] # and tag it tag = 'windspeed-global-%s at body %s' % (direction,z) # save all info in the dict channelinfo = {} channelinfo['coord'] = 'global' channelinfo['units'] = units channelinfo['chi'] = ch channelinfo['sensortag'] = sensortag # FIXME: direction is the same as component, right? channelinfo['direction'] = direction channelinfo['sensortype'] = 'wsp-global'
Please see windIO_ozgo branch. It worked for my case. I also corrected water outputs when the output is far from origin where HAWC2 gives *****. I think we should fix it from HAWC2 side but this is just a quick solution for current version.
Note there is also MR !181 (merged) that has two small changes on the channel naming scheme. So lets try to merge that first next week and than we can merge your stuff. @ozgo just go ahead and make a MR for your branch, we'll merge it after !181 (merged).