def map_apply(func,scalararray):
    """Return a xarray dataarray with value func(scalararray.data)

    Parameters
    ----------
    func : function
        Any function that works on numpy arrays such that input and output
        arrays have the same shape.
    scalararray : xarray.DataArray

    Returns
    -------
    out : xarray.DataArray

    Methods
    -------
    uses dask map_block without ghost cells (map_overlap)
    """
    data = scalararray.data
    coords = scalararray.coords
    dims = scalararray.dims
    if is_daskarray(data):
        _out = data.map_block(func)
    else:
        _out = func(data)
    out = xr.DataArray(_out,coords,dims)
    return out