コード例 #1
0
ファイル: test_quickplot.py プロジェクト: wilbertcs/iris
    def setUp(self):
        tests.GraphicsTest.setUp(self)
        filename = tests.get_data_path(
            ("PP", "COLPEX", "theta_and_orog_subset.pp"))
        self.cube = test_plot.load_cube_once(filename,
                                             "air_potential_temperature")

        self.draw_module = iris.quickplot
        self.contourf = test_plot.LambdaStr(
            "iris.quickplot.contourf",
            lambda cube, *args, **kwargs: iris.quickplot.contourf(
                cube, *args, **kwargs),
        )
        self.contour = test_plot.LambdaStr(
            "iris.quickplot.contour",
            lambda cube, *args, **kwargs: iris.quickplot.contour(
                cube, *args, **kwargs),
        )
        self.points = test_plot.LambdaStr(
            "iris.quickplot.points",
            lambda cube, *args, **kwargs: iris.quickplot.points(
                cube, c=cube.data, *args, **kwargs),
        )
        self.plot = test_plot.LambdaStr(
            "iris.quickplot.plot",
            lambda cube, *args, **kwargs: iris.quickplot.plot(
                cube, *args, **kwargs),
        )

        self.results = {
            "yx": (
                [self.contourf, ["grid_latitude", "grid_longitude"]],
                [self.contourf, ["grid_longitude", "grid_latitude"]],
                [self.contour, ["grid_latitude", "grid_longitude"]],
                [self.contour, ["grid_longitude", "grid_latitude"]],
                [self.points, ["grid_latitude", "grid_longitude"]],
                [self.points, ["grid_longitude", "grid_latitude"]],
            ),
            "zx": (
                [self.contourf, ["model_level_number", "grid_longitude"]],
                [self.contourf, ["grid_longitude", "model_level_number"]],
                [self.contour, ["model_level_number", "grid_longitude"]],
                [self.contour, ["grid_longitude", "model_level_number"]],
                [self.points, ["model_level_number", "grid_longitude"]],
                [self.points, ["grid_longitude", "model_level_number"]],
            ),
            "tx": (
                [self.contourf, ["time", "grid_longitude"]],
                [self.contourf, ["grid_longitude", "time"]],
                [self.contour, ["time", "grid_longitude"]],
                [self.contour, ["grid_longitude", "time"]],
                [self.points, ["time", "grid_longitude"]],
                [self.points, ["grid_longitude", "time"]],
            ),
            "x": ([self.plot, ["grid_longitude"]], ),
            "y": ([self.plot, ["grid_latitude"]], ),
        }
コード例 #2
0
    def setUp(self):
        tests.GraphicsTest.setUp(self)
        filename = tests.get_data_path(
            ('PP', 'COLPEX', 'theta_and_orog_subset.pp'))
        self.cube = test_plot.load_cube_once(filename,
                                             'air_potential_temperature')

        self.draw_module = iris.quickplot
        self.contourf = test_plot.LambdaStr(
            'iris.quickplot.contourf',
            lambda cube, *args, **kwargs: iris.quickplot.contourf(
                cube, *args, **kwargs))
        self.contour = test_plot.LambdaStr(
            'iris.quickplot.contour',
            lambda cube, *args, **kwargs: iris.quickplot.contour(
                cube, *args, **kwargs))
        self.points = test_plot.LambdaStr(
            'iris.quickplot.points', lambda cube, *args, **kwargs: iris.
            quickplot.points(cube, c=cube.data, *args, **kwargs))
        self.plot = test_plot.LambdaStr(
            'iris.quickplot.plot',
            lambda cube, *args, **kwargs: iris.quickplot.plot(
                cube, *args, **kwargs))

        self.results = {
            'yx': (
                [self.contourf, ['grid_latitude', 'grid_longitude']],
                [self.contourf, ['grid_longitude', 'grid_latitude']],
                [self.contour, ['grid_latitude', 'grid_longitude']],
                [self.contour, ['grid_longitude', 'grid_latitude']],
                [self.points, ['grid_latitude', 'grid_longitude']],
                [self.points, ['grid_longitude', 'grid_latitude']],
            ),
            'zx': (
                [self.contourf, ['model_level_number', 'grid_longitude']],
                [self.contourf, ['grid_longitude', 'model_level_number']],
                [self.contour, ['model_level_number', 'grid_longitude']],
                [self.contour, ['grid_longitude', 'model_level_number']],
                [self.points, ['model_level_number', 'grid_longitude']],
                [self.points, ['grid_longitude', 'model_level_number']],
            ),
            'tx': (
                [self.contourf, ['time', 'grid_longitude']],
                [self.contourf, ['grid_longitude', 'time']],
                [self.contour, ['time', 'grid_longitude']],
                [self.contour, ['grid_longitude', 'time']],
                [self.points, ['time', 'grid_longitude']],
                [self.points, ['grid_longitude', 'time']],
            ),
            'x': ([self.plot, ['grid_longitude']], ),
            'y': ([self.plot, ['grid_latitude']], ),
        }