Ejemplo n.º 1
0
 def test_get_son(self):
     """Test function for summer"""
     sliced = extract_season(self.cube, 'son')
     iris.coord_categorisation.add_month_number(sliced, 'time')
     assert_array_equal(
         np.array([9, 10, 11, 9, 10, 11]),
         sliced.coord('month_number').points)
Ejemplo n.º 2
0
 def test_get_mam(self):
     """Test function for spring"""
     sliced = extract_season(self.cube, 'mam')
     iris.coord_categorisation.add_month_number(sliced, 'time')
     assert_array_equal(
         np.array([3, 4, 5, 3, 4, 5]),
         sliced.coord('month_number').points)
Ejemplo n.º 3
0
 def test_get_djf_caps(self):
     """Test function works when season specified in caps"""
     sliced = extract_season(self.cube, 'DJF')
     iris.coord_categorisation.add_month_number(sliced, 'time')
     assert_array_equal(
         np.array([1, 2, 12, 1, 2, 12]),
         sliced.coord('month_number').points)
Ejemplo n.º 4
0
 def test_get_djf(self):
     """Test function for winter"""
     sliced = extract_season(self.cube, 'djf')
     iris.coord_categorisation.add_month_number(sliced, 'time')
     assert_array_equal(
         np.array([1, 2, 12, 1, 2, 12]),
         sliced.coord('month_number').points)
Ejemplo n.º 5
0
 def test_get_jja(self):
     """Test function for summer"""
     sliced = extract_season(self.cube, 'jja')
     assert_array_equal(np.array([6, 7, 8, 6, 7, 8]),
                        sliced.coord('month_number').points)
Ejemplo n.º 6
0
 def test_get_djf(self):
     """Test function for winter"""
     sliced = extract_season(self.cube, 'djf')
     print(sliced)
     assert_array_equal(np.array([1, 2, 12, 1, 2, 12]),
                        sliced.coord('month_number').points)
Ejemplo n.º 7
0
 def test_get_son(self):
     """Test function for summer"""
     sliced = extract_season(self.cube, 'son')
     print(sliced)
     assert_array_equal(np.array([9, 10, 11, 9, 10, 11]),
                        sliced.coord('month_number').points)
Ejemplo n.º 8
0
 def test_get_mam(self):
     """Test function for spring"""
     sliced = extract_season(self.cube, 'mam')
     print(sliced)
     assert_array_equal(np.array([3, 4, 5, 3, 4, 5]),
                        sliced.coord('month_number').points)
Ejemplo n.º 9
0
 def test_get_djf_caps(self):
     """Test function works when season specified in caps"""
     sliced = extract_season(self.cube, 'DJF')
     print(sliced)
     assert_array_equal(np.array([1, 2, 12, 1, 2, 12]),
                        sliced.coord('month_number').points)