{"id":3672,"date":"2020-04-23T12:43:33","date_gmt":"2020-04-23T17:43:33","guid":{"rendered":"http:\/\/henrymelton.net\/2\/?p=3672"},"modified":"2020-04-23T12:43:39","modified_gmt":"2020-04-23T17:43:39","slug":"my-morning-routine-plotting-covid-19","status":"publish","type":"post","link":"https:\/\/henrymelton.net\/2\/2020\/04\/23\/my-morning-routine-plotting-covid-19\/","title":{"rendered":"My Morning Routine (Plotting Covid-19)"},"content":{"rendered":"\n<p>Strange times, and we all have different ways of coping with the strangeness.&nbsp; For several weeks now, I\u2019ve been taking a closer look at the Texas infection data.&nbsp; Since the beginning, I\u2019ve been putting up the John Hopkins dashboard on my secondary display, updated hourly automatically during my awake hours to keep myself from refreshing the screen too often.<\/p>\n\n\n\n<p>I use this cron line on my Mac (all one line):<\/p>\n\n\n\n<p><strong>0 8-20 * * * open https:\/\/www.arcgis.com\/apps\/opsdashboard\/index.html#\/bda7594740fd40299423467b48e9ecf6<\/strong><\/p>\n\n\n\n<p>For those that don\u2019t know the command line and cron this means&nbsp; \u201cat the top of the hour between 8am and 8pm open this url with the default browser\u201d<\/p>\n\n\n\n<figure class=\"wp-block-gallery columns-1 is-cropped wp-block-gallery-1 is-layout-flex\"><ul class=\"blocks-gallery-grid\"><li class=\"blocks-gallery-item\"><figure><img decoding=\"async\" loading=\"lazy\" width=\"1024\" height=\"550\" src=\"https:\/\/henrymelton.net\/2\/wp-content\/uploads\/2020\/04\/Screen-Shot-2020-04-23-at-11.47.59-AM-2-1024x550.png\" alt=\"\" data-id=\"3676\" data-full-url=\"https:\/\/henrymelton.net\/2\/wp-content\/uploads\/2020\/04\/Screen-Shot-2020-04-23-at-11.47.59-AM-2.png\" data-link=\"https:\/\/henrymelton.net\/2\/?attachment_id=3676\" class=\"wp-image-3676\" srcset=\"https:\/\/henrymelton.net\/2\/wp-content\/uploads\/2020\/04\/Screen-Shot-2020-04-23-at-11.47.59-AM-2-1024x550.png 1024w, https:\/\/henrymelton.net\/2\/wp-content\/uploads\/2020\/04\/Screen-Shot-2020-04-23-at-11.47.59-AM-2-300x161.png 300w, https:\/\/henrymelton.net\/2\/wp-content\/uploads\/2020\/04\/Screen-Shot-2020-04-23-at-11.47.59-AM-2-150x81.png 150w, https:\/\/henrymelton.net\/2\/wp-content\/uploads\/2020\/04\/Screen-Shot-2020-04-23-at-11.47.59-AM-2-768x412.png 768w, https:\/\/henrymelton.net\/2\/wp-content\/uploads\/2020\/04\/Screen-Shot-2020-04-23-at-11.47.59-AM-2-100x54.png 100w, https:\/\/henrymelton.net\/2\/wp-content\/uploads\/2020\/04\/Screen-Shot-2020-04-23-at-11.47.59-AM-2-200x107.png 200w, https:\/\/henrymelton.net\/2\/wp-content\/uploads\/2020\/04\/Screen-Shot-2020-04-23-at-11.47.59-AM-2-450x242.png 450w, https:\/\/henrymelton.net\/2\/wp-content\/uploads\/2020\/04\/Screen-Shot-2020-04-23-at-11.47.59-AM-2-600x322.png 600w, https:\/\/henrymelton.net\/2\/wp-content\/uploads\/2020\/04\/Screen-Shot-2020-04-23-at-11.47.59-AM-2-900x483.png 900w, https:\/\/henrymelton.net\/2\/wp-content\/uploads\/2020\/04\/Screen-Shot-2020-04-23-at-11.47.59-AM-2.png 1200w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure><\/li><\/ul><\/figure>\n\n\n\n<p>But just clicking around on the interactive dashboard didn\u2019t give me the information I wanted, so I dug deeper.&nbsp; On the dashboard, it had a link to the downloadable database that drove their chart.<\/p>\n\n\n\n<p>There are various data files, basically CSV files that any spreadsheet can read, there for the taking.<\/p>\n\n\n\n<p>So, I wrote the following program to pull what I wanted and filter it down to Texas data only. In this blog, those if statements are all one line.<\/p>\n\n\n\n<div class=\"wp-block-group\"><div class=\"wp-block-group__inner-container is-layout-flow\">\n<p><strong>#!\/bin\/zsh<\/strong><\/p>\n\n\n\n<p><strong>base=$HOME\/COVID-DATA<\/strong><\/p>\n\n\n\n<p><strong>mkdir $base 2> \/dev\/null<\/strong><\/p>\n\n\n\n<p><strong>find $base -ctime +4h -delete<\/strong><\/p>\n\n\n\n<p><strong>target=time_series_covid19_confirmed_US.csv<\/strong><\/p>\n\n\n\n<p><strong>if [[ !\u00a0 -e $base\/$target ]] ; then curl -o $base\/$target https:\/\/raw.githubusercontent.com\/CSSEGISandData\/COVID-19\/master\/csse_covid_19_data\/csse_covid_19_time_series\/$target ; else echo &#8220;exists&#8221;; fi<\/strong><\/p>\n\n\n\n<p><strong>echo &#8220;Dates,14,,,,,,,21,,,,,,,28,,,,April,,,,,,7,,,,,,,14,,,,,,,21&#8243;>$base\/Texas_confirmed.csv<\/strong><\/p>\n\n\n\n<p><strong>grep &#8220;,Texas,US,&#8221; &lt;$base\/$target |cut -d , -f 6,66- >> $base\/Texas_confirmed.csv<\/strong><\/p>\n\n\n\n<p><strong>target=time_series_covid19_deaths_US.csv<\/strong><\/p>\n\n\n\n<p><strong>if [[ !\u00a0 -e $base\/$target ]] ; then curl -o $base\/$target https:\/\/raw.githubusercontent.com\/CSSEGISandData\/COVID-19\/master\/csse_covid_19_data\/csse_covid_19_time_series\/$target ; else echo &#8220;exists&#8221;; fi<\/strong><\/p>\n\n\n\n<p><strong>echo &#8220;Dates,14,,,,,,,21,,,,,,,28,,,,April,,,,,,7,,,,,,,14,,,,,,,21&#8243;>$base\/Texas_deaths.csv<\/strong><\/p>\n\n\n\n<p><strong>grep &#8220;,Texas,US,&#8221; &lt;$base\/$target |cut -d , -f 6,67- >> $base\/Texas_deaths.csv<\/strong><\/p>\n<\/div><\/div>\n\n\n\n<p>And I ran this program at 9pm everyday also using cron:<\/p>\n\n\n\n<p><strong>0 21 * * * \/Users\/hmelton\/bin\/covid<\/strong><\/p>\n\n\n\n<p>And now I had data I could work with with my spreadsheet.&nbsp; Every morning, I open up the COVID-DATA folder on my desktop and up pops a spread sheet with every county in Texas from March 14 to the current day, in alphabetical order.&nbsp; I sort the counties by the last column, with the current infections (or deaths in the case of the Texas_deaths spreadsheet) and them make my charts for the day.<\/p>\n\n\n\n<p>My first chart plots the growth of the infection in the top twenty counties.\u00a0 This morning I noticed that Williamson County, where I live, had dropped out of the top twenty.\u00a0 That means that other, more rural counties are getting more infections.\u00a0 <\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" loading=\"lazy\" width=\"642\" height=\"1024\" src=\"https:\/\/henrymelton.net\/2\/wp-content\/uploads\/2020\/04\/Screen-Shot-2020-04-23-at-12.30.07-PM-1-642x1024.png\" alt=\"\" class=\"wp-image-3678\" srcset=\"https:\/\/henrymelton.net\/2\/wp-content\/uploads\/2020\/04\/Screen-Shot-2020-04-23-at-12.30.07-PM-1-642x1024.png 642w, https:\/\/henrymelton.net\/2\/wp-content\/uploads\/2020\/04\/Screen-Shot-2020-04-23-at-12.30.07-PM-1-188x300.png 188w, https:\/\/henrymelton.net\/2\/wp-content\/uploads\/2020\/04\/Screen-Shot-2020-04-23-at-12.30.07-PM-1-94x150.png 94w, https:\/\/henrymelton.net\/2\/wp-content\/uploads\/2020\/04\/Screen-Shot-2020-04-23-at-12.30.07-PM-1-768x1225.png 768w, https:\/\/henrymelton.net\/2\/wp-content\/uploads\/2020\/04\/Screen-Shot-2020-04-23-at-12.30.07-PM-1-100x159.png 100w, https:\/\/henrymelton.net\/2\/wp-content\/uploads\/2020\/04\/Screen-Shot-2020-04-23-at-12.30.07-PM-1-963x1536.png 963w, https:\/\/henrymelton.net\/2\/wp-content\/uploads\/2020\/04\/Screen-Shot-2020-04-23-at-12.30.07-PM-1-150x239.png 150w, https:\/\/henrymelton.net\/2\/wp-content\/uploads\/2020\/04\/Screen-Shot-2020-04-23-at-12.30.07-PM-1-200x319.png 200w, https:\/\/henrymelton.net\/2\/wp-content\/uploads\/2020\/04\/Screen-Shot-2020-04-23-at-12.30.07-PM-1-300x478.png 300w, https:\/\/henrymelton.net\/2\/wp-content\/uploads\/2020\/04\/Screen-Shot-2020-04-23-at-12.30.07-PM-1-450x718.png 450w, https:\/\/henrymelton.net\/2\/wp-content\/uploads\/2020\/04\/Screen-Shot-2020-04-23-at-12.30.07-PM-1-600x957.png 600w, https:\/\/henrymelton.net\/2\/wp-content\/uploads\/2020\/04\/Screen-Shot-2020-04-23-at-12.30.07-PM-1-900x1435.png 900w, https:\/\/henrymelton.net\/2\/wp-content\/uploads\/2020\/04\/Screen-Shot-2020-04-23-at-12.30.07-PM-1.png 1026w\" sizes=\"(max-width: 642px) 100vw, 642px\" \/><\/figure>\n\n\n\n<p>That prompted me to make a stacked bar chart of how the counties compare.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" loading=\"lazy\" width=\"946\" height=\"1024\" src=\"https:\/\/henrymelton.net\/2\/wp-content\/uploads\/2020\/04\/Screen-Shot-2020-04-23-at-12.30.27-PM-946x1024.png\" alt=\"\" class=\"wp-image-3679\" srcset=\"https:\/\/henrymelton.net\/2\/wp-content\/uploads\/2020\/04\/Screen-Shot-2020-04-23-at-12.30.27-PM-946x1024.png 946w, https:\/\/henrymelton.net\/2\/wp-content\/uploads\/2020\/04\/Screen-Shot-2020-04-23-at-12.30.27-PM-277x300.png 277w, https:\/\/henrymelton.net\/2\/wp-content\/uploads\/2020\/04\/Screen-Shot-2020-04-23-at-12.30.27-PM-139x150.png 139w, https:\/\/henrymelton.net\/2\/wp-content\/uploads\/2020\/04\/Screen-Shot-2020-04-23-at-12.30.27-PM-768x831.png 768w, https:\/\/henrymelton.net\/2\/wp-content\/uploads\/2020\/04\/Screen-Shot-2020-04-23-at-12.30.27-PM-100x108.png 100w, https:\/\/henrymelton.net\/2\/wp-content\/uploads\/2020\/04\/Screen-Shot-2020-04-23-at-12.30.27-PM-1419x1536.png 1419w, https:\/\/henrymelton.net\/2\/wp-content\/uploads\/2020\/04\/Screen-Shot-2020-04-23-at-12.30.27-PM-150x162.png 150w, https:\/\/henrymelton.net\/2\/wp-content\/uploads\/2020\/04\/Screen-Shot-2020-04-23-at-12.30.27-PM-200x216.png 200w, https:\/\/henrymelton.net\/2\/wp-content\/uploads\/2020\/04\/Screen-Shot-2020-04-23-at-12.30.27-PM-300x325.png 300w, https:\/\/henrymelton.net\/2\/wp-content\/uploads\/2020\/04\/Screen-Shot-2020-04-23-at-12.30.27-PM-450x487.png 450w, https:\/\/henrymelton.net\/2\/wp-content\/uploads\/2020\/04\/Screen-Shot-2020-04-23-at-12.30.27-PM-600x649.png 600w, https:\/\/henrymelton.net\/2\/wp-content\/uploads\/2020\/04\/Screen-Shot-2020-04-23-at-12.30.27-PM-900x974.png 900w, https:\/\/henrymelton.net\/2\/wp-content\/uploads\/2020\/04\/Screen-Shot-2020-04-23-at-12.30.27-PM.png 1480w\" sizes=\"(max-width: 946px) 100vw, 946px\" \/><\/figure>\n\n\n\n<p>In general, I vary which charts I make each day, depending on what I\u2019m interested in.&nbsp; I don\u2019t keep them, since I can always re-create them if necessary.&nbsp; I\u2019m sure there are more elegant tools than some shell scripts and cron to get what I need, but those work, and since it\u2019s just for my own eyes, those old tools are good enough.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Strange times, and we all have different ways of coping with the strangeness.&nbsp; For several weeks now, I\u2019ve been taking a closer look at the Texas infection data.&nbsp; Since the beginning, I\u2019ve been putting up the John Hopkins dashboard on my secondary display, updated hourly automatically during my awake hours to keep myself from refreshing&hellip; <a class=\"more-link\" href=\"https:\/\/henrymelton.net\/2\/2020\/04\/23\/my-morning-routine-plotting-covid-19\/\">Continue reading <span class=\"screen-reader-text\">My Morning Routine (Plotting Covid-19)<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_newsletter_tier_id":0,"jetpack_publicize_message":"","jetpack_is_tweetstorm":false,"jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","enabled":false}}},"categories":[1],"tags":[548,547,549],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p4t90x-Xe","_links":{"self":[{"href":"https:\/\/henrymelton.net\/2\/wp-json\/wp\/v2\/posts\/3672"}],"collection":[{"href":"https:\/\/henrymelton.net\/2\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/henrymelton.net\/2\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/henrymelton.net\/2\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/henrymelton.net\/2\/wp-json\/wp\/v2\/comments?post=3672"}],"version-history":[{"count":3,"href":"https:\/\/henrymelton.net\/2\/wp-json\/wp\/v2\/posts\/3672\/revisions"}],"predecessor-version":[{"id":3681,"href":"https:\/\/henrymelton.net\/2\/wp-json\/wp\/v2\/posts\/3672\/revisions\/3681"}],"wp:attachment":[{"href":"https:\/\/henrymelton.net\/2\/wp-json\/wp\/v2\/media?parent=3672"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/henrymelton.net\/2\/wp-json\/wp\/v2\/categories?post=3672"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/henrymelton.net\/2\/wp-json\/wp\/v2\/tags?post=3672"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}