def reshape_da(da):
    """

    Parameters
    ----------
    da: dataarray with [time, stacked, lat, lon]

    Returns
    -------
    da: dataarray with [sample, stacked]
    """
    da = da.stack(sample=('time', 'lat', 'lon'))
    return da.transpose('sample', 'var_names')