def _get_tb_name_and_tb_dim(ds):
    """return the name of the time 'bounds' variable and its second dimension"""
    assert "bounds" in ds.time.attrs, 'missing "bounds" attr on time'
    tb_name = ds.time.attrs["bounds"]
    assert tb_name in ds, f'missing "{tb_name}"'
    tb_dim = ds[tb_name].dims[-1]
    return tb_name, tb_dim