Nied
Verteilungsdichte der Schadensmeldungen in Abhängigkeit von der Regenmenge pro Tag
Ergebnis¶
Die Gleichzeitigkeit von vielen Störmeldungen sind zumeist nicht auf Regenereignisse zurückzuführen. weil diese eher lokal auftreten.
Abb.: Verteilungsdichte der Störmeldungen (N) in Abhängigkeit von der Niederschlagsmenge (Nied) über alle PDs: N>0 und N>40.
Code¶
Module
# -*- coding: utf-8 -*-
import sys
import numpy as N
import shapefile
import scipy.stats as stats
import pylab as P
from matplotlib.collections import PatchCollection
from pylab import Polygon
from mpl_toolkits.basemap import Basemap
P.style.use('bmh')
params = {'legend.fontsize': 8,'font.family': 'serif'}
P.rcParams.update(params)
Reading
tmp=N.genfromtxt('../shp/GP.csv',names=True,comments='#',delimiter=';',dtype=None)#,encoding='UTF-8')
pds = tmp['Name']
print (pds)
Plotting
filter = 'Filter1'
P.figure(figsize=(8,5))
xx = []
yy = []
for pd in pds:
pd = pd.replace('\xfc', 'ü').replace('\xf6', 'ö')
file = '../csv/obs-dwd/'+pd+'.csv'
data=N.genfromtxt(file,names=True,comments='#',delimiter=';',dtype=None,encoding='utf-8')
id = N.where((data['ja']>=2015)&(data['ja']<=2019))[0]
tmax = data['nied'][id]
file = '../csv/pds-uas/'+pd+'.csv'
data=N.genfromtxt(file,names=True,comments='#',delimiter=';',dtype=None,encoding='utf-8')
id = N.where((data['ja']>=2015)&(data['ja']<=2019))[0]
uas = data[filter][id]
id = N.where(uas>0)[0]
for i in id:
xx.append(tmax[i])
yy.append(uas[i])
xx = N.array(xx)
yy = N.array(yy)
print (len(xx))
for sw in [0,40]:
id = N.where((yy>sw)&(xx>2))[0]
xs = xx[id]
ys = yy[id]
values = N.vstack([xs,ys])
kernel = stats.gaussian_kde(values)
X, Y = N.mgrid[0:100:200j,0:100:200j]
positions = N.vstack([X.ravel(),Y.ravel()])
Z2 = N.reshape(kernel(positions).T, X.shape)
lev = N.arange(0.2,10.0,0.5)
CF=P.contourf(X,Y,1000*Z2,levels=lev,cmap=P.cm.YlOrRd,extend='max',zorder=1)
P.contour(X,Y,1000*Z2,levels=lev,colors='k',linewidths=0.5,zorder=1)
P.text(25,45,'N>40',size=22,weight='bold',ha='center',va='center',bbox=dict(boxstyle="circle", ec='k', fc='gray',alpha=0.5,lw=2))
P.tick_params(direction='out')
P.xlim(0,30)
P.ylim(0,60)
P.grid(color='k')
P.xlabel('nied [mm]',fontsize=16,weight='bold')
P.ylabel('Meldungen pro Tag je PD',fontsize=16,weight='bold')
P.title('Meldungen ('+filter+') ~ Nied',fontsize=16,weight='bold')
P.savefig('./img/nied_'+filter+'.png',dpi=240,bbox_inches='tight')