original_docstring: Create test cube on irregular grid.
docstring: Create test cube on irregular grid.
docstring_tokens: Create test cube on irregular grid .
code: def create_irregular_grid_cube(data, lons, lats):
      """Create test cube on irregular grid."""
      nlat = iris.coords.DimCoord(range(data.shape[0]), var_name='nlat')
      nlon = iris.coords.DimCoord(range(data.shape[1]), var_name='nlon')
      lat = iris.coords.AuxCoord(lats,
                                 var_name='lat',
                                 standard_name='latitude',
                                 units='degrees')
      lon = iris.coords.AuxCoord(lons,
                                 var_name='lon',
                                 standard_name='longitude',
                                 units='degrees')
      dim_coord_spec = [
          (nlat, 0),
          (nlon, 1),
      ]
      aux_coord_spec = [
          (lat, [0, 1]),
          (lon, [0, 1]),
      ]
      cube = iris.cube.Cube(
          data,
          var_name='tos',
          units='K',
          dim_coords_and_dims=dim_coord_spec,
          aux_coords_and_dims=aux_coord_spec,
      )
      return cube
code_tokens: def create_irregular_grid_cube ( data , lons , lats ) : nlat = iris . coords . DimCoord ( range ( data . shape [ 0 ] ) , var_name = 'nlat' ) nlon = iris . coords . DimCoord ( range ( data . shape [ 1 ] ) , var_name = 'nlon' ) lat = iris . coords . AuxCoord ( lats , var_name = 'lat' , standard_name = 'latitude' , units = 'degrees' ) lon = iris . coords . AuxCoord ( lons , var_name = 'lon' , standard_name = 'longitude' , units = 'degrees' ) dim_coord_spec = [ ( nlat , 0 ) , ( nlon , 1 ) , ] aux_coord_spec = [ ( lat , [ 0 , 1 ] ) , ( lon , [ 0 , 1 ] ) , ] cube = iris . cube . Cube ( data , var_name = 'tos' , units = 'K' , dim_coords_and_dims = dim_coord_spec , aux_coords_and_dims = aux_coord_spec , ) return cube
short_docstring: Create test cube on irregular grid.
short_docstring_tokens: Create test cube on irregular grid .
comment: """Create test cube on irregular grid."""