def lower_mask(dqarr, bitmask):
    """
        
    Function that lowers (unsets) all the bits in 'dqarr' contained
    in the bitmask.
            
    :Parameters:
            
    dqarr: numpy array or integer
        numpy array which represents a dq plane (or part of it).
        The function also works when dqarr is a scalar integer
    bitmask: integer
        A bit mask specifying all the bits to be logically "raised"
        in dqarr. For example,
        
        * bitmask=1 = 2**0 will lower bit 0.
        * bitmask=5 = 2**0 + 2**2 will lower bits 0 and 2.
        
    :Returns:
    
    newdqarr: numpy array or integer
        Returns array 'dqarr' with the specified bits lowered in all
        elements (pixels).

    """
    assert isinstance(bitmask, int)
    # The bits are lowered with a binary AND NOT operation.
    return dqarr & ~bitmask