Beispiel #1
0
 def test_2d_lat_bounds(self):
     coord = AuxCoord(np.array([[1, 1], [3, 3]]),
                      bounds=np.array([[[0, 0, 2, 2], [0, 0, 2, 2]],
                                       [[2, 2, 4, 4], [2, 2, 4, 4]]]))
     expected = np.array([[0, 0, 0], [2, 2, 2], [4, 4, 4]])
     result = coord.contiguous_bounds()
     self.assertArrayEqual(result, expected)
Beispiel #2
0
 def test_2d_lat_bounds(self):
     coord = AuxCoord(np.array([[1, 1], [3, 3]]),
                      bounds=np.array([[[0, 0, 2, 2], [0, 0, 2, 2]],
                                       [[2, 2, 4, 4], [2, 2, 4, 4]]]))
     expected = np.array([[0, 0, 0], [2, 2, 2], [4, 4, 4]])
     result = coord.contiguous_bounds()
     self.assertArrayEqual(result, expected)
Beispiel #3
0
 def test_2d_coord_no_bounds_error(self):
     coord = AuxCoord(np.array([[0, 0], [5, 5]]), standard_name="latitude")
     emsg = "Guessing bounds of 2D coords is not currently supported"
     with self.assertRaisesRegex(ValueError, emsg):
         coord.contiguous_bounds()
Beispiel #4
0
 def test_2d_coord_no_bounds_error(self):
     coord = AuxCoord(np.array([[0, 0], [5, 5]]), standard_name='latitude')
     emsg = 'Guessing bounds of 2D coords is not currently supported'
     with self.assertRaisesRegexp(ValueError, emsg):
         coord.contiguous_bounds()