X-ray CCDs are by definition sensitive in X-rays and not so in the other energy bands, such as, optical band. In particular, EPIC in XMM-Newton is equipped with optical-blocking filters, which should massively reduce the amount of low-energy (ultraviolet, optical and infrared) photons that reach the X-ray CCDs first of all.
Nevertheless the sensitivity of X-ray CCDs is non-zero even for infrared photons. When there are extremely bright sources, typically very bright (optical) stars, photons from them can excite a significant amount of electrons in the X-ray CCDs, and can be (falsely) recognised as an (X-ray) event. This phenomenon is known as optical loading.
The optical loading increases the local background level at best, which would do no good in determining the parameters of the detected sources in the area, or can even lead to the false detection of X-ray sources by itself. In EPIC, the optical loading is particularly prominent in pn (than MOSs).
There are a number of optical, infrared and even ultraviolet source catalogues available. Using those, users can make a sophisticated guess which area is likely to be affected with the optical loading. This task is designed to output the mask file to mask those (suspected) affected area.
In practice, this task reads one or more external catalogues (of optical/infrared/ultraviolet sources), applies the user-specified filter, such as filtering out faint sources in a catalogue, then outputs a mask file.
Then, users may wish to use the output mask file with dpssflag, to flag the sources, which are likely to be affected with the optical loading.
XMM-Newton SOC -- 2021-11-30