Beispiel #1
0
 def test_no_start(self, tas_series):
     tg = np.zeros(365) - 1
     tg = tas_series(tg, start='1/1/2000')
     out = xci.freshet_start(tg)
     np.testing.assert_equal(out, [
         np.nan,
     ])
Beispiel #2
0
    def test_simple(self, tas_series):
        tg = np.zeros(365) - 1
        w = 5

        i = 10
        tg[i:i + w - 1] += 6  # too short

        i = 20
        tg[i:i + w] += 6  # ok

        i = 30
        tg[i:i + w + 1] += 6  # Second valid condition, should be ignored.

        tg = tas_series(tg + K2C, start="1/1/2000")
        out = xci.freshet_start(tg, window=w)
        assert out[0] == tg.indexes["time"][20].dayofyear