Notebook
import this
a provisional estimation of the drainage area:if Hochwasser.iloc[:,2]!= np.nan : Hochwasser["km2"]= Hochwasser.iloc[:,1]/Hochwasser.iloc[:,2]*1000 elif Hochwasser.iloc[:,2]!= "" : Hochwasser["km2"]= Hochwasser.iloc[:,1]/Hochwasser.iloc[:,2]*1000 else: Hochwasser["km2"]= np.nanHochwasser2= Hochwasser.iloc[:,2].astype('Int64') Hochwasser1 =Hochwasser.iloc[:,1].astype('Int64') #Hochwasser1 / Hochwasserlist =[Hochwasser1/int(x)*1000 for x in Hochwasser2 if x != np.nan if x != "" ] Hochwasserlist # ["km2"]else np.nan # elif Hochwasser.iloc[:,2]!= "" : Hochwasser["km2"]= Hochwasser.iloc[:,1]/Hochwasser.iloc[:,2]*1000 #else: Hochwasser["km2"]=type(Hochwasserlist)type(Hochwasserlist[0])Hochwasser["km2"]=Hochwasserlist[0]
import datetime today = datetime.date.today() dt= pd.to_datetime('1910/06/13', format='%Y/%m/%d') # date of earlier big flood 1946/08/01 Timesbetween= [] for ind in Hochwasser.index: dt1= ind print( dt1) interval= (dt1-dt).days print( interval) #Timesbetween= Timesbetween+ list(interval) dt =dt1 print( pd.to_datetime(today), (pd.to_datetime(today) -ind).days) #Timesbetween
intervals={"1910-06-13 00:00:00":40586, "1961-01-31 00:00:00":5297, "1966-11-12 00:00:00":2111, "1984-05-30 00:00:00":6409, "1984-07-02 00:00:00":33, "1984-11-23 00:00:00":144, "1988-03-16 00:00:00":1209, "1993-12-21 00:00:00":2106, # the former lowest val should go as I inserted the 2021 event "1995-01-23 00:00:00":398, #"1993-12-21 00:00:00":20, "2016-02-06 00:00:00":7684, "2021-07-14 00:00:00":1985} intervals= pd.DataFrame.from_dict(intervals, orient='index',columns=['TimeInterval']) #index= intervals[0] type(intervals)intervals.plot();intervals.info()int10= intervals.index int10
wiki=pd.read_html(io="https://en.wikipedia.org/wiki/Ahr", match='.+', flavor=None, header=None, index_col=None, skiprows=None, attrs=None, parse_dates=False, thousands=',', encoding=None, decimal='.', converters=None, na_values=None, keep_default_na=True, displayed_only=True) wiki #Tributaries
maybe this way gives errorsAdenauerbach_mittelwerte_Abf["Abfluss in m³/day"] = Adenauerbach_mittelwerte_Abf["Abfluss in m³/s"]*24*4
Adenauerbach.asfreq(freq='15M')
!pip3 install pandas==1.2.5 --user
Adenauer_mittelwerte_AbfDayStd= Adenauerbach_mittelwerte_Abf["Abfluss in m³/s"].resample('D', how=np.std) #on='Wasserstand in cm' Adenauerbach.resample("D").mean(); AdenauerbachDayMean["Wasserstand in cm"].tail(10) Adenauer_mittelwerte_AbfDayStd
Adenauerbach_Day_total_AbfJuly
# need to be multipl with counts (nan's) sns.scatterplot(data=AdenauerbachDayMean) sns.scatterplot(data=Adenauerbach_Day_total_AbfJuly, label="total outflow per day") ;
# need to be multopl with counts # sns.scatterplot(data=AdenauerbachDayMean)
df['Discharge in m³/day'] = df.interpolate(method="slinear") # ['Abfluss in m³/day']df['Discharge in m³/day'].plot()
df['Discharge in m³/day'].loc["14-07-2021"]
def recessioncurve(): recessioncoef=3.77*np.log(66.445/320) Q0 =66.445 curve=[] t=24 #for t in range(1,22): Qt= Q0* np.exp(-recessioncoef* t) curve.append(Qt) # curve= #Q0=Qt return curve, Qt recessioncurve()tribut_Abf["2021-07-14 18:30":"2021-07-16 23:45"]["Kreuzberg"]= tribut_Abf["2021-07-14 18:30":"2021-07-16 23:45"]["Müsch"]*66.445/320# merge was done, tribut_Abf["Total"]=tribut_Abf["Denn"]+tribut_Abf["Kreuzberg"]+tribut_Abf["Müsch"]+tribut_Abf["Kirmut"] #tribut_Abfmerge['Abfluss in m³/sec'] tribut_Abfmerge['Abfluss in m³/sec'].loc["2021-07-13 12:00":"2021-07-16"].plot(figsize=(16,5));
sns.scatterplot( x=[222.015,191.151, 178.894, 292.769], y=tributaries.max(), data=tributaries.max()); tributaries.tail()
mm/hr = Flow rate (350.7 l/hr) / Area (9m^2) = 38.97mm/hr. 100mm/h total liters= 8,800,000,000
import plotly.graph_objects as go fig = go.Figure(data=go.Cone(x=[1], y=[1], z=[1], u=[1], v=[0.5], w=[0.1])) fig.update_layout(scene_camera_eye=dict(x=1.76, y=1.8, z=0.92)) fig.show()import plotly.graph_objects as go fig = go.Figure(data=go.Cone( x=[1, 2, 3], y=[1, 2, 3], z=[1, 2, 3], u=[1, 0, 0], v=[0, 3, 0], w=[0, 0, 2], sizemode="absolute", sizeref=2, anchor="tip")) fig.update_layout( scene=dict(domain_x=[0, 1], camera_eye=dict(x=-0.57, y=1.36, z=0.58))) fig.show()import plotly.graph_objects as go fig = go.Figure(data=go.Streamtube(x=[0, 0, 0], y=[0, 1, 2], z=[0, 0, 0], u=[0, 0, 0], v=[2, 1, 1], w=[0, 0, 0])) fig.show()
Maximum_Abfluss_m³s Maximum_Wasserstand HQ 100 (m³/s) HW_waterlevel HW_Debit Exceedance #Outage_timeMessstatdrop.index
sns.regplot?sns.lineplot?
This parametrization corresponds to setting 's'= sigma and 'scale'= exp(mu).
lognorm.pdf??