'Create new object with the same class, update attributes'

def __copy__(self):

    cls = self.__class__
    cmapobject = cls.__new__(cls)
    cmapobject.__dict__.update(self.__dict__)
    if self._isinit:
        cmapobject._lut = np.copy(self._lut)
    return cmapobject
