Exemple #1
0
    def setUp(self):
        src_cube = iris.tests.stock.global_pp()

        # Make a cube that can't be located on the globe.
        cube = iris.cube.Cube(src_cube.data)
        cube.add_dim_coord(iris.coords.DimCoord(np.arange(96, dtype=np.float32) * 100, long_name='x', units='m'), 1)
        cube.add_dim_coord(iris.coords.DimCoord(np.arange(73, dtype=np.float32) * 100, long_name='y', units='m'), 0)
        cube.standard_name = 'air_temperature'
        cube.units = 'K'
        cube.assert_valid()
        self.cube = cube
Exemple #2
0
 def test_simple3(self):
     cubes = iris.cube.CubeList([
                                 self._make_cube(0, 0, 0),
                                 self._make_cube(0, 1, 1),
                                 self._make_cube(0, 2, 2),
                                 self._make_cube(1, 0, 3),
                                 self._make_cube(1, 1, 4),          
                                 self._make_cube(1, 2, 5),
                                ])
     cube = cubes.merge()[0]
     self.assertCML(cube, ('merge', 'time_triple_merging4.cml'), checksum=False)
     self.assertIsNone(cube.assert_valid())
     
     cube = iris.cube.CubeList(cubes[:-1]).merge()[0]
     self.assertCML(cube, ('merge', 'time_triple_merging5.cml'), checksum=False)
     self.assertIsNone(cube.assert_valid())
Exemple #3
0
    def test_simple3(self):
        cubes = iris.cube.CubeList([
                                    self._make_cube(0, 0, 0),
                                    self._make_cube(0, 1, 1),
                                    self._make_cube(0, 2, 2),
                                    self._make_cube(1, 0, 3),
                                    self._make_cube(1, 1, 4),
                                    self._make_cube(1, 2, 5),
                                   ])
        cube = cubes.merge()[0]
        self.assertCML(cube, ('merge', 'time_triple_merging4.cml'), checksum=False)
        self.assertIsNone(cube.assert_valid())

        cube = iris.cube.CubeList(cubes[:-1]).merge()[0]
        self.assertCML(cube, ('merge', 'time_triple_merging5.cml'), checksum=False)
        self.assertIsNone(cube.assert_valid())
Exemple #4
0
    def setUp(self):
        src_cube = iris.tests.stock.global_pp()

        # Make a cube that can't be located on the globe.
        cube = iris.cube.Cube(src_cube.data)
        cube.add_dim_coord(
            iris.coords.DimCoord(np.arange(96, dtype=np.float32) * 100,
                                 long_name='x',
                                 units='m'), 1)
        cube.add_dim_coord(
            iris.coords.DimCoord(np.arange(73, dtype=np.float32) * 100,
                                 long_name='y',
                                 units='m'), 0)
        cube.standard_name = 'air_temperature'
        cube.units = 'K'
        cube.assert_valid()
        self.cube = cube
Exemple #5
0
    def test_simple2(self):
        cubes = iris.cube.CubeList(
            [
                self._make_cube(0, 0, 0),
                self._make_cube(1, 0, 1),
                self._make_cube(2, 0, 2),
                self._make_cube(0, 1, 3),
                self._make_cube(1, 1, 4),
                self._make_cube(2, 1, 5),
            ]
        )
        cube = cubes.merge()[0]
        self.assertCML(cube, ("merge", "time_triple_merging2.cml"), checksum=False)
        self.assertIsNone(cube.assert_valid())

        cube = iris.cube.CubeList(cubes[:-1]).merge()[0]
        self.assertCML(cube, ("merge", "time_triple_merging3.cml"), checksum=False)
        self.assertIsNone(cube.assert_valid())