An optical system suitable for optical overlay metrology, the optical system comprising: an objective; a source of illumination, wherein the source of illumination includes polarization control elements configured to select a polarization state of the electromagnetic radiation; wherein the polarization control elements are configured to select the polarization state as a function of wavelength of the illumination; an illumination system having illumination optics configured to direct the illumination onto the objective; and at least two dynamic optical array devices (302, 304) located at a pupil conjugate plane and a field conjugate plane, respectively in the illumination system, wherein the dynamic optical array devices (302, 304) are configured to control one or more properties of the illumination coupled from the illumination system to the objective; wherein the dynamic optical array devices (302, 304) include arrays of dynamic optical devices that are configured to adjust an optical property of the illumination at the pupil conjugate plane or field conjugate plane on a per-pixel basis; the dynamic optical array devices (302, 304) include arrays of electronically adjustable polarizing devices configured to selectively transmit or reflect illumination of a particular polarization on a per-pixel basis, or arrays of polarization rotating devices configured to rotate polarization of illumination to a desired orientation on a per-pixel basis, or arrays of spectral filtering devices configured to selectively reflect or transmit particular ranges of electromagnetic frequency of illumination on a per-pixel basis; the objective is configured to focus the illumination onto a target and collect illumination scattered radiation from the target; and the optical system further comprises a collection system having collection optics optically coupled to the objective, wherein the collection optics are configured to collect the scattered illumination from the target and couple the scattered illumination to a detector, wherein the dynamic optical array devices are configured to introduce compensating optics aberrations into the illumination system to remove optics aberrations of the collection optics, and the collection system includes an additional third dynamic optical array device located at a pupil plane of the collection optics, wherein the third dynamic optical device is coupled to a controller and configured to filter out unneeded diffraction orders in the collection optics from reaching the detector. an objective; a source of illumination, wherein the source of illumination includes polarization control elements configured to select a polarization state of the electromagnetic radiation; wherein the polarization control elements are configured to select the polarization state as a function of wavelength of the illumination; an illumination system having illumination optics configured to direct the illumination onto the objective; and at least two dynamic optical array devices (302, 304) located at a pupil conjugate plane and a field conjugate plane, respectively in the illumination system, wherein the dynamic optical array devices (302, 304) are configured to control one or more properties of the illumination coupled from the illumination system to the objective; wherein the dynamic optical array devices (302, 304) include arrays of dynamic optical devices that are configured to adjust an optical property of the illumination at the pupil conjugate plane or field conjugate plane on a per-pixel basis; the dynamic optical array devices (302, 304) include arrays of electronically adjustable polarizing devices configured to selectively transmit or reflect illumination of a particular polarization on a per-pixel basis, or arrays of polarization rotating devices configured to rotate polarization of illumination to a desired orientation on a per-pixel basis, or arrays of spectral filtering devices configured to selectively reflect or transmit particular ranges of electromagnetic frequency of illumination on a per-pixel basis; the objective is configured to focus the illumination onto a target and collect illumination scattered radiation from the target; and the optical system further comprises a collection system having collection optics optically coupled to the objective, wherein the collection optics are configured to collect the scattered illumination from the target and couple the scattered illumination to a detector, wherein the dynamic optical array devices are configured to introduce compensating optics aberrations into the illumination system to remove optics aberrations of the collection optics, and the collection system includes an additional third dynamic optical array device located at a pupil plane of the collection optics, wherein the third dynamic optical device is coupled to a controller and configured to filter out unneeded diffraction orders in the collection optics from reaching the detector.