(lon0_b, lon1_b, d_lon,
            lat0_b, lat1_b, d_lat)
return ds
2D rectilinear grid centers and bounds

    Parameters
    ----------
    lon0_b, lon1_b : float
        Longitude bounds

    d_lon : float
        Longitude step size, i.e. grid resolution

    lat0_b, lat1_b : float
        Latitude bounds

    d_lat : float
        Latitude step size, i.e. grid resolution

    Returns
    -------
    ds : xarray DataSet with coordinate values
2D rectilinear grid centers and bounds
2D rectilinear grid centers and bounds
def grid_2d(lon0_b, lon1_b, d_lon,
            lat0_b, lat1_b, d_lat):
    '''
    2D rectilinear grid centers and bounds

    Parameters
    ----------
    lon0_b, lon1_b : float
        Longitude bounds

    d_lon : float
        Longitude step size, i.e. grid resolution

    lat0_b, lat1_b : float
        Latitude bounds

    d_lat : float
        Latitude step size, i.e. grid resolution

    Returns
    -------
    ds : xarray DataSet with coordinate values

    '''

    lon_1d, lon_b_1d = _grid_1d(lon0_b, lon1_b, d_lon)
    lat_1d, lat_b_1d = _grid_1d(lat0_b, lat1_b, d_lat)

    lon, lat = np.meshgrid(lon_1d, lat_1d)
    lon_b, lat_b = np.meshgrid(lon_b_1d, lat_b_1d)

    ds = xr.Dataset(coords={'lon': (['y', 'x'], lon),
                            'lat': (['y', 'x'], lat),
                            'lon_b': (['y_b', 'x_b'], lon_b),
                            'lat_b': (['y_b', 'x_b'], lat_b)
                            }
                    )

    return ds
def grid_2d ( lon0_b , lon1_b , d_lon , lat0_b , lat1_b , d_lat ) : lon_1d , lon_b_1d = _grid_1d ( lon0_b , lon1_b , d_lon ) lat_1d , lat_b_1d = _grid_1d ( lat0_b , lat1_b , d_lat ) lon , lat = np . meshgrid ( lon_1d , lat_1d ) lon_b , lat_b = np . meshgrid ( lon_b_1d , lat_b_1d ) ds = xr . Dataset ( coords = { 'lon' : ( [ 'y' , 'x' ] , lon ) , 'lat' : ( [ 'y' , 'x' ] , lat ) , 'lon_b' : ( [ 'y_b' , 'x_b' ] , lon_b ) , 'lat_b' : ( [ 'y_b' , 'x_b' ] , lat_b ) } ) return ds