def drop_single_coords(da):
    """
    drops all dimensions if there is only a single coordinate

    Parameters
    ----------
    da : xr.DataArray

    Returns
    -------
    da : xr.DataArray
    """
    # import pdb; pdb.set_trace()
    for coord in da.coords:
        if coord in da.dims:
            if len(da.coords[coord].values) == 1:
                print('Found only one value for coords '+ coord +' Dropping')
                da = da.isel({coord: 0}).drop(coord)
        else:
            print('Coordinate  '+ coord +' had no corresponding dimension, dropping')
            da = da.drop(coord)
            
    return da