Last active
July 3, 2017 15:13
-
-
Save seumasmorrison/e784acdf3beca1c7db11ec5960e54889 to your computer and use it in GitHub Desktop.
Script for plotting data from a wad file exported by Nortek's Storm software recorded by an AWAC ( Acoustic wave and current profiler ).
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"cells": [ | |
{ | |
"cell_type": "code", | |
"execution_count": null, | |
"metadata": {}, | |
"outputs": [], | |
"source": [ | |
"import pandas as pd\n", | |
"from datetime import datetime" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": null, | |
"metadata": {}, | |
"outputs": [], | |
"source": [ | |
"columns = ['month', 'day', 'year', 'hour', 'minute', 'seconds', \n", | |
" 'pressure', 'ast_distance1_beam4', 'ast_distance2_beam4', \n", | |
" 'ast_quality_beam4', 'analog_input', 'velocity_beam1_x_east_m_s',\n", | |
" 'velocity_beam2_y_north_m_s', 'velocity_beam3_x_up_m_s', \n", | |
" 'amplitude_beam1', 'amplitude_beam2', 'amplitude_beam3']" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": null, | |
"metadata": {}, | |
"outputs": [], | |
"source": [ | |
"wad_df = pd.read_csv('data.wad', delim_whitespace=True, header=None, names=columns, parse_dates={'DateTime':[2,0,1,3,4,5]})" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": null, | |
"metadata": {}, | |
"outputs": [], | |
"source": [ | |
"wad_df.index = pd.to_datetime(wad_df.DateTime, format='%Y %m %d %H %M %S.%f')" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": null, | |
"metadata": {}, | |
"outputs": [], | |
"source": [ | |
"wad_df.drop('DateTime', axis=1, inplace=True)" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": null, | |
"metadata": {}, | |
"outputs": [], | |
"source": [ | |
"%matplotlib" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": null, | |
"metadata": {}, | |
"outputs": [], | |
"source": [ | |
"wad_df.pressure.plot()" | |
] | |
} | |
], | |
"metadata": { | |
"kernelspec": { | |
"display_name": "Python 3", | |
"language": "python", | |
"name": "python3" | |
}, | |
"language_info": { | |
"codemirror_mode": { | |
"name": "ipython", | |
"version": 3 | |
}, | |
"file_extension": ".py", | |
"mimetype": "text/x-python", | |
"name": "python", | |
"nbconvert_exporter": "python", | |
"pygments_lexer": "ipython3", | |
"version": "3.6.1" | |
} | |
}, | |
"nbformat": 4, | |
"nbformat_minor": 2 | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment