Skip to content
Snippets Groups Projects
Unverified Commit 610561b5 authored by David Hoese's avatar David Hoese
Browse files

Fix wind direction in data api

parent 2d760b93
No related branches found
No related tags found
No related merge requests found
......@@ -92,9 +92,8 @@ def handle_influxdb_result(result, symbols, interval):
frame = pd.DataFrame(data_points, columns=['time'] + influx_symbs)
frame.set_index('time', inplace=True)
frame.fillna(value=np.nan, inplace=True)
if influx_symbs[-1] == 'wind_north':
# remove wind components
if 'wind_dir' in frame.columns:
if influx_symbs[-1] == 'wind_north' and 'wind_direction' in frame.columns:
frame['wind_direction'] = np.rad2deg(np.arctan2(frame['wind_east'], frame['wind_north']))
frame = frame.iloc[:, :-2]
frame.columns = req_syms[:-2]
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment