Skip to content

Commit

Permalink
2020-05-09: new data, debugging
Browse files Browse the repository at this point in the history
 * because now RKI table also contains day before first case; 
 * fixes bug for Regensburg from 2020-05-07
 * change DT plot to semilogy
  • Loading branch information
koepferl committed May 9, 2020
1 parent 7ee935c commit cba8913
Show file tree
Hide file tree
Showing 199 changed files with 32,335 additions and 17 deletions.
Binary file modified DT_Bavaria.pdf
Binary file not shown.
38 changes: 37 additions & 1 deletion Documentation_COVID19_Local.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,12 @@
"source": [
"=> see Figure ``plots/LK Miesbach.pdf`` on https://github.com/koepferl/COVID19Dahoam/blob/master/plots/LK%20Miesbach.pdf\n",
"\n",
"![title](plots/LK Miesbach.pdf)"
"![title](plots/LK Miesbach.pdf)\n",
"\n",
"In the expert plot I show the cumulative case number, the daily cases, the doubeling time and the reproduction number.\n",
"=> see Figure ``expert/LK Miesbach_expert.pdf`` at https://github.com/koepferl/COVID19Dahoam/blob/master/expert/LK%20Miesbach_expert.pdf\n",
"\n",
"![title](expert/LK Miesbach_expert.pdf)"
]
},
{
Expand Down Expand Up @@ -633,6 +638,37 @@
"\n",
"* expert plots: In some counties now there a again more cases coming in, this causes the slope to steepen in the semilog plot, the DTs get shorter again and in the log-log plot the droping trend is revercing. In the expert plot we can see that also the reproduction time is goint up once the DT drops. The end of the loc-down is now visible.\n",
" \n",
"### Dataset downloaded 2020-05-09\n",
"\n",
"* THERE IS NO GLORY IN PREVENTION BUT STILL LET'S TRY.\n",
"\n",
"\n",
"* DT evolution https://github.com/koepferl/COVID19Dahoam/blob/master/DT_Bavaria.pdf: \n",
" Changed y axis to log now. Most counties have now higher doubling times, isolation works. Stay put.\n",
" \n",
" * Bavaria with 179.68 d:\n",
" * 5 counties with lowest DTS (the larger the better):\n",
" * 41.09 3.5 LK Coburg\n",
" * 46.46 7.5 LK Neuburg-Schrobenhausen\n",
" * 50.97 2.5 SK Schweinfurt\n",
" * 51.22 6.5 LK Kitzingen\n",
" * 51.72 23.4 SK Kempten\n",
" * 5 counties with highest DTs (the larger the better):\n",
" * 397.80 7.5 LK Schwandorf\n",
" * 398.74 5.5 LK Ostallgaeu\n",
" * 424.42 7.5 LK Weilheim-Schongau\n",
" * 473.93 6.5 SK Wuezburg\n",
" * 526.26 6.5 LK Tirschenreuth\n",
"\n",
"* Semi-log plots https://github.com/koepferl/COVID19Dahoam/tree/master/plots: \n",
"\n",
" Counties with still very low DTs show also no flattening; with high DT almost a horizontal trend.\n",
" \n",
"* loglog plot https://github.com/koepferl/COVID19Dahoam/blob/master/loglog_Bavaria.pdf\n",
" Almost all counties move steep downwards (less infections every day) this means people are recovering faster than new once are becoming infected. This is good, our health system does not break down.\n",
"\n",
"* expert plots: In some counties now there a again more cases coming in, this causes the slope to steepen in the semilog plot, the DTs get shorter again and in the log-log plot the droping trend is revercing. In the expert plot we can see that also the reproduction time is goint up once the DT drops. The end of the loc-down is now visible.\n",
"\n",
"More interpretation follows tomorrow.\n",
"\n",
"\n",
Expand Down
40 changes: 39 additions & 1 deletion Documentation_COVID19_Local_German.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,12 @@
"source": [
"=> siehe Abbildung ``plots/LK Miesbach.pdf`` auf https://github.com/koepferl/COVID19Dahoam/blob/master/plots/LK%20Miesbach.pdf\n",
"\n",
"![title](plots/LK Miesbach.pdf)"
"![title](plots/LK Miesbach.pdf)\n",
"\n",
"Im Expert plot sind neben den aufsummierten Fallzahlen auch die täglichen Fallzahlen, die Verdopplungszeit und die Reproduktionszahl dargestellt.\n",
"=> siehe Abbildung ``expert/LK Miesbach_expert.pdf`` auf https://github.com/koepferl/COVID19Dahoam/blob/master/expert/LK%20Miesbach_expert.pdf\n",
"\n",
"![title](expert/LK Miesbach_expert.pdf)"
]
},
{
Expand Down Expand Up @@ -583,6 +588,39 @@
"\n",
"* Expert plot: Viele Landkreise haben nun steigende tägliche Fallzahlen. Dies hat Auswirkungen auf die Steigung im Semi-log plot. Die Steigung wird wieder steiler, im DT plot wird die Verdopplungszeit dadurch wieder kürzer, im log-log plot wird der Abwärtstrend gebrochen und es geht wieder nach oben. Das Ende der Ausgangsperre ist nun auch in den Diagrammen angekommen. \n",
"\n",
"### Datendownload 2020-05-09\n",
"\n",
"\n",
"* Es gibt keine Ehrung für Prävention, aber versuchen sollten wir es trotzdem.\n",
"\n",
"\n",
"* DT Entwicklung https://github.com/koepferl/COVID19Dahoam/blob/master/DT_Bavaria.pdf: \n",
" Nun ist die y-Achse auch logarithmisch. $10^0=1 Tag, 10^1=10 Tage, 10^2=100 Tage$ Die meisten Kreise haben höhere Verdopplungszeiten, Isolation funktioniert. Bleibt dahoam, auf Abstand oder tragt Masken.\n",
" * Bayern mit 179.68 Tage:\n",
" * 5 Kreise mit den niedriger Verdopplungszeiten (umso groesser desto besser):\n",
" * 41.09 3.5 LK Coburg\n",
" * 46.46 7.5 LK Neuburg-Schrobenhausen\n",
" * 50.97 2.5 SK Schweinfurt\n",
" * 51.22 6.5 LK Kitzingen\n",
" * 51.72 23.4 SK Kempten\n",
" * 5 Kreise mit den hoechsten Verdopplungszeiten (umso groesser desto besser):\n",
" * 397.80 7.5 LK Schwandorf\n",
" * 398.74 5.5 LK Ostallgaeu\n",
" * 424.42 7.5 LK Weilheim-Schongau\n",
" * 473.93 6.5 SK Wuezburg\n",
" * 526.26 6.5 LK Tirschenreuth\n",
"\n",
"* Semi-log plots https://github.com/koepferl/COVID19Dahoam/tree/master/plots: \n",
"\n",
" Kreise mit sehr niedrigen DTs werden nicht/kaum flacher; mit sehr großen DTs ist der Verlauf fast horizontal. \n",
" \n",
"* loglog plot https://github.com/koepferl/COVID19Dahoam/blob/master/loglog_Bavaria.pdf: \n",
"\n",
" Man sieht schon einen beginnenden Abwärtstrend für Kreise mit sehr hohen DTs. Das ist sehr gut, es bedeutet, dass weniger Menschen krank werden. Weniger Infektionen pro Tag bedeutet das die Anzahl der Genesenen bald stark zunimmt und unser Gesundheitssystem so nicht überlastet wird. \n",
"\n",
"* Expert plot: Viele Landkreise haben nun steigende tägliche Fallzahlen. Dies hat Auswirkungen auf die Steigung im Semi-log plot. Die Steigung wird wieder steiler, im DT plot wird die Verdopplungszeit dadurch wieder kürzer, im log-log plot wird der Abwärtstrend gebrochen und es geht wieder nach oben. Das Ende der Ausgangsperre ist nun auch in den Diagrammen angekommen. \n",
"\n",
"\n",
"\n",
"Mehr Diskussion folgt morgen.\n",
"\n",
Expand Down
32 changes: 20 additions & 12 deletions cov19_local.py
Original file line number Diff line number Diff line change
Expand Up @@ -221,10 +221,12 @@ def plot_corona(num_dic, day, month, name, ID, geraet_min=None, geraet_max=None,
print name
print '-' * 30

num = num_dic['fall']
num_tod = num_dic['tod']
num_gesund = num_dic['gesund']
num = num_dic['fall'][num_dic['fall'] > 0]
num_tod = num_dic['tod'][num_dic['fall'] > 0]
num_gesund = num_dic['gesund'][num_dic['fall'] > 0]

day = day[num_dic['fall'] > 0]
month = month[num_dic['fall'] > 0]
day_max = 80.


Expand All @@ -251,6 +253,9 @@ def plot_corona(num_dic, day, month, name, ID, geraet_min=None, geraet_max=None,
day[month == 4] = day[month == 4] + 31
day[month == 5] = day[month == 5] + 31 + 30

#print 'day now', day
#print 'day_real', day_real

#########
# fit
#########
Expand Down Expand Up @@ -379,6 +384,7 @@ def func(x, a, b):#, c):
#popt[2] + pcov[2,2]**0.5),
'--', color='k', alpha=0.5)

#print 'day now2', day


####
Expand All @@ -394,6 +400,8 @@ def func(x, a, b):#, c):
ax[0].semilogy(day, num_tod, 'k*', label="davon verstorben")
ax[0].semilogy(day, num_gesund, 'ko', alpha=0.3, label="davon genesen")

#print 'day now3', day

print '+' * 30
print 'Sterberate (%): ', np.round(num_tod[-1] / num[-1] * 100, 2)
print 'Gesunde (%): ', np.round(num_gesund[-1] / num[-1] * 100, 2)
Expand Down Expand Up @@ -627,7 +635,7 @@ def func(x, a, b):#, c):

ax[3].text(ax[3].get_xlim()[1] * 1.02,
ax[3].get_ylim()[1] * 0.75,
'zu Abb. 2: \nBalkendiagramm der taeglich gemeldeten Fallzahlen. \n(Ziel: keine gelben und schwarzen Balken.)'
'zu Abb. 2: \nBalkendiagramm der taeglich gemeldeten Fallzahlen. \n(Ziel: keine gelben und weissen Balken.)'
)

ax[3].text(ax[3].get_xlim()[1] * 1.02,
Expand Down Expand Up @@ -885,12 +893,12 @@ def func(x, a, b):#, c):

key = sorted_keys[i]
if i in [0, 8 ,16, 24, 32, 40, 48, 56, 64, 72, 80, 88, 96]:
ax.plot(state_day[7:], DTs_state, '.:k', label= state[2] + ' average')
ax.semilogy(state_day[7:], DTs_state, '.:k', label= state[2] + ' average')
print '-' * 20
print state[2], DTs_state[-1], int(state_day[7:][-1])
print '-' * 20

ax.plot(DT[key][1], DT[key][2], '.-', c = cmap(line_col), label=DT[key][0])
ax.semilogy(DT[key][1], DT[key][2], '.-', c = cmap(line_col), label=DT[key][0])
ax2.loglog(DT[key][3], DT[key][4], '.-', c = cmap(line_col), label=DT[key][0])
print DT[key][2][-1], int(DT[key][1][-1]), DT[key][0]

Expand All @@ -903,12 +911,12 @@ def func(x, a, b):#, c):
######
# axis

factor_1 = 100/60.
#factor_1 = 100/60.
x_pos = 37

credit2 = 'Christine Greif\nhttp://www.usm.uni-muenchen.de/~koepferl\nThis work is licensed under CC-BY-SA 4.0\nData: NPGEO-DE'

link = axs[2,3].text(x_pos, -10 * factor_1, credit2, fontsize=8, va = 'top')
link = axs[2,3].text(x_pos, 0.1, credit2, fontsize=8, va = 'top')
link = axs3[2,3].text(x_pos, -2, credit2, fontsize=8)
link = axs4[2,3].text(x_pos, -1., credit2, fontsize=8)
link = axs2[2,3].text(3.5, 0.5, credit2, fontsize=8, va='top')
Expand All @@ -922,7 +930,7 @@ def func(x, a, b):#, c):


for ax in axs.reshape(-1):
ax.set_ylim(0,100.9)
ax.set_ylim(1.,500.9)
ax.set_xlim(13,day_max)

ax.grid(True, which="both")
Expand All @@ -932,9 +940,9 @@ def func(x, a, b):#, c):
ax.legend(loc='upper left')

#if ax in [axs[2,0], axs[2,1], axs[2,2], axs[2,3]]:
ax.text(13, -5 * factor_1, 'Maerz/March')
ax.text(31, -5 * factor_1, 'April')
ax.text(31+30, -5 * factor_1, 'Mai/May')
ax.text(13, 0.5, 'Maerz/March')
ax.text(31, 0.5, 'April')
ax.text(31+30, 0.5, 'Mai/May')


for ax2 in axs2.reshape(-1):
Expand Down
Loading

0 comments on commit cba8913

Please sign in to comment.