back

COVID-19 in selected counties


blog


Data thanks to USAFACTS.
Data was previously extracted from Johns Hopkins Time Series CSV for COVID-19
Selections were controlled by myFIPS.csv, which was extracted from FIPS county population data, e.g.
https://www2.census.gov/programs-surveys/popest/datasets/2010-2019/counties/totals/co-est2019-alldata.csv.
FIPSpopJul2018.csv is a stripped CSV file with only state,county,locality for most US FIPS localities.

Processing employs gnuplot, ImageMagick, and bash scripts
using MSYS2 bash from Ruby on Windows 10.
Scripts were tweaked to also work on macOS, but not yet tested on
e.g. Windows Subsystem for Linux or linux.

Before 14 May, data for gnuplot was mostly extracted by frame.sh, which may be invoked standalone,
but is typically run by invoking covid.sh, which downloads most recent Johns Hopkins Time Series .csv,
then invokes frame.sh, which eventually invokes gnuplot to generate a covid.png based on plot_covid.p,
which uses data.txt, which was previously extractated by frame.sh.

animate.sh also invokes frame.sh to generate one suitably renamed covid.png for each day in the animation GIF,
which are in turn rotated and combined into that animated gif, as displayed above, by magick convert.

Utility script cfg.sh is sourced by both animate.sh and covid.sh
to set environmental variables for paths to scripts, executibles and working subdirectory.

5 May 2020
Still looking for a way to have GitHub Pages display plain text files *.p *.sh
Deal with CSV data source having newer entries with lower reported cumulative case counts.
6 May
Pipe gnuplot output directly to ImageMagick convert, reducing hard drive thrash.
Convert bash scripts to be invoked by `source` mostly by replacing `exit` with `return`.
Invoke gnuplot with path to script in GitHub folder, avoiding file copy.
Remove leading blank in numeric string.
7 May
Define $csv for path to downloaded data file, $here for path to GitHub folder.
Extract first line of $csv for date titles.
Doomed experiment using gifsicle to compress animated GIFs.
More tests for invalid cumulative case counts.
Clean up IFS usage.
8 May
Reorder bargraphs; better gnuplot ytics and grid.
Add RAM disk support to minimize SSD wear.
Pass title to gnuplot on invocation.
9 May
Increase GIF animation speed.
10 May
Download $csv to RAM drive.
Compensate for 2 commas in columns; more checks for invalid data.
11 May
In bash, `unset IFS` restores default string field separators.
GIF animate today vs 3 days prior.
13 May
New and updated scripts for covid_county_population_usafacts.csv.
Add population to data.txt, so that gnuplot can calculate per 100K values.
14 May
Add state abbreviations to myFIPS.csv; rename plot_covid.p to diff_covid.p; add Albuquerque.
Fix frame.sh a0 bug, factFIPS.csv Beralillo FIPS typo.
In usfact.sh county(), check for requested column greater than available.
15 May
Widen and reorder graph.
usfact.sh uses myFIPS.csv to extract copop.csv for use by new gnuplot script stats.p.
16 May
usfact.sh calls `gnuplot stats.p`, which uses seq.sh to invoke convert for rotated graph.
stats.p now sets ylabel date from first line of $csv
17 May
Widen graphs
18 May
per 100K calculations moved from bash to gnuplot script.
Widen graph, darker red for increasing new 3-day cases.
23 May
loop.p to generate multiple graphs from single gnuplot invocation.
Replace '/' in dates with '-' for use in graph filenames; update seq.sh IFS to handle '-'.
In stats.p, rename 'now' to 'day'; failed Windows gnuplot experiment to pipe directly to convert in `set output`
24 May
Ignore .DS_Store on macOS; stats.p bug: now->day;
cfg.sh now works on macOS.
25 May
Do not apply dark red for weekly fluctuations,
e.g. days 0-3 > 3-6 but not 7-10
26 May
update loop.p to match stats.p
26 Jun
add San Luis Obispo CA, Maricopa AZ, Maricopa AZ to factFIPS.csv with populations from FIPSpopJul2018.csv
maintained by blekenbleu