{"id":2321,"date":"2014-03-08T23:24:30","date_gmt":"2014-03-09T07:24:30","guid":{"rendered":"https:\/\/mathpirate.net\/log\/?p=2321"},"modified":"2014-03-08T23:24:30","modified_gmt":"2014-03-09T07:24:30","slug":"earthworm-winston-heli_ewii-and-partial-traces","status":"publish","type":"post","link":"https:\/\/mathpirate.net\/log\/2014\/03\/08\/earthworm-winston-heli_ewii-and-partial-traces\/","title":{"rendered":"Earthworm, Winston, heli_ewII, and partial traces"},"content":{"rendered":"<p>I&#8217;m not a geologist.\u00c2\u00a0 I&#8217;m not a seismologist.\u00c2\u00a0 I say that, because I want to make it clear that I have no idea what I&#8217;m talking about before you continue reading this.\u00c2\u00a0 I want to write about it here because it frustrated me for a couple of days, because there was nothing out there about this issue.<\/p>\n<p>Anyway, I&#8217;ve been putting together a personal seismograph station for my house, because I&#8217;m just that kind of nerd.\u00c2\u00a0 I built a TC1 slinky seismometer last year, and have been running it using Amaseis for a couple of months now.\u00c2\u00a0 That software is a bit limited, and I wanted to take it to the next level.\u00c2\u00a0 I got an Arduino, an accelerometer, and a Raspberry Pi, and decided that I&#8217;d try installing Earthworm.<\/p>\n<p>Because, clearly, an amateur seismometer station hanging out in a garage needs to be running Earthworm.<\/p>\n<p>(I&#8217;ll probably talk about my setup at some point in the future, especially if I get it tuned and happy and to the point where I feel comfortable that it&#8217;s working and stable.)<\/p>\n<p>Anyway, after wasting several days trying to figure out how to get my data into Earthworm wave_serverV, I gave up and installed Winston, instead.<\/p>\n<p>If it&#8217;s good enough for the USGS, it&#8217;s good enough for my garage.<\/p>\n<p>I was easily able to write an adapter that fed data from my Arduino into Winston.\u00c2\u00a0 Problem is, I don&#8217;t really like Winston&#8217;s graphs.\u00c2\u00a0 They&#8217;re so <em>blue<\/em>.\u00c2\u00a0 I like the multicolored heli_ewII graphs more.<\/p>\n<p>So, I pointed heli_ewII at Winston (Yay for interoperability) and didn&#8217;t get what I was expecting.\u00c2\u00a0 Instead of solid traces, I just got short specks of a trace every two minutes.\u00c2\u00a0 Two minutes was the interval to redraw the helicorder images in heli_ewII.d, and it looked like it was only getting a few seconds, then nothing.\u00c2\u00a0 I tweaked every setting, turned on debugging, but nothing worked.\u00c2\u00a0 I knew the data was in Winston, I could see it in the DB.\u00c2\u00a0 But, for some reason, heli_ewII was producing spotty, broken graphs.<\/p>\n<p>Eventually, I sorted out what the problem was.\u00c2\u00a0 The data acquisition Python script was trying to be too smart.\u00c2\u00a0 You see, Winston wants the sample rate of the data when you insert tracebufs.\u00c2\u00a0 Since my Arduino &amp; Pi &amp; Python package was built to the exacting specifications of a project assembled for fun on a kitchen table, the actual sample rate could vary wildly.\u00c2\u00a0 However, it was very easy to calculate what the rate was:\u00c2\u00a0 Number of samples taken \/ time taken.\u00c2\u00a0 I was sending data to Winston every five seconds or so.\u00c2\u00a0 I&#8217;d get 280 &#8211; 290 samples from the Arduino accelerometer in that window, for a sample rate of about 56-58.\u00c2\u00a0 And so, I&#8217;d tell Winston the exact sample rate when I sent it data.<\/p>\n<p>That turned out to be a mistake.<\/p>\n<p>I think that variable sample rate ended up confusing heli_ewII and Swarm&#8217;s zoomed trace (and spectrograms).\u00c2\u00a0 Every time the sample rate changed, they&#8217;d stop drawing data.\u00c2\u00a0 Swarm&#8217;s main heli view worked just fine, but that was it.\u00c2\u00a0 Everything else was messed up.<\/p>\n<p>So, I tried giving it a constant sample rate.\u00c2\u00a0 That make the helicorder displays happy and continuous, but then I started getting overlapped buffers, or something like that.<\/p>\n<p>In the end, I set my acquisition script to automatically adjust the sample rate it&#8217;s sending about once an hour.\u00c2\u00a0 This should minimize the missing data in the traces, minimize overlapping data, and still have a sample rate that corresponds to the performance of the accelerometer.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I&#8217;m not a geologist.\u00c2\u00a0 I&#8217;m not a seismologist.\u00c2\u00a0 I say that, because I want to make it clear that I have no idea what I&#8217;m talking about before you continue reading this.\u00c2\u00a0 I want to write about it here because it frustrated me for a couple of days, because there was nothing out there about [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[9,7],"tags":[229,107,225,230,228,227,226],"_links":{"self":[{"href":"https:\/\/mathpirate.net\/log\/wp-json\/wp\/v2\/posts\/2321"}],"collection":[{"href":"https:\/\/mathpirate.net\/log\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/mathpirate.net\/log\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/mathpirate.net\/log\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/mathpirate.net\/log\/wp-json\/wp\/v2\/comments?post=2321"}],"version-history":[{"count":1,"href":"https:\/\/mathpirate.net\/log\/wp-json\/wp\/v2\/posts\/2321\/revisions"}],"predecessor-version":[{"id":2322,"href":"https:\/\/mathpirate.net\/log\/wp-json\/wp\/v2\/posts\/2321\/revisions\/2322"}],"wp:attachment":[{"href":"https:\/\/mathpirate.net\/log\/wp-json\/wp\/v2\/media?parent=2321"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mathpirate.net\/log\/wp-json\/wp\/v2\/categories?post=2321"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mathpirate.net\/log\/wp-json\/wp\/v2\/tags?post=2321"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}