there is a function in mdtraj that will do this. it's `md.utils.ensure_type`. A call like `ensure_type(indices, dtype=np.int, ndim=1, name='indices', can_be_none=False)` will do it.