An adaptive masking method for beam halo measurement by a digital micro mirror device. (4th November 2021)