예제 #1
0
def test_generate_grid_title():
    grid_shape = (1, 1, 1)
    grid_limits = ((0, 1), (0, 1), (0, 1))
    grid = pyart.testing.make_empty_grid(grid_shape, grid_limits)
    grid.metadata['instrument_name'] = 'bar'
    grid.fields['foo'] = {}

    title = common.generate_grid_title(grid, 'foo', 0)
    assert title == 'bar 0.0 km 2000-01-01T00:00:00Z \nFoo'
예제 #2
0
def test_generate_grid_title():
    grid_shape = (1, 1, 1)
    grid_limits = ((0, 1), (0, 1), (0, 1))
    grid = pyart.testing.make_empty_grid(grid_shape, grid_limits)
    grid.metadata['instrument_name'] = 'bar'
    grid.fields['foo'] = {}

    title = common.generate_grid_title(grid, 'foo', 0)
    assert title == 'bar 0.0 km 2000-01-01T00:00:00Z \nFoo'
예제 #3
0
    def generate_grid_title(self, field, level):
        """
        Generate a title for a plot.

        Parameters
        ----------
        field : str
            Field plotted.
        level : int
            Vertical level plotted.

        Returns
        -------
        title : str
            Plot title.

        """
        return common.generate_grid_title(self.grid, field, level)