Skip to content

Instantly share code, notes, and snippets.

@foobarbecue
Created June 27, 2014 19:43
Show Gist options
  • Save foobarbecue/f4ccf002937349f21832 to your computer and use it in GitHub Desktop.
Save foobarbecue/f4ccf002937349f21832 to your computer and use it in GitHub Desktop.
LogAnalyzer scoping problem
Display the source blob
Display the rendered blob
Raw
{
"metadata": {
"name": "LogAnalyzer scope problem"
},
"nbformat": 3,
"nbformat_minor": 0,
"worksheets": [
{
"cells": [
{
"cell_type": "code",
"collapsed": false,
"input": "cd ~/arducopter/ardupilot/Tools/LogAnalyzer",
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": "/home/aaron/arducopter/ardupilot/Tools/LogAnalyzer\n"
}
],
"prompt_number": 1
},
{
"cell_type": "code",
"collapsed": false,
"input": "import DataflashLog",
"language": "python",
"metadata": {},
"outputs": [],
"prompt_number": 2
},
{
"cell_type": "code",
"collapsed": false,
"input": "mlog=DataflashLog.DataflashLog()\nmlog.read('/home/aaron/sandbox/copterYawProb/2014-06-27 06-12-46.log')\nprint 'Log 1: ' + str(len(mlog.channels['RCIN']['C4'].listData))\n\nmlog2=DataflashLog.DataflashLog()\nmlog2.read('/home/aaron/sandbox/copterYawProb/2014-06-22 02-36-01.log')\nprint 'Log 2: ' + str(len(mlog2.channels['RCIN']['C4'].listData))\nprint 'Log 1: ' + str(len(mlog.channels['RCIN']['C4'].listData))\n",
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": "Log 1: 439\nLog 2: 2827"
},
{
"output_type": "stream",
"stream": "stdout",
"text": "\nLog 1: 2827\n"
}
],
"prompt_number": 3
},
{
"cell_type": "code",
"collapsed": false,
"input": "",
"language": "python",
"metadata": {},
"outputs": []
}
],
"metadata": {}
}
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment