Returns cell scalars of a vtk object

def cell_scalar(mesh, name):
    """ Returns cell scalars of a vtk object """
    vtkarr = mesh.GetCellData().GetArray(name)
    if vtkarr:
        if isinstance(vtkarr, vtk.vtkBitArray):
            vtkarr = vtk_bit_array_to_char(vtkarr)
        return vtk_to_numpy(vtkarr)