Пример #1
0
    def test_getBaseflowIndex(self):
        if self.usepandas:
            sig_raw = sig.getBaseflowIndex(self.simulation,
                                           self.observation,
                                           datetime_series=self.dd_daily,
                                           mode="get_raw_data")

            self.assertEqual(type(sig_raw), type({}))
            self.assertGreater(sig_raw.__len__(), 0)

            sig_sig_1 = sig.getBaseflowIndex(self.simulation,
                                             self.observation,
                                             datetime_series=pd.date_range(
                                                 "2015-05-01",
                                                 periods=self.timespanlen),
                                             mode="get_signature")
            sig_sig_2 = sig.getBaseflowIndex(self.simulation,
                                             None,
                                             datetime_series=pd.date_range(
                                                 "2015-05-01",
                                                 periods=self.timespanlen),
                                             mode="get_signature")

            sig_dev = sig.getBaseflowIndex(self.simulation,
                                           self.observation,
                                           datetime_series=pd.date_range(
                                               "2015-05-01",
                                               periods=self.timespanlen),
                                           mode="calc_Dev")

            self.assertEqual(type(1.0), type(float(sig_sig_1)))
            self.assertEqual(type({}), type(sig_sig_2))
            self.assertEqual(type(1.0), type(float(sig_dev)))
Пример #2
0
                                   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(
    sig.getHighFlowVar(simulation, observation,
                       pd.date_range("2015-05-01", periods=timespanlen)))