Пример #1
0
 def test_2d_discontigous_masked(self):
     # Test a 2D coordinate which is discontiguous but masked at
     # discontiguities.
     cube = sample_2d_latlons()
     make_bounds_discontiguous_at_point(cube, 3, 4)
     iplt._check_bounds_contiguity_and_mask(cube.coord('longitude'),
                                            cube.data)
Пример #2
0
 def test_2d_discontigous_unmasked(self):
     # Test a 2D coordinate which is discontiguous and unmasked at
     # discontiguities.
     cube = sample_2d_latlons()
     make_bounds_discontiguous_at_point(cube, 3, 4)
     msg = 'coordinate are not contiguous'
     cube.data[3, 4] = ma.nomask
     with self.assertRaisesRegexp(ValueError, msg):
         iplt._check_bounds_contiguity_and_mask(cube.coord('longitude'),
                                                cube.data)
 def test_2d_discontigous_unmasked(self):
     # Test a 2D coordinate which is discontiguous and unmasked at
     # discontiguities.
     cube = sample_2d_latlons()
     make_bounds_discontiguous_at_point(cube, 3, 4)
     msg = 'coordinate are not contiguous'
     cube.data[3, 4] = ma.nomask
     with self.assertRaisesRegexp(ValueError, msg):
         _check_bounds_contiguity_and_mask(cube.coord('longitude'),
                                           cube.data)
Пример #4
0
 def setUp(self):
     # Set up a 2d lat-lon cube with 2d coordinates that have been
     # transformed so they are not in a regular lat-lon grid.
     # Then generate a discontiguity at a single lat-lon point.
     self.testcube_discontig = full2d_global()
     make_bounds_discontiguous_at_point(self.testcube_discontig, 3, 3)
     # Repeat that for a discontiguity in the grid 'Y' direction.
     self.testcube_discontig_along_y = full2d_global()
     make_bounds_discontiguous_at_point(self.testcube_discontig_along_y,
                                        2, 4, in_y=True)
Пример #5
0
 def setUp(self):
     # Set up a 2d lat-lon cube with 2d coordinates that have been
     # transformed so they are not in a regular lat-lon grid.
     # Then generate a discontiguity at a single lat-lon point.
     self.testcube_discontig = full2d_global()
     make_bounds_discontiguous_at_point(self.testcube_discontig, 3, 3)
     # Repeat that for a discontiguity in the grid 'Y' direction.
     self.testcube_discontig_along_y = full2d_global()
     make_bounds_discontiguous_at_point(self.testcube_discontig_along_y,
                                        2,
                                        4,
                                        in_y=True)
Пример #6
0
 def setUp(self):
     # Set up a 2d cube with a masked discontiguity to test masking
     # of 2-dimensional cubes
     self.cube_2d = full2d_global()
     make_bounds_discontiguous_at_point(self.cube_2d, 3, 3)
Пример #7
0
 def test_2d_discontigous_masked(self):
     # Test that a 2D coordinate which is discontiguous but masked at
     # discontiguities doesn't error.
     cube = sample_2d_latlons()
     make_bounds_discontiguous_at_point(cube, 3, 4)
     _check_bounds_contiguity_and_mask(cube.coord("longitude"), cube.data)
 def test_2d_discontigous_masked(self):
     # Test that a 2D coordinate which is discontiguous but masked at
     # discontiguities doesn't error.
     cube = sample_2d_latlons()
     make_bounds_discontiguous_at_point(cube, 3, 4)
     _check_bounds_contiguity_and_mask(cube.coord('longitude'), cube.data)
Пример #9
0
 def setUp(self):
     # Set up a 2d cube with a masked discontiguity to test masking
     # of 2-dimensional cubes
     self.cube_2d = full2d_global()
     make_bounds_discontiguous_at_point(self.cube_2d, 3, 3)