Ejemplo n.º 1
0
    def test_getAverageBaseflowFrequencyPerSection(self):
        if self.usepandas:
            for th in range(-10, 10):
                th = th + np.random.uniform(-1, 1, 1)[0]
                sig_val = sig.getAverageBaseflowFrequencyPerSection(
                    self.simulation,
                    self.observation,
                    datetime_series=self.dd_daily,
                    threshold_value=th,
                    mode="get_signature")
                sig_raw = sig.getAverageBaseflowFrequencyPerSection(
                    self.simulation,
                    self.observation,
                    datetime_series=self.ddd,
                    threshold_value=th,
                    mode="get_raw_data")
                sig_dev = sig.getAverageBaseflowFrequencyPerSection(
                    self.simulation,
                    self.observation,
                    datetime_series=self.dd_daily,
                    threshold_value=th,
                    mode="calc_Dev")

                self.assertTrue(sig_raw.dtypes[0] == "int64"
                                or sig_raw.dtypes[0] == "float64")
                self.assertEqual(sig_raw["baseflow"].__len__(), 730)

                self.assertEqual(str(type(sig_raw.index.tolist()[0])),
                                 "<class 'pandas.tslib.Timestamp'>")

                self.assertEqual(type(sig_dev), type(1.0))
                self.assertEqual(type(sig_val), type(1.0))
Ejemplo n.º 2
0
                                section="day"))
print(
    sig.getAverageBaseflowDuration(simulation,
                                   observation,
                                   dd_daily,
                                   threshold_factor=5,
                                   section="day"))

print(
    sig.getAverageBaseflowDuration(simulation,
                                   observation,
                                   dd_daily,
                                   threshold_factor=0.2,
                                   section="day"))
print(
    sig.getAverageBaseflowFrequencyPerSection(simulation, observation,
                                              dd_daily, 3, "day"))
print(
    sig.getAverageBaseflowUnderflowPerSection(simulation,
                                              observation,
                                              dd_daily,
                                              threshold_factor=4,
                                              section="day"))

print(
    sig.getBaseflowIndex(simulation, observation,
                         pd.date_range("2015-05-01", periods=timespanlen)))
print(sig.getSlopeFDC(simulation, observation))
print(
    sig.getLowFlowVar(simulation, observation,
                      pd.date_range("2015-05-01", periods=timespanlen)))
print(