{"id":159,"date":"2017-12-12T20:47:29","date_gmt":"2017-12-13T01:47:29","guid":{"rendered":"https:\/\/sundrysites.com\/?page_id=159"},"modified":"2017-12-12T20:59:04","modified_gmt":"2017-12-13T01:59:04","slug":"infra20-scripts","status":"publish","type":"page","link":"https:\/\/sundrysites.com\/index.php\/home-info\/infra20-project\/infra20-scripts\/","title":{"rendered":"Infra20 Scripts"},"content":{"rendered":"<p>I&#8217;ve written three perl scripts that provide the ability to collect infrasound levels and report them on an hourly averaged basis.\u00a0 There&#8217;s one script that collects the samples from the Infra20 and two that analyze that collected data.<\/p>\n<p style=\"text-align: center;\"><strong>Collection<\/strong><\/p>\n<figure id=\"attachment_160\" aria-describedby=\"caption-attachment-160\" style=\"width: 300px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/sundrysites.com\/wp-content\/uploads\/2017\/12\/infra-collection.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"wp-image-160 size-medium\" src=\"https:\/\/sundrysites.com\/wp-content\/uploads\/2017\/12\/infra-collection-300x152.jpg\" alt=\"\" width=\"300\" height=\"152\" srcset=\"https:\/\/sundrysites.com\/wp-content\/uploads\/2017\/12\/infra-collection-300x152.jpg 300w, https:\/\/sundrysites.com\/wp-content\/uploads\/2017\/12\/infra-collection.jpg 664w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><figcaption id=\"caption-attachment-160\" class=\"wp-caption-text\">Infra20 Collection Output<\/figcaption><\/figure>\n<p>The data collection script collects the 50 samples\/sec from the Infra20, buffers them up and writes them out to a file. Each hour the file is closed and a new one is started. The file names reflect the date and hour of the collection. Once started the script runs &#8220;forever&#8221; with no further intervention needed, even if the Infra20 is disconnected. By default the files reside in the same directory as the script is running. Above is a screenshot of what it looks like as it is running. Note that it runs in a DOS window, in this case under XP. I use a simple bat file to start it up, as I don&#8217;t like to type any more than I have to. Also note that the top part of the screen shows me stopping the script (with a ctrl-c) and then starting it up again.<\/p>\n<p style=\"text-align: center;\"><strong>Analysis Scripts<\/strong><\/p>\n<p>The analysis scripts read through the samples in a file and calculate the number of records (typically around 175,000), their average value (in both the native Pascals and the equivalent dB), and finds the largest value for that hour.<\/p>\n<p>The first of these is for individual files, where you have to manually enter the filename to be analysed. Below is a screenshot of how the script runs. Note that it, like the collector script, runs in a DOS window, and can be run at the same time as the collector&#8217;s DOS window. Also note how the file is named, although the &#8220;test1&#8221; prefix will likely change before I ship the software to anyone else (current just an &#8220;a&#8221;).<\/p>\n<figure id=\"attachment_161\" aria-describedby=\"caption-attachment-161\" style=\"width: 300px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/sundrysites.com\/wp-content\/uploads\/2017\/12\/infra-analysis.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"wp-image-161 size-medium\" src=\"https:\/\/sundrysites.com\/wp-content\/uploads\/2017\/12\/infra-analysis-300x150.jpg\" alt=\"\" width=\"300\" height=\"150\" srcset=\"https:\/\/sundrysites.com\/wp-content\/uploads\/2017\/12\/infra-analysis-300x150.jpg 300w, https:\/\/sundrysites.com\/wp-content\/uploads\/2017\/12\/infra-analysis.jpg 662w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><figcaption id=\"caption-attachment-161\" class=\"wp-caption-text\">Infra20 Analysis Script<\/figcaption><\/figure>\n<p>The second of these is a batch analysis script. First it finds all the sample files in its folder (presumably c:\\perl\\site\\bin\\). Then it analyzes each one in turn (except the one currently being created), creating a csv output file with: file name, average in Pa, average in dB, max sample and # of samples in that order. It then copies the files to an archive (presently in folder c:\\infra-archive\\). Finally it deletes the files from the original folder. The csv file can be easily imported into a spreadsheet. I&#8217;ve set it up as a scheduled task that runs after midnight and thus gathers up the previous day&#8217;s numbers.<\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I&#8217;ve written three perl scripts that provide the ability to collect infrasound levels and report them on an hourly averaged basis.\u00a0 There&#8217;s one script that collects the samples from the Infra20 and two that analyze that collected data. Collection The data collection script collects the 50 samples\/sec from the Infra20, buffers them up and writes &hellip; <a href=\"https:\/\/sundrysites.com\/index.php\/home-info\/infra20-project\/infra20-scripts\/\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">Infra20 Scripts<\/span> <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"parent":155,"menu_order":20,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"class_list":["post-159","page","type-page","status-publish","hentry"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.4 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Infra20 Scripts - Sundrysites<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/sundrysites.com\/index.php\/home-info\/infra20-project\/infra20-scripts\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Infra20 Scripts - Sundrysites\" \/>\n<meta property=\"og:description\" content=\"I&#8217;ve written three perl scripts that provide the ability to collect infrasound levels and report them on an hourly averaged basis.\u00a0 There&#8217;s one script that collects the samples from the Infra20 and two that analyze that collected data. Collection The data collection script collects the 50 samples\/sec from the Infra20, buffers them up and writes &hellip; Continue reading Infra20 Scripts &rarr;\" \/>\n<meta property=\"og:url\" content=\"https:\/\/sundrysites.com\/index.php\/home-info\/infra20-project\/infra20-scripts\/\" \/>\n<meta property=\"og:site_name\" content=\"Sundrysites\" \/>\n<meta property=\"article:modified_time\" content=\"2017-12-13T01:59:04+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/sundrysites.com\/wp-content\/uploads\/2017\/12\/infra-collection-300x152.jpg\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data1\" content=\"2 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/sundrysites.com\\\/index.php\\\/home-info\\\/infra20-project\\\/infra20-scripts\\\/\",\"url\":\"https:\\\/\\\/sundrysites.com\\\/index.php\\\/home-info\\\/infra20-project\\\/infra20-scripts\\\/\",\"name\":\"Infra20 Scripts - Sundrysites\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/sundrysites.com\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/sundrysites.com\\\/index.php\\\/home-info\\\/infra20-project\\\/infra20-scripts\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/sundrysites.com\\\/index.php\\\/home-info\\\/infra20-project\\\/infra20-scripts\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/sundrysites.com\\\/wp-content\\\/uploads\\\/2017\\\/12\\\/infra-collection-300x152.jpg\",\"datePublished\":\"2017-12-13T01:47:29+00:00\",\"dateModified\":\"2017-12-13T01:59:04+00:00\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/sundrysites.com\\\/index.php\\\/home-info\\\/infra20-project\\\/infra20-scripts\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/sundrysites.com\\\/index.php\\\/home-info\\\/infra20-project\\\/infra20-scripts\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/sundrysites.com\\\/index.php\\\/home-info\\\/infra20-project\\\/infra20-scripts\\\/#primaryimage\",\"url\":\"https:\\\/\\\/sundrysites.com\\\/wp-content\\\/uploads\\\/2017\\\/12\\\/infra-collection.jpg\",\"contentUrl\":\"https:\\\/\\\/sundrysites.com\\\/wp-content\\\/uploads\\\/2017\\\/12\\\/infra-collection.jpg\",\"width\":664,\"height\":337,\"caption\":\"Infra20 Collection Output\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/sundrysites.com\\\/index.php\\\/home-info\\\/infra20-project\\\/infra20-scripts\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/sundrysites.com\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Home Info\",\"item\":\"https:\\\/\\\/sundrysites.com\\\/index.php\\\/home-info\\\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Infra20 Project\",\"item\":\"https:\\\/\\\/sundrysites.com\\\/index.php\\\/home-info\\\/infra20-project\\\/\"},{\"@type\":\"ListItem\",\"position\":4,\"name\":\"Infra20 Scripts\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/sundrysites.com\\\/#website\",\"url\":\"https:\\\/\\\/sundrysites.com\\\/\",\"name\":\"Sundrysites\",\"description\":\"As In Various and Sundry\",\"publisher\":{\"@id\":\"https:\\\/\\\/sundrysites.com\\\/#\\\/schema\\\/person\\\/1e11ce6af1587a3431e57dfc0797ab61\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/sundrysites.com\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":[\"Person\",\"Organization\"],\"@id\":\"https:\\\/\\\/sundrysites.com\\\/#\\\/schema\\\/person\\\/1e11ce6af1587a3431e57dfc0797ab61\",\"name\":\"Wayne Gulden\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/c0392cdfb7826ed5407aad362998bc6dd03fe293560ce15ccc2211357e3cec6e?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/c0392cdfb7826ed5407aad362998bc6dd03fe293560ce15ccc2211357e3cec6e?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/c0392cdfb7826ed5407aad362998bc6dd03fe293560ce15ccc2211357e3cec6e?s=96&d=mm&r=g\",\"caption\":\"Wayne Gulden\"},\"logo\":{\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/c0392cdfb7826ed5407aad362998bc6dd03fe293560ce15ccc2211357e3cec6e?s=96&d=mm&r=g\"},\"sameAs\":[\"https:\\\/\\\/sundrysites.com\"]}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Infra20 Scripts - Sundrysites","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/sundrysites.com\/index.php\/home-info\/infra20-project\/infra20-scripts\/","og_locale":"en_US","og_type":"article","og_title":"Infra20 Scripts - Sundrysites","og_description":"I&#8217;ve written three perl scripts that provide the ability to collect infrasound levels and report them on an hourly averaged basis.\u00a0 There&#8217;s one script that collects the samples from the Infra20 and two that analyze that collected data. Collection The data collection script collects the 50 samples\/sec from the Infra20, buffers them up and writes &hellip; Continue reading Infra20 Scripts &rarr;","og_url":"https:\/\/sundrysites.com\/index.php\/home-info\/infra20-project\/infra20-scripts\/","og_site_name":"Sundrysites","article_modified_time":"2017-12-13T01:59:04+00:00","og_image":[{"url":"https:\/\/sundrysites.com\/wp-content\/uploads\/2017\/12\/infra-collection-300x152.jpg","type":"","width":"","height":""}],"twitter_card":"summary_large_image","twitter_misc":{"Est. reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/sundrysites.com\/index.php\/home-info\/infra20-project\/infra20-scripts\/","url":"https:\/\/sundrysites.com\/index.php\/home-info\/infra20-project\/infra20-scripts\/","name":"Infra20 Scripts - Sundrysites","isPartOf":{"@id":"https:\/\/sundrysites.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/sundrysites.com\/index.php\/home-info\/infra20-project\/infra20-scripts\/#primaryimage"},"image":{"@id":"https:\/\/sundrysites.com\/index.php\/home-info\/infra20-project\/infra20-scripts\/#primaryimage"},"thumbnailUrl":"https:\/\/sundrysites.com\/wp-content\/uploads\/2017\/12\/infra-collection-300x152.jpg","datePublished":"2017-12-13T01:47:29+00:00","dateModified":"2017-12-13T01:59:04+00:00","breadcrumb":{"@id":"https:\/\/sundrysites.com\/index.php\/home-info\/infra20-project\/infra20-scripts\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/sundrysites.com\/index.php\/home-info\/infra20-project\/infra20-scripts\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/sundrysites.com\/index.php\/home-info\/infra20-project\/infra20-scripts\/#primaryimage","url":"https:\/\/sundrysites.com\/wp-content\/uploads\/2017\/12\/infra-collection.jpg","contentUrl":"https:\/\/sundrysites.com\/wp-content\/uploads\/2017\/12\/infra-collection.jpg","width":664,"height":337,"caption":"Infra20 Collection Output"},{"@type":"BreadcrumbList","@id":"https:\/\/sundrysites.com\/index.php\/home-info\/infra20-project\/infra20-scripts\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/sundrysites.com\/"},{"@type":"ListItem","position":2,"name":"Home Info","item":"https:\/\/sundrysites.com\/index.php\/home-info\/"},{"@type":"ListItem","position":3,"name":"Infra20 Project","item":"https:\/\/sundrysites.com\/index.php\/home-info\/infra20-project\/"},{"@type":"ListItem","position":4,"name":"Infra20 Scripts"}]},{"@type":"WebSite","@id":"https:\/\/sundrysites.com\/#website","url":"https:\/\/sundrysites.com\/","name":"Sundrysites","description":"As In Various and Sundry","publisher":{"@id":"https:\/\/sundrysites.com\/#\/schema\/person\/1e11ce6af1587a3431e57dfc0797ab61"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/sundrysites.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":["Person","Organization"],"@id":"https:\/\/sundrysites.com\/#\/schema\/person\/1e11ce6af1587a3431e57dfc0797ab61","name":"Wayne Gulden","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/c0392cdfb7826ed5407aad362998bc6dd03fe293560ce15ccc2211357e3cec6e?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/c0392cdfb7826ed5407aad362998bc6dd03fe293560ce15ccc2211357e3cec6e?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/c0392cdfb7826ed5407aad362998bc6dd03fe293560ce15ccc2211357e3cec6e?s=96&d=mm&r=g","caption":"Wayne Gulden"},"logo":{"@id":"https:\/\/secure.gravatar.com\/avatar\/c0392cdfb7826ed5407aad362998bc6dd03fe293560ce15ccc2211357e3cec6e?s=96&d=mm&r=g"},"sameAs":["https:\/\/sundrysites.com"]}]}},"_links":{"self":[{"href":"https:\/\/sundrysites.com\/index.php\/wp-json\/wp\/v2\/pages\/159","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/sundrysites.com\/index.php\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/sundrysites.com\/index.php\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/sundrysites.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/sundrysites.com\/index.php\/wp-json\/wp\/v2\/comments?post=159"}],"version-history":[{"count":2,"href":"https:\/\/sundrysites.com\/index.php\/wp-json\/wp\/v2\/pages\/159\/revisions"}],"predecessor-version":[{"id":177,"href":"https:\/\/sundrysites.com\/index.php\/wp-json\/wp\/v2\/pages\/159\/revisions\/177"}],"up":[{"embeddable":true,"href":"https:\/\/sundrysites.com\/index.php\/wp-json\/wp\/v2\/pages\/155"}],"wp:attachment":[{"href":"https:\/\/sundrysites.com\/index.php\/wp-json\/wp\/v2\/media?parent=159"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}