Ejemplo n.º 1
0
 def test_two_events_freeze_day(self, tasmin_series):
     a = np.zeros(365) + K2C + 5.0
     a[2:5] -= 20
     a[6:10] -= 20
     ts = tasmin_series(a)
     out = atmos.consecutive_frost_days(ts)
     np.testing.assert_array_equal(out, [4])
Ejemplo n.º 2
0
    def test_one_freeze_day(self, tasmin_series):
        a = np.zeros(365) + K2C + 5.0
        a[2] -= 20

        ts = tasmin_series(a)
        out = atmos.consecutive_frost_days(ts)
        np.testing.assert_array_equal(out, [1])
Ejemplo n.º 3
0
 def test_convert_units_freeze_day(self, tasmin_series):
     a = np.zeros(365) + 5.0
     a[2:5] -= 20
     a[6:10] -= 20
     ts = tasmin_series(a)
     ts.attrs["units"] = "C"
     out = atmos.consecutive_frost_days(ts)
     np.testing.assert_array_equal(out, [4])