implemented so that a mask object can be used with optgeom to ignore faulty pixels during the geometry optimization