def _make_dim_name_len(samples_dim_name, ns, d):
    """Make dim_names and dim_lens lists of dimension names and lens.

    Args:
        samples_dim_name: A string specifying the name to use for the trace
            samples dimension. Usually 'Time' or 'Depth'
        ns: An int specifying the number of samples per trace
        d: A tuple of tuples of the form (string, int), where the string
            specifies a dimension name, and the int specifies the number of
            entries in that dimension.

    Returns:
        dim_names: A list with the dimension names
        dim_lens: A list with the lengths of the dimensions
    """
    dim_names = []
    dim_lens = []
    for dim in d:
        dim_names.append(dim[0])
        dim_lens.append(dim[1])
    dim_names.append(samples_dim_name)
    dim_lens.append(ns)
    return dim_names, dim_lens
