Beispiel #1
0
 def test_find_discontiguities_in_y(self):
     # Check that the mask we generate when making the discontiguity
     # matches that generated by find_discontiguities
     cube = self.testcube_discontig_along_y
     expected = cube.data.mask
     returned = find_discontiguities(cube)
     self.assertTrue(np.all(expected == returned))
 def test_find_discontiguities_in_y(self):
     # Check that the mask we generate when making the discontiguity
     # matches that generated by find_discontiguities
     cube = self.testcube_discontig_along_y
     expected = cube.data.mask
     returned = find_discontiguities(cube)
     self.assertTrue(np.all(expected == returned))
Beispiel #3
0
 def test_find_discontiguities_with_rtol(self):
     cube = self.testcube_discontig
     # Choose a very large relative tolerance which will result in fine
     # discontiguities being disregarded
     rtol = 1000
     # Construct an array the size of the points array filled with 'False'
     # to represent a mask showing no discontiguities
     expected = np.zeros(cube.shape, dtype=bool)
     returned = find_discontiguities(cube, rel_tol=rtol)
     self.assertTrue(np.all(expected == returned))
 def test_find_discontiguities_with_rtol(self):
     cube = self.testcube_discontig
     # Choose a very large relative tolerance which will result in fine
     # discontiguities being disregarded
     rtol = 1000
     # Construct an array the size of the points array filled with 'False'
     # to represent a mask showing no discontiguities
     expected = np.zeros(cube.shape, dtype=bool)
     returned = find_discontiguities(cube, rel_tol=rtol)
     self.assertTrue(np.all(expected == returned))
Beispiel #5
0
 def test_find_discontiguities_1d_coord(self):
     # Check that an error is raised when we try and use
     # find_discontiguities on 1D coordinates:
     cube = simple_3d()
     with self.assertRaises(NotImplementedError):
         find_discontiguities(cube)
 def test_find_discontiguities_1d_coord(self):
     # Check that an error is raised when we try and use
     # find_discontiguities on 1D coordinates:
     cube = simple_3d()
     with self.assertRaises(NotImplementedError):
         find_discontiguities(cube)