(ds)
return locstream, (1,) + lon.shape
Convert xarray DataSet or dictionary to ESMF.LocStream object.

    Parameters
    ----------
    ds : xarray DataSet or dictionary
        Contains variables ``lon``, ``lat``.

    Returns
    -------
    locstream : ESMF.LocStream object
Convert xarray DataSet or dictionary to ESMF.LocStream object.
Convert xarray DataSet or dictionary to ESMF . LocStream object .
def ds_to_ESMFlocstream(ds):
    '''
    Convert xarray DataSet or dictionary to ESMF.LocStream object.

    Parameters
    ----------
    ds : xarray DataSet or dictionary
        Contains variables ``lon``, ``lat``.

    Returns
    -------
    locstream : ESMF.LocStream object

    '''

    lon = np.asarray(ds['lon'])
    lat = np.asarray(ds['lat'])

    if len(lon.shape) > 1:
        raise ValueError("lon can only be 1d")
    if len(lat.shape) > 1:
        raise ValueError("lat can only be 1d")

    assert lon.shape == lat.shape

    locstream = esmf_locstream(lon, lat)

    return locstream, (1,) + lon.shape
def ds_to_ESMFlocstream ( ds ) : lon = np . asarray ( ds [ 'lon' ] ) lat = np . asarray ( ds [ 'lat' ] ) if len ( lon . shape ) > 1 : raise ValueError ( "lon can only be 1d" ) if len ( lat . shape ) > 1 : raise ValueError ( "lat can only be 1d" ) assert lon . shape == lat . shape locstream = esmf_locstream ( lon , lat ) return locstream , ( 1 , ) + lon . shape