Skip to content

Commit

Permalink
Merge pull request #9 from ODZ-UJF-AV-CR/THUNDERMILL01A
Browse files Browse the repository at this point in the history
Tunnel packets viewer
  • Loading branch information
kaklik authored Nov 4, 2021
2 parents 2da55ad + 351fa08 commit f047a5a
Showing 1 changed file with 219 additions and 0 deletions.
219 changes: 219 additions & 0 deletions doc/THUNDERMILL_log_viewer.ipynb
Original file line number Diff line number Diff line change
@@ -0,0 +1,219 @@
{
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# TF-ATMON log viewer"
]
},
{
"cell_type": "code",
"execution_count": 1,
"metadata": {},
"outputs": [],
"source": [
"from atmon import log\n",
"\n",
"import matplotlib.pyplot as plt\n",
"import numpy as np\n",
"import pandas as pd\n",
"\n",
"pd.set_option('display.max_rows', 500)\n",
"pd.set_option('display.max_columns', 500)\n",
"pd.set_option('display.width', 1000)\n",
"\n",
"plt.rcParams[\"figure.figsize\"] = [20, 10]"
]
},
{
"cell_type": "code",
"execution_count": 3,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Atmon tools 16_28_28.ulg\n",
"<pyulog.core.ULog object at 0x7f6a1c6f4b20>\n",
"loaded loc\n"
]
}
],
"source": [
"logf = '16_28_28.ulg'\n",
"\n",
"l = log(logf)"
]
},
{
"cell_type": "code",
"execution_count": 5,
"metadata": {
"scrolled": true
},
"outputs": [
{
"ename": "AttributeError",
"evalue": "'log' object has no attribute 'tunnel'",
"output_type": "error",
"traceback": [
"\u001b[0;31m---------------------------------------------------------------------------\u001b[0m",
"\u001b[0;31mAttributeError\u001b[0m Traceback (most recent call last)",
"\u001b[0;32m<ipython-input-5-89fdbca456dc>\u001b[0m in \u001b[0;36m<module>\u001b[0;34m\u001b[0m\n\u001b[0;32m----> 1\u001b[0;31m \u001b[0ml\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mprocess_thundermill\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m",
"\u001b[0;32m/usr/local/lib/python3.8/dist-packages/TF_ATMON-1.0-py3.8.egg/atmon/__init__.py\u001b[0m in \u001b[0;36mprocess_thundermill\u001b[0;34m(self)\u001b[0m\n\u001b[1;32m 56\u001b[0m \u001b[0;32mdef\u001b[0m \u001b[0mprocess_thundermill\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mself\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 57\u001b[0m \u001b[0;31m# filter tunnel data:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m---> 58\u001b[0;31m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mtunnel_mill\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mtunnel\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mloc\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mtunnel\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0;34m'payload_type'\u001b[0m\u001b[0;34m]\u001b[0m \u001b[0;34m==\u001b[0m \u001b[0;36m3\u001b[0m\u001b[0;34m]\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 59\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mtunnel_mill\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mtunnel_mill\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mastype\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mnp\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0muint32\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 60\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n",
"\u001b[0;31mAttributeError\u001b[0m: 'log' object has no attribute 'tunnel'"
]
}
],
"source": [
"l.process_thundermill()"
]
},
{
"cell_type": "code",
"execution_count": 6,
"metadata": {},
"outputs": [
{
"ename": "AttributeError",
"evalue": "'log' object has no attribute 'tunnel'",
"output_type": "error",
"traceback": [
"\u001b[0;31m---------------------------------------------------------------------------\u001b[0m",
"\u001b[0;31mAttributeError\u001b[0m Traceback (most recent call last)",
"\u001b[0;32m<ipython-input-6-741a75ab401d>\u001b[0m in \u001b[0;36m<module>\u001b[0;34m\u001b[0m\n\u001b[0;32m----> 1\u001b[0;31m \u001b[0ml\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mprocess_tfpm\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m",
"\u001b[0;32m/usr/local/lib/python3.8/dist-packages/TF_ATMON-1.0-py3.8.egg/atmon/__init__.py\u001b[0m in \u001b[0;36mprocess_tfpm\u001b[0;34m(self)\u001b[0m\n\u001b[1;32m 26\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 27\u001b[0m \u001b[0;32mdef\u001b[0m \u001b[0mprocess_tfpm\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mself\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m---> 28\u001b[0;31m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mtunnel_tfpm\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mtunnel\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mloc\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mtunnel\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0;34m'payload_type'\u001b[0m\u001b[0;34m]\u001b[0m \u001b[0;34m==\u001b[0m \u001b[0;36m0\u001b[0m\u001b[0;34m]\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 29\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mtunnel_tfpm\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mtunnel_tfpm\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mastype\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mnp\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0muint32\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 30\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n",
"\u001b[0;31mAttributeError\u001b[0m: 'log' object has no attribute 'tunnel'"
]
}
],
"source": [
"l.process_tfpm()"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"plt.plot(l.loc['timestamp'], -l.loc['x']/10, label='loc X/10', color='lightblue')\n",
"plt.plot(l.loc['timestamp'], -l.loc['y']/10, label='loc Y/10', color='lightblue')\n",
"plt.plot(l.loc['timestamp'], -l.loc['z'], label='loc -ALT', color='blue')\n",
"\n",
"plt.plot(l.tunnel_mill['timestamp'], (l.tunnel_mill['E_field']-128), 'x', label='E_field-128', color='green')\n",
"plt.plot(l.tunnel_mill['timestamp'], (l.tunnel_mill['Hum']), '.', label='hum', color='red')\n",
"plt.plot(l.tunnel_mill['timestamp'], (l.tunnel_mill['Temp']), '.', label='temp', color='orange')\n",
"plt.plot(l.tunnel_mill['timestamp'], (l.tunnel_mill['RPM'])/24*60/10, label='RPM/10', color='yellow')\n",
"\n",
"plt.legend()\n",
"\n",
"plt.ylabel('Val', fontsize=14)\n",
"plt.xlabel('Time', fontsize=14)\n",
"plt.title('16_31_24', fontsize=16)\n",
"\n",
"plt.show()"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"plt.plot(l.loc['timestamp'], -l.loc['x']/10, label='loc X/10', color='lightblue')\n",
"plt.plot(l.loc['timestamp'], -l.loc['y']/10, label='loc Y/10', color='lightblue')\n",
"plt.plot(l.loc['timestamp'], -l.loc['z'], label='loc -ALT', color='blue')\n",
"\n",
"plt.plot(l.tunnel_mill['timestamp'], (l.tunnel_mill['E_field']-128), 'x', label='E_field-128', color='green')\n",
"plt.plot(l.tunnel_mill['timestamp'], (l.tunnel_mill['Hum']), '.', label='hum', color='red')\n",
"plt.plot(l.tunnel_mill['timestamp'], (l.tunnel_mill['Temp']), '.', label='temp', color='orange')\n",
"plt.plot(l.tunnel_mill['timestamp'], (l.tunnel_mill['RPM'])/24*60/10, '.', label='RPM/10', color='yellow')\n",
"\n",
"plt.xlim(3.7e8, 3.8e8)\n",
"\n",
"plt.show()"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"plt.plot(l.loc['timestamp'], -l.loc['x']/10, label='loc X/10', color='lightblue')\n",
"plt.plot(l.loc['timestamp'], -l.loc['y']/10, label='loc Y/10', color='lightblue')\n",
"plt.plot(l.loc['timestamp'], -l.loc['z'], label='loc -ALT', color='blue')\n",
"\n",
"plt.plot(l.tunnel_mill['timestamp'], (l.tunnel_mill['E_field']-128), 'x', label='E_field-128', color='green')\n",
"plt.plot(l.tunnel_mill['timestamp'], (l.tunnel_mill['Hum']), '.', label='hum', color='red')\n",
"plt.plot(l.tunnel_mill['timestamp'], (l.tunnel_mill['Temp']), '.', label='temp', color='orange')\n",
"plt.plot(l.tunnel_mill['timestamp'], (l.tunnel_mill['RPM'])/24*60/10, '.', label='RPM/10', color='yellow')\n",
"\n",
"plt.xlim(10.0e8, 10.2e8)\n",
"\n",
"plt.show()"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"import ulog"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
}
],
"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.8.10"
}
},
"nbformat": 4,
"nbformat_minor": 4
}

0 comments on commit f047a5a

Please sign in to comment.