Esempio n. 1
0
 def derive_storms(self, rainserie, column, number_of_storms=3, drywindow=96, makeplot=True):
     """
     Select a number of storms out of the timeserie
     """
     storms = selectstorms(self.data[column], rainserie, number_of_storms=number_of_storms, drywindow=drywindow)
     if makeplot:
         fig, axes = plotstorms(self.data[column], rainserie, storms, make_comparable=True, period_title=True)
     return storms
Esempio n. 2
0
 def derive_storms(self, rainserie, column, number_of_storms=3,
                   drywindow=96, makeplot=True):
     """
     Select a number of storms out of the timeserie
     """
     storms = selectstorms(self.data[column], rainserie,
                         number_of_storms=number_of_storms,
                         drywindow=drywindow)
     if makeplot:
         fig, axes = plotstorms(self.data[column], rainserie, storms,
                                make_comparable=True,
                                period_title=True)
     return storms
Esempio n. 3
0
myflowserie.get_year('2011').get_month("Jun").get_recess().plot(figsize=(12,6))

#%%
fig, ax = plt.subplots(figsize=(13, 6))
myflowserie['LS06_347'].get_year('2010').get_month("Jul").get_highpeaks(150, above_percentile=0.9).plot(style='o', ax=ax)
myflowserie['LS06_347'].get_year('2010').get_month("Jul").plot(ax=ax)

#%%
fig, ax = plt.subplots(figsize=(13, 6))
myflowserie['LS06_347'].get_year('2010').get_month("Jul").get_lowpeaks(50, below_percentile=1.).plot(style='o', ax=ax)
myflowserie['LS06_347'].get_year('2010').get_month("Jul").plot(ax=ax)

#%% STORMS

#function can be used on pd.Series
stormfun = selectstorms(flowdata['LS06_347'], raindata['P05_039'],
                        number_of_storms = 3, drywindow = 96)
plotstorms(flowdata['LS06_347'], raindata['P05_039'], stormfun,
               make_comparable = False,
               period_title = True)

#%%implemented in the HydroAnalysis:
storms = myflowserie.derive_storms(raindata['P06_014'], 'LS06_347',
                                   number_of_storms=3, drywindow=96,
                                   makeplot=True)

#%% READY MADE FOR UNIT TEST PURPOSES
from pandas.util.testing import assert_frame_equal

class TestGetFunctions():

    def test_get_month(self):